diff options
author | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-19 19:25:12 +0000 |
---|---|---|
committer | jochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-19 19:25:12 +0000 |
commit | 1b93c237f36e291242da6b03550f2c4a9f1c6d1c (patch) | |
tree | 91bbdda0b6425fc5a2b191ef0777619f5cce8f19 /gin/runner.cc | |
parent | 41494f74e8f9dac770129841b73b5251b96b6fe0 (diff) | |
download | chromium_src-1b93c237f36e291242da6b03550f2c4a9f1c6d1c.zip chromium_src-1b93c237f36e291242da6b03550f2c4a9f1c6d1c.tar.gz chromium_src-1b93c237f36e291242da6b03550f2c4a9f1c6d1c.tar.bz2 |
Introduce a Gin class instead of using global functions to control gin
The Gin class holds and controls a v8::Isolate. The isolate is not
entered by default, i.e. before you can use gin for a given Gin
instance, you need to enter the isolate first, e.g. by using a
v8::Isolate::Scope.
This has the advantage that we don't rely on the deprecate default
isolate, and also support having multiple isolates in one process.
BUG=317398
R=abarth@chromium.org
TEST=gin_unittests and mojo_js_bindings_unittests pass
Review URL: https://codereview.chromium.org/76353002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236029 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gin/runner.cc')
-rw-r--r-- | gin/runner.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gin/runner.cc b/gin/runner.cc index 46671c5..f45d6a0 100644 --- a/gin/runner.cc +++ b/gin/runner.cc @@ -42,6 +42,7 @@ Runner::Runner(RunnerDelegate* delegate, Isolate* isolate) : ContextHolder(isolate), delegate_(delegate), weak_factory_(this) { + v8::Isolate::Scope isolate_scope(isolate); HandleScope handle_scope(isolate); SetContext(Context::New(isolate, NULL, delegate_->GetGlobalTemplate(this))); @@ -66,7 +67,8 @@ void Runner::Run(v8::Handle<Script> script) { } Runner::Scope::Scope(Runner* runner) - : handle_scope_(runner->isolate()), + : isolate_scope_(runner->isolate()), + handle_scope_(runner->isolate()), scope_(runner->context()) { } |