Make the node environment constrained in browser_main_parts.

This commit is contained in:
Cheng Zhao 2014-06-30 14:16:16 +08:00
parent 1d359cb8aa
commit 6a891be0e4
6 changed files with 24 additions and 21 deletions

View file

@ -6,6 +6,7 @@
#define ATOM_BROWSER_ATOM_BROWSER_MAIN_PARTS_H_
#include "brightray/browser/browser_main_parts.h"
#include "v8/include/v8.h"
namespace atom {
@ -40,6 +41,13 @@ class AtomBrowserMainParts : public brightray::BrowserMainParts {
scoped_ptr<Browser> browser_;
scoped_ptr<NodeBindings> node_bindings_;
// The V8 environment of browser process.
v8::Isolate* isolate_;
v8::Locker locker_;
v8::HandleScope handle_scope_;
v8::UniquePersistent<v8::Context> context_;
v8::Context::Scope context_scope_;
static AtomBrowserMainParts* self_;
DISALLOW_COPY_AND_ASSIGN(AtomBrowserMainParts);