diff options
author | ager@chromium.org <ager@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-18 15:10:54 +0000 |
---|---|---|
committer | ager@chromium.org <ager@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-18 15:10:54 +0000 |
commit | edfc0b29c74db77159655757745764dd3a588d55 (patch) | |
tree | 721d6d634003ed90d9671dbbd6791700ed725f85 /webkit/port | |
parent | 6b1831a453e6978482bf29da9185150352c8c7f7 (diff) | |
download | chromium_src-edfc0b29c74db77159655757745764dd3a588d55.zip chromium_src-edfc0b29c74db77159655757745764dd3a588d55.tar.gz chromium_src-edfc0b29c74db77159655757745764dd3a588d55.tar.bz2 |
Add a handle scope to V8Proxy::initContextIfNeeded.
initContextIfNeeded can be called without a handle scope in place
which will lead to a renderer crash when creating the first handle.
Also V8Proxy::initContextIfNeeded creates a number of local handles
that should be deallocated on exit.
BUG=8922
Review URL: http://codereview.chromium.org/48131
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11965 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/port')
-rw-r--r-- | webkit/port/bindings/v8/v8_proxy.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/webkit/port/bindings/v8/v8_proxy.cpp b/webkit/port/bindings/v8/v8_proxy.cpp index df75f3b..2af4fbc 100644 --- a/webkit/port/bindings/v8/v8_proxy.cpp +++ b/webkit/port/bindings/v8/v8_proxy.cpp @@ -2375,6 +2375,9 @@ void V8Proxy::InitContextIfNeeded() if (!m_context.IsEmpty()) return; + // Create a handle scope for all local handles. + v8::HandleScope handle_scope; + // Setup the security handlers and message listener. This only has // to be done once. static bool v8_initialized = false; @@ -2400,7 +2403,7 @@ void V8Proxy::InitContextIfNeeded() // Starting from now, use local context only. v8::Local<v8::Context> context = GetContext(); - v8::Context::Scope scope(context); + v8::Context::Scope context_scope(context); // Store the first global object created so we can reuse it. if (m_global.IsEmpty()) { |