Enable converting v8::Function to base::Callback.
This commit is contained in:
parent
8f2b998718
commit
499c9bc3b9
5 changed files with 262 additions and 1 deletions
28
atom/common/browser_v8_locker.h
Normal file
28
atom/common/browser_v8_locker.h
Normal file
|
@ -0,0 +1,28 @@
|
|||
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef ATOM_COMMON_LOCKED_HANDLE_SCOPE_H_
|
||||
#define ATOM_COMMON_LOCKED_HANDLE_SCOPE_H_
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "v8/include/v8.h"
|
||||
|
||||
namespace atom {
|
||||
|
||||
// Like v8::Locker, but only do lock when in browser process.
|
||||
class BrowserV8Locker {
|
||||
public:
|
||||
BrowserV8Locker(v8::Isolate* isolate);
|
||||
~BrowserV8Locker();
|
||||
|
||||
private:
|
||||
void* operator new(size_t size);
|
||||
void operator delete(void*, size_t);
|
||||
|
||||
scoped_ptr<v8::Locker> locker_;
|
||||
};
|
||||
|
||||
} // namespace atom
|
||||
|
||||
#endif // ATOM_COMMON_LOCKED_HANDLE_SCOPE_H_
|
Loading…
Add table
Add a link
Reference in a new issue