[v8] isolate parameter added to all v8::peristent calls
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Feb 2013 10:17:15 +0000 (10:17 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Feb 2013 10:17:15 +0000 (10:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=109268

Patch by Dan Carney <dcarney@google.com> on 2013-02-08
Reviewed by Kentaro Hara.

Source/WebCore:

No new tests. No change in functionality.

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateDomainSafeFunctionGetter):
(GenerateNamedConstructorCallback):
(GenerateImplementation):
* bindings/scripts/test/V8/V8Float64Array.cpp:
(WebCore::V8Float64Array::GetRawTemplate):
* bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
(WebCore::TestActiveDOMObjectV8Internal::postMessageAttrGetter):
(WebCore::V8TestActiveDOMObject::GetRawTemplate):
* bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
(WebCore::V8TestCustomNamedGetter::GetRawTemplate):
* bindings/scripts/test/V8/V8TestEventConstructor.cpp:
(WebCore::V8TestEventConstructor::GetRawTemplate):
* bindings/scripts/test/V8/V8TestEventTarget.cpp:
(WebCore::V8TestEventTarget::GetRawTemplate):
* bindings/scripts/test/V8/V8TestException.cpp:
(WebCore::V8TestException::GetRawTemplate):
* bindings/scripts/test/V8/V8TestInterface.cpp:
(WebCore::V8TestInterface::GetRawTemplate):
* bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
(WebCore::V8TestMediaQueryListListener::GetRawTemplate):
* bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
(WebCore::V8TestNamedConstructorConstructor::GetTemplate):
(WebCore::V8TestNamedConstructor::GetRawTemplate):
* bindings/scripts/test/V8/V8TestNode.cpp:
(WebCore::V8TestNode::GetRawTemplate):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::V8TestObj::GetRawTemplate):
* bindings/scripts/test/V8/V8TestOverloadedConstructors.cpp:
(WebCore::V8TestOverloadedConstructors::GetRawTemplate):
* bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
(WebCore::V8TestSerializedScriptValueInterface::GetRawTemplate):
* bindings/v8/DOMWrapperMap.h:
(WebCore::DOMWrapperMap::clear):
* bindings/v8/DOMWrapperWorld.cpp:
(WebCore::isolatedWorldWeakCallback):
(WebCore::DOMWrapperWorld::makeContextWeak):
* bindings/v8/NPV8Object.cpp:
(WebCore::freeV8NPObject):
(WebCore::npCreateV8ScriptObject):
* bindings/v8/ScheduledAction.cpp:
(WebCore::ScheduledAction::ScheduledAction):
(WebCore::ScheduledAction::~ScheduledAction):
* bindings/v8/ScopedPersistent.h:
(WebCore::ScopedPersistent::ScopedPersistent):
(WebCore::ScopedPersistent::set):
(WebCore::ScopedPersistent::clear):
* bindings/v8/ScriptWrappable.h:
(WebCore::ScriptWrappable::setWrapper):
(WebCore::ScriptWrappable::disposeWrapper):
(WebCore::ScriptWrappable::weakCallback):
* bindings/v8/V8Binding.cpp:
(WebCore::createRawTemplate):
* bindings/v8/V8Binding.h:
(WebCore):
* bindings/v8/V8GCController.cpp:
(WebCore::gcTree):
(WebCore::V8GCController::gcPrologue):
(WebCore::V8GCController::minorGCPrologue):
* bindings/v8/V8GCController.h:
(V8GCController):
* bindings/v8/V8HiddenPropertyName.cpp:
(WebCore::V8HiddenPropertyName::createString):
* bindings/v8/V8LazyEventListener.cpp:
(WebCore::V8LazyEventListener::prepareListenerObject):
* bindings/v8/V8NPObject.cpp:
(WebCore::V8NPTemplateMap::dispose):
(WebCore::npObjectGetProperty):
(WebCore::createV8ObjectForNPObject):
* bindings/v8/V8PerContextData.cpp:
(WebCore::V8PerContextData::dispose):
(WebCore::V8PerContextData::createWrapperFromCacheSlowCase):
(WebCore::V8PerContextData::constructorForTypeSlowCase):
* bindings/v8/V8ValueCache.cpp:
(WebCore::makeExternalString):
* bindings/v8/WrapperTypeInfo.h:
(WebCore::WrapperConfiguration::configureWrapper):
* bindings/v8/custom/V8HTMLDocumentCustom.cpp:
(WebCore::V8HTMLDocument::wrapInShadowObject):
* bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
(WebCore::V8HTMLImageElementConstructor::GetTemplate):
* bindings/v8/custom/V8InjectedScriptManager.cpp:
(WebCore::WeakReferenceCallback):
(WebCore::createInjectedScriptHostV8Wrapper):
* bindings/v8/custom/V8LocationCustom.cpp:
(WebCore::V8Location::reloadAccessorGetter):
(WebCore::V8Location::replaceAccessorGetter):
(WebCore::V8Location::assignAccessorGetter):

Source/WebKit/chromium:

* tests/WebFrameTest.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142250 268f45cc-cd09-0410-ab3c-d52691b4dbfc

37 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestOverloadedConstructors.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/v8/DOMWrapperMap.h
Source/WebCore/bindings/v8/DOMWrapperWorld.cpp
Source/WebCore/bindings/v8/NPV8Object.cpp
Source/WebCore/bindings/v8/ScheduledAction.cpp
Source/WebCore/bindings/v8/ScopedPersistent.h
Source/WebCore/bindings/v8/ScriptWrappable.h
Source/WebCore/bindings/v8/V8Binding.cpp
Source/WebCore/bindings/v8/V8Binding.h
Source/WebCore/bindings/v8/V8GCController.cpp
Source/WebCore/bindings/v8/V8GCController.h
Source/WebCore/bindings/v8/V8HiddenPropertyName.cpp
Source/WebCore/bindings/v8/V8LazyEventListener.cpp
Source/WebCore/bindings/v8/V8NPObject.cpp
Source/WebCore/bindings/v8/V8PerContextData.cpp
Source/WebCore/bindings/v8/V8ValueCache.cpp
Source/WebCore/bindings/v8/WrapperTypeInfo.h
Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
Source/WebCore/bindings/v8/custom/V8InjectedScriptManager.cpp
Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/WebFrameTest.cpp

index ddcf6584e6e4a369aadc0420c9d9e0ed146b7eb2..98c726096be3afaa9d3841d1d71815152cdad66d 100644 (file)
@@ -1,3 +1,101 @@
+2013-02-08  Dan Carney  <dcarney@google.com>
+
+        [v8] isolate parameter added to all v8::peristent calls
+        https://bugs.webkit.org/show_bug.cgi?id=109268
+
+        Reviewed by Kentaro Hara.
+
+        No new tests. No change in functionality.
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (GenerateDomainSafeFunctionGetter):
+        (GenerateNamedConstructorCallback):
+        (GenerateImplementation):
+        * bindings/scripts/test/V8/V8Float64Array.cpp:
+        (WebCore::V8Float64Array::GetRawTemplate):
+        * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
+        (WebCore::TestActiveDOMObjectV8Internal::postMessageAttrGetter):
+        (WebCore::V8TestActiveDOMObject::GetRawTemplate):
+        * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
+        (WebCore::V8TestCustomNamedGetter::GetRawTemplate):
+        * bindings/scripts/test/V8/V8TestEventConstructor.cpp:
+        (WebCore::V8TestEventConstructor::GetRawTemplate):
+        * bindings/scripts/test/V8/V8TestEventTarget.cpp:
+        (WebCore::V8TestEventTarget::GetRawTemplate):
+        * bindings/scripts/test/V8/V8TestException.cpp:
+        (WebCore::V8TestException::GetRawTemplate):
+        * bindings/scripts/test/V8/V8TestInterface.cpp:
+        (WebCore::V8TestInterface::GetRawTemplate):
+        * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
+        (WebCore::V8TestMediaQueryListListener::GetRawTemplate):
+        * bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
+        (WebCore::V8TestNamedConstructorConstructor::GetTemplate):
+        (WebCore::V8TestNamedConstructor::GetRawTemplate):
+        * bindings/scripts/test/V8/V8TestNode.cpp:
+        (WebCore::V8TestNode::GetRawTemplate):
+        * bindings/scripts/test/V8/V8TestObj.cpp:
+        (WebCore::V8TestObj::GetRawTemplate):
+        * bindings/scripts/test/V8/V8TestOverloadedConstructors.cpp:
+        (WebCore::V8TestOverloadedConstructors::GetRawTemplate):
+        * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
+        (WebCore::V8TestSerializedScriptValueInterface::GetRawTemplate):
+        * bindings/v8/DOMWrapperMap.h:
+        (WebCore::DOMWrapperMap::clear):
+        * bindings/v8/DOMWrapperWorld.cpp:
+        (WebCore::isolatedWorldWeakCallback):
+        (WebCore::DOMWrapperWorld::makeContextWeak):
+        * bindings/v8/NPV8Object.cpp:
+        (WebCore::freeV8NPObject):
+        (WebCore::npCreateV8ScriptObject):
+        * bindings/v8/ScheduledAction.cpp:
+        (WebCore::ScheduledAction::ScheduledAction):
+        (WebCore::ScheduledAction::~ScheduledAction):
+        * bindings/v8/ScopedPersistent.h:
+        (WebCore::ScopedPersistent::ScopedPersistent):
+        (WebCore::ScopedPersistent::set):
+        (WebCore::ScopedPersistent::clear):
+        * bindings/v8/ScriptWrappable.h:
+        (WebCore::ScriptWrappable::setWrapper):
+        (WebCore::ScriptWrappable::disposeWrapper):
+        (WebCore::ScriptWrappable::weakCallback):
+        * bindings/v8/V8Binding.cpp:
+        (WebCore::createRawTemplate):
+        * bindings/v8/V8Binding.h:
+        (WebCore):
+        * bindings/v8/V8GCController.cpp:
+        (WebCore::gcTree):
+        (WebCore::V8GCController::gcPrologue):
+        (WebCore::V8GCController::minorGCPrologue):
+        * bindings/v8/V8GCController.h:
+        (V8GCController):
+        * bindings/v8/V8HiddenPropertyName.cpp:
+        (WebCore::V8HiddenPropertyName::createString):
+        * bindings/v8/V8LazyEventListener.cpp:
+        (WebCore::V8LazyEventListener::prepareListenerObject):
+        * bindings/v8/V8NPObject.cpp:
+        (WebCore::V8NPTemplateMap::dispose):
+        (WebCore::npObjectGetProperty):
+        (WebCore::createV8ObjectForNPObject):
+        * bindings/v8/V8PerContextData.cpp:
+        (WebCore::V8PerContextData::dispose):
+        (WebCore::V8PerContextData::createWrapperFromCacheSlowCase):
+        (WebCore::V8PerContextData::constructorForTypeSlowCase):
+        * bindings/v8/V8ValueCache.cpp:
+        (WebCore::makeExternalString):
+        * bindings/v8/WrapperTypeInfo.h:
+        (WebCore::WrapperConfiguration::configureWrapper):
+        * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+        (WebCore::V8HTMLDocument::wrapInShadowObject):
+        * bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
+        (WebCore::V8HTMLImageElementConstructor::GetTemplate):
+        * bindings/v8/custom/V8InjectedScriptManager.cpp:
+        (WebCore::WeakReferenceCallback):
+        (WebCore::createInjectedScriptHostV8Wrapper):
+        * bindings/v8/custom/V8LocationCustom.cpp:
+        (WebCore::V8Location::reloadAccessorGetter):
+        (WebCore::V8Location::replaceAccessorGetter):
+        (WebCore::V8Location::assignAccessorGetter):
+
 2013-02-08  Kent Tamura  <tkent@chromium.org>
 
         Adjust usage of ENABLE flags to enable whole content
index 90698feae392e23078765b2c39c6eca41eb8b0ce..86f8eabff1af1a1a4c6f5686bc28f5e7a6f52746 100644 (file)
@@ -798,7 +798,7 @@ sub GenerateDomainSafeFunctionGetter
     push(@implContentDecls, <<END);
 static v8::Handle<v8::Value> ${funcName}AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
-    static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New($newTemplateString);
+    static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(info.GetIsolate(), $newTemplateString);
     v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(${v8InterfaceName}::GetTemplate(info.GetIsolate()));
     if (holder.IsEmpty()) {
         // can only reach here by 'object.__proto__.func', and it should passed
@@ -807,7 +807,7 @@ static v8::Handle<v8::Value> ${funcName}AttrGetter(v8::Local<v8::String> name, c
     }
     ${interfaceName}* imp = ${v8InterfaceName}::toNative(holder);
     if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) {
-        static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New($newTemplateString);
+        static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(info.GetIsolate(), $newTemplateString);
         return sharedTemplate->GetFunction();
     }
 
@@ -2207,7 +2207,7 @@ v8::Persistent<v8::FunctionTemplate> ${v8InterfaceName}Constructor::GetTemplate(
     result->SetClassName(v8::String::NewSymbol("${interfaceName}"));
     result->Inherit(${v8InterfaceName}::GetTemplate(isolate));
 
-    cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(result);
+    cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, result);
     return cachedTemplate;
 }
 
@@ -3104,7 +3104,7 @@ v8::Persistent<v8::FunctionTemplate> ${v8InterfaceName}::GetRawTemplate(v8::Isol
         return result->value;
 
     v8::HandleScope handleScope;
-    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate);
     data->rawTemplateMap().add(&info, templ);
     return templ;
 }
@@ -3222,7 +3222,7 @@ v8::Persistent<v8::ObjectTemplate> V8DOMWindow::GetShadowObjectTemplate(v8::Isol
 {
     static v8::Persistent<v8::ObjectTemplate> V8DOMWindowShadowObjectCache;
     if (V8DOMWindowShadowObjectCache.IsEmpty()) {
-        V8DOMWindowShadowObjectCache = v8::Persistent<v8::ObjectTemplate>::New(v8::ObjectTemplate::New());
+        V8DOMWindowShadowObjectCache = v8::Persistent<v8::ObjectTemplate>::New(isolate, v8::ObjectTemplate::New());
         ConfigureShadowObjectTemplate(V8DOMWindowShadowObjectCache, isolate);
     }
     return V8DOMWindowShadowObjectCache;
index fae83978c878a8dcf6f37ddcdc0c1b4911055fe2..7b237a00c99b21e6b7e51252f90d08898dac509a 100644 (file)
@@ -140,7 +140,7 @@ v8::Persistent<v8::FunctionTemplate> V8Float64Array::GetRawTemplate(v8::Isolate*
         return result->value;
 
     v8::HandleScope handleScope;
-    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate);
     data->rawTemplateMap().add(&info, templ);
     return templ;
 }
index 1c9fe98b5d14d3331a1f9e5355dcf3b6edf7fa2c..e0024b9eeff85f57b47f4e5c7459b4721646b299 100644 (file)
@@ -92,7 +92,7 @@ static v8::Handle<v8::Value> postMessageCallback(const v8::Arguments& args)
 
 static v8::Handle<v8::Value> postMessageAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
-    static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::postMessageCallback, v8Undefined(), v8::Signature::New(V8TestActiveDOMObject::GetRawTemplate(info.GetIsolate()))));
+    static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(info.GetIsolate(), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::postMessageCallback, v8Undefined(), v8::Signature::New(V8TestActiveDOMObject::GetRawTemplate(info.GetIsolate()))));
     v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestActiveDOMObject::GetTemplate(info.GetIsolate()));
     if (holder.IsEmpty()) {
         // can only reach here by 'object.__proto__.func', and it should passed
@@ -101,7 +101,7 @@ static v8::Handle<v8::Value> postMessageAttrGetter(v8::Local<v8::String> name, c
     }
     TestActiveDOMObject* imp = V8TestActiveDOMObject::toNative(holder);
     if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) {
-        static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::postMessageCallback, v8Undefined(), v8::Signature::New(V8TestActiveDOMObject::GetRawTemplate(info.GetIsolate()))));
+        static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(info.GetIsolate(), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::postMessageCallback, v8Undefined(), v8::Signature::New(V8TestActiveDOMObject::GetRawTemplate(info.GetIsolate()))));
         return sharedTemplate->GetFunction();
     }
 
@@ -168,7 +168,7 @@ v8::Persistent<v8::FunctionTemplate> V8TestActiveDOMObject::GetRawTemplate(v8::I
         return result->value;
 
     v8::HandleScope handleScope;
-    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate);
     data->rawTemplateMap().add(&info, templ);
     return templ;
 }
index 730cc291cc7aae1b5dc265f8fc3f00556a379e45..138c3783dcb48b7753eb4e4da7c131ab41c0c644 100644 (file)
@@ -106,7 +106,7 @@ v8::Persistent<v8::FunctionTemplate> V8TestCustomNamedGetter::GetRawTemplate(v8:
         return result->value;
 
     v8::HandleScope handleScope;
-    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate);
     data->rawTemplateMap().add(&info, templ);
     return templ;
 }
index a8aacf78af4650940ef5dee50a2faadfb8d5b0b0..37c0c5c9952b6145f5270fc1f35d9dafc2d35639 100644 (file)
@@ -138,7 +138,7 @@ v8::Persistent<v8::FunctionTemplate> V8TestEventConstructor::GetRawTemplate(v8::
         return result->value;
 
     v8::HandleScope handleScope;
-    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate);
     data->rawTemplateMap().add(&info, templ);
     return templ;
 }
index 0a37eadbe2dc66684872b76fb349bf54bf5102a5..a9642159d21be26628fe658d6f0ce944ac881a7d 100644 (file)
@@ -167,7 +167,7 @@ v8::Persistent<v8::FunctionTemplate> V8TestEventTarget::GetRawTemplate(v8::Isola
         return result->value;
 
     v8::HandleScope handleScope;
-    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate);
     data->rawTemplateMap().add(&info, templ);
     return templ;
 }
index 6b08657bd9e9119d1175a6d513d5453970f25d0d..11bfab0b2046b943f5823eca65b2dd47511722ad 100644 (file)
@@ -97,7 +97,7 @@ v8::Persistent<v8::FunctionTemplate> V8TestException::GetRawTemplate(v8::Isolate
         return result->value;
 
     v8::HandleScope handleScope;
-    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate);
     data->rawTemplateMap().add(&info, templ);
     return templ;
 }
index a5eba391a8089adf6c825b7ffaec7732d058441f..aae333ad82d2389706768d12999ba5ef87dac6af 100644 (file)
@@ -321,7 +321,7 @@ v8::Persistent<v8::FunctionTemplate> V8TestInterface::GetRawTemplate(v8::Isolate
         return result->value;
 
     v8::HandleScope handleScope;
-    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate);
     data->rawTemplateMap().add(&info, templ);
     return templ;
 }
index 9c4e8a5cd6a8fa46d31f6c96a30f39f7713a17fc..ebf936b4aaf529daec1aa358dce0d12611e5f858 100644 (file)
@@ -106,7 +106,7 @@ v8::Persistent<v8::FunctionTemplate> V8TestMediaQueryListListener::GetRawTemplat
         return result->value;
 
     v8::HandleScope handleScope;
-    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate);
     data->rawTemplateMap().add(&info, templ);
     return templ;
 }
index f9214291fc92c5da8e60400c1828aa2b235db939..d2627f9f2a18fdb13364ea3f6d2422b609face4b 100644 (file)
@@ -112,7 +112,7 @@ v8::Persistent<v8::FunctionTemplate> V8TestNamedConstructorConstructor::GetTempl
     result->SetClassName(v8::String::NewSymbol("TestNamedConstructor"));
     result->Inherit(V8TestNamedConstructor::GetTemplate(isolate));
 
-    cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(result);
+    cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, result);
     return cachedTemplate;
 }
 
@@ -140,7 +140,7 @@ v8::Persistent<v8::FunctionTemplate> V8TestNamedConstructor::GetRawTemplate(v8::
         return result->value;
 
     v8::HandleScope handleScope;
-    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate);
     data->rawTemplateMap().add(&info, templ);
     return templ;
 }
index 0c9f1ee07cd4032dc9f7572c08b727a4ac862cb3..cb56b7c14ecb23569c0e7bdd14cee577bb4af44b 100644 (file)
@@ -104,7 +104,7 @@ v8::Persistent<v8::FunctionTemplate> V8TestNode::GetRawTemplate(v8::Isolate* iso
         return result->value;
 
     v8::HandleScope handleScope;
-    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate);
     data->rawTemplateMap().add(&info, templ);
     return templ;
 }
index 53dbb59c69c0fcf4eca41b834eafce7b4887d79f..adc7098b2ca42c10f2b64281c28ba44e481fd4bb 100644 (file)
@@ -2218,7 +2218,7 @@ v8::Persistent<v8::FunctionTemplate> V8TestObj::GetRawTemplate(v8::Isolate* isol
         return result->value;
 
     v8::HandleScope handleScope;
-    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate);
     data->rawTemplateMap().add(&info, templ);
     return templ;
 }
index d587402425796096afa8d59b759be3cdc2e0f9d0..88653d914b778d50028d533b3f5576ac7f18e8eb 100644 (file)
@@ -161,7 +161,7 @@ v8::Persistent<v8::FunctionTemplate> V8TestOverloadedConstructors::GetRawTemplat
         return result->value;
 
     v8::HandleScope handleScope;
-    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate);
     data->rawTemplateMap().add(&info, templ);
     return templ;
 }
index c27b55d9d92c699948072e10a5faf0f795da9129..38691f3b29ffdc1bfabeacf3010f932da28136be 100644 (file)
@@ -278,7 +278,7 @@ v8::Persistent<v8::FunctionTemplate> V8TestSerializedScriptValueInterface::GetRa
         return result->value;
 
     v8::HandleScope handleScope;
-    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate();
+    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(isolate);
     data->rawTemplateMap().add(&info, templ);
     return templ;
 }
index af0f8967276de3dbd0d42c141be9100d018c2fb7..f98cd36e5cfaf5b5b1a67aa30d95cd50cd5cf512 100644 (file)
@@ -70,7 +70,7 @@ public:
         for (typename MapType::iterator it = m_map.begin(); it != m_map.end(); ++it) {
             v8::Persistent<v8::Object> wrapper = it->value;
             toWrapperTypeInfo(wrapper)->derefObject(it->key);
-            wrapper.Dispose();
+            wrapper.Dispose(m_isolate);
             wrapper.Clear();
         }
         m_map.clear();
index 3ae71d4d90a8d84e11aea3aa76d549ce80fdda12..6c74413c8fed1d524e51b3a1cf2de1712a3e4a6f 100644 (file)
@@ -75,7 +75,7 @@ void DOMWrapperWorld::assertContextHasCorrectPrototype(v8::Handle<v8::Context> c
 
 static void isolatedWorldWeakCallback(v8::Isolate* isolate, v8::Persistent<v8::Value> object, void* parameter)
 {
-    object.Dispose();
+    object.Dispose(isolate);
     object.Clear();
     static_cast<DOMWrapperWorld*>(parameter)->deref();
 }
@@ -84,7 +84,8 @@ void DOMWrapperWorld::makeContextWeak(v8::Handle<v8::Context> context)
 {
     ASSERT(isIsolatedWorld());
     ASSERT(isolated(context) == this);
-    v8::Persistent<v8::Context>::New(context).MakeWeak(context->GetIsolate(), this, isolatedWorldWeakCallback);
+    v8::Isolate* isolate = context->GetIsolate();
+    v8::Persistent<v8::Context>::New(isolate, context).MakeWeak(isolate, this, isolatedWorldWeakCallback);
     // Matching deref is in weak callback.
     this->ref();
 }
index eb811444a8134aae523f955650f645a5793cca34..5a86f64b17ccd366bf7afcd70824e71cbe5adafb 100644 (file)
@@ -92,7 +92,7 @@ static void freeV8NPObject(NPObject* npObject)
                 v8NPObjectMap->remove(v8ObjectHash);
         }
     }
-    v8NpObject->v8Object.Dispose();
+    v8NpObject->v8Object.Dispose(v8::Isolate::GetCurrent());
     v8NpObject->v8Object.Clear();
     free(v8NpObject);
 }
@@ -166,7 +166,7 @@ NPObject* npCreateV8ScriptObject(NPP npp, v8::Handle<v8::Object> object, DOMWind
         objectVector = &iter->value;
     }
     V8NPObject* v8npObject = reinterpret_cast<V8NPObject*>(_NPN_CreateObject(npp, &V8NPObjectClass));
-    v8npObject->v8Object = v8::Persistent<v8::Object>::New(object);
+    v8npObject->v8Object = v8::Persistent<v8::Object>::New(v8::Isolate::GetCurrent(), object);
     v8npObject->rootObject = root;
 
     if (objectVector)
index 4271f9ee65b6604e629e47278ae590923a7c0688..381e146227662e79eb7f6735c15cacb616ec4571 100644 (file)
@@ -54,15 +54,16 @@ ScheduledAction::ScheduledAction(v8::Handle<v8::Context> context, v8::Handle<v8:
     , m_function(function)
     , m_code(String(), KURL(), TextPosition::belowRangePosition())
 {
+    v8::Isolate* isolate = m_context->GetIsolate();
     m_args.reserveCapacity(argc);
     for (int i = 0; i < argc; ++i)
-        m_args.append(v8::Persistent<v8::Value>::New(argv[i]));
+        m_args.append(v8::Persistent<v8::Value>::New(isolate, argv[i]));
 }
 
 ScheduledAction::~ScheduledAction()
 {
     for (size_t i = 0; i < m_args.size(); ++i) {
-        m_args[i].Dispose();
+        m_args[i].Dispose(m_context->GetIsolate());
         m_args[i].Clear();
     }
 }
index fccf4aa59b889c9e21666918be64ff66de05e141..1761036a233afb7b36a0cdcbc39c98e3c6479245 100644 (file)
@@ -43,7 +43,7 @@ public:
     ScopedPersistent() { }
 
     explicit ScopedPersistent(v8::Handle<T> handle)
-        : m_handle(v8::Persistent<T>::New(handle))
+        : m_handle(v8::Persistent<T>::New(v8::Isolate::GetCurrent(), handle))
     {
     }
 
@@ -60,7 +60,7 @@ public:
     void set(v8::Handle<T> handle)
     {
         clear();
-        m_handle = v8::Persistent<T>::New(handle);
+        m_handle = v8::Persistent<T>::New(v8::Isolate::GetCurrent(), handle);
     }
 
     void adopt(v8::Persistent<T> handle)
@@ -74,7 +74,7 @@ public:
     {
         if (m_handle.IsEmpty())
             return;
-        m_handle.Dispose();
+        m_handle.Dispose(v8::Isolate::GetCurrent());
         m_handle.Clear();
     }
 
index 16bc78a944c7122805953c08c0ecb96b0d0eef24..c38b8c26c98e29c62fc972368e50261cf21f8362 100644 (file)
@@ -49,7 +49,7 @@ public:
     void setWrapper(v8::Handle<v8::Object> wrapper, v8::Isolate* isolate, const WrapperConfiguration& configuration)
     {
         ASSERT(m_maskedWrapper.IsEmpty());
-        v8::Persistent<v8::Object> persistent = v8::Persistent<v8::Object>::New(wrapper);
+        v8::Persistent<v8::Object> persistent = v8::Persistent<v8::Object>::New(isolate, wrapper);
         configuration.configureWrapper(persistent, isolate);
         persistent.MakeWeak(isolate, this, weakCallback);
         m_maskedWrapper = maskOrUnmaskPointer(*persistent);
@@ -62,11 +62,11 @@ public:
     }
 
 private:
-    inline void disposeWrapper(v8::Persistent<v8::Value> value)
+    inline void disposeWrapper(v8::Persistent<v8::Value> value, v8::Isolate* isolate)
     {
         ASSERT(!m_maskedWrapper.IsEmpty());
         ASSERT(*value == maskOrUnmaskPointer(*m_maskedWrapper));
-        value.Dispose();
+        value.Dispose(isolate);
         m_maskedWrapper.Clear();
     }
 
@@ -85,7 +85,7 @@ private:
         ASSERT(value->IsObject());
         v8::Persistent<v8::Object> wrapper = v8::Persistent<v8::Object>::Cast(value);
         ASSERT(key->wrapper() == wrapper);
-        key->disposeWrapper(value);
+        key->disposeWrapper(value, isolate);
 
         // Note: |object| might not be equal to |key|, e.g., if ScriptWrappable isn't a left-most base class.
         void* object = toNative(wrapper);
index 11e32b42da7859cdd3422a221545770f971a27d4..de7c182573bd12a5d7f98699625f6c1c8d6eb7c5 100644 (file)
@@ -174,11 +174,11 @@ uint32_t toUInt32(v8::Handle<v8::Value> value, bool& ok)
     return uintValue->Value();
 }
 
-v8::Persistent<v8::FunctionTemplate> createRawTemplate()
+v8::Persistent<v8::FunctionTemplate> createRawTemplate(v8::Isolate* isolate)
 {
     v8::HandleScope scope;
     v8::Local<v8::FunctionTemplate> result = v8::FunctionTemplate::New(V8ObjectConstructor::isValidConstructorMode);
-    return v8::Persistent<v8::FunctionTemplate>::New(result);
+    return v8::Persistent<v8::FunctionTemplate>::New(isolate, result);
 }        
 
 PassRefPtr<DOMStringList> toDOMStringList(v8::Handle<v8::Value> value, v8::Isolate* isolate)
index 17efaa25548017a6bfca286c6b37fd141fcc2c8a..32f7c21a40ba36e2c3ef611b062c0f65ae588a6b 100644 (file)
@@ -421,7 +421,7 @@ namespace WebCore {
         return isfinite(value) ? v8::Date::New(value) : v8NullWithCheck(isolate);
     }
 
-    v8::Persistent<v8::FunctionTemplate> createRawTemplate();
+    v8::Persistent<v8::FunctionTemplate> createRawTemplate(v8::Isolate*);
 
     PassRefPtr<DOMStringList> toDOMStringList(v8::Handle<v8::Value>, v8::Isolate*);
     PassRefPtr<XPathNSResolver> toXPathNSResolver(v8::Handle<v8::Value>, v8::Isolate*);
index 282c4107b5b33990b7dd1ee191c82afdacadf15e..51cb4e8af3433b76c450ce7f37c550886c5e903e 100644 (file)
@@ -195,7 +195,7 @@ public:
 
         ASSERT(V8DOMWrapper::maybeDOMWrapper(value));
 
-        if (value.IsIndependent())
+        if (value.IsIndependent(m_isolate))
             return;
 
         WrapperTypeInfo* type = toWrapperTypeInfo(wrapper);
@@ -223,7 +223,7 @@ public:
         if (classId == v8DOMNodeClassId) {
             UNUSED_PARAM(m_isolate);
             ASSERT(V8Node::HasInstance(wrapper, m_isolate));
-            ASSERT(!wrapper.IsIndependent());
+            ASSERT(!wrapper.IsIndependent(m_isolate));
 
             Node* node = static_cast<Node*>(object);
 
@@ -254,7 +254,7 @@ private:
 // m_edenNodes stores nodes that have wrappers that have been created since the last minor/major GC.
 Vector<Node*>* V8GCController::m_edenNodes = 0;
 
-static void gcTree(Node* startNode)
+static void gcTree(v8::Isolate* isolate, Node* startNode)
 {
     Vector<v8::Persistent<v8::Value>, initialNodeVectorSize> newSpaceWrappers;
 
@@ -299,7 +299,7 @@ static void gcTree(Node* startNode)
     // stored in newSpaceWrappers and are expected to exist in the new space of V8.
     // We report those wrappers to V8 as an object group.
     for (size_t i = 0; i < newSpaceWrappers.size(); i++)
-        newSpaceWrappers[i].MarkPartiallyDependent();
+        newSpaceWrappers[i].MarkPartiallyDependent(isolate);
     if (newSpaceWrappers.size() > 0)
         v8::V8::AddObjectGroup(&newSpaceWrappers[0], newSpaceWrappers.size());
 }
@@ -326,8 +326,10 @@ void V8GCController::didCreateWrapperForNode(Node* node)
 
 void V8GCController::gcPrologue(v8::GCType type, v8::GCCallbackFlags flags)
 {
+    // It would be nice if the GC callbacks passed the Isolate directly....
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
     if (type == v8::kGCTypeScavenge)
-        minorGCPrologue();
+        minorGCPrologue(isolate);
     else if (type == v8::kGCTypeMarkSweepCompact)
         majorGCPrologue();
 
@@ -337,7 +339,7 @@ void V8GCController::gcPrologue(v8::GCType type, v8::GCCallbackFlags flags)
     }
 }
 
-void V8GCController::minorGCPrologue()
+void V8GCController::minorGCPrologue(v8::Isolate* isolate)
 {
     TRACE_EVENT_BEGIN0("v8", "GC");
 
@@ -345,7 +347,7 @@ void V8GCController::minorGCPrologue()
         for (size_t i = 0; i < m_edenNodes->size(); i++) {
             ASSERT(!m_edenNodes->at(i)->wrapper().IsEmpty());
             if (m_edenNodes->at(i)->isV8CollectableDuringMinorGC()) // This branch is just for performance.
-                gcTree(m_edenNodes->at(i));
+                gcTree(isolate, m_edenNodes->at(i));
         }
     }
 }
index 32d1a08c30150968d05396ac74fd04503d19cdde..1091471a72a4abb739a028dbaf4e24b8a324b418 100644 (file)
@@ -42,7 +42,7 @@ class V8GCController {
 public:
     static void gcPrologue(v8::GCType, v8::GCCallbackFlags);
     static void gcEpilogue(v8::GCType, v8::GCCallbackFlags);
-    static void minorGCPrologue();
+    static void minorGCPrologue(v8::Isolate*);
     static void minorGCEpilogue();
     static void majorGCPrologue();
     static void majorGCEpilogue();
index 74c44b3aa753d369f1b76db7b11cf75a5448f28c..5eb112c86303d13f8bdc0d417f638329ad7bdd6b 100644 (file)
@@ -73,7 +73,7 @@ void V8HiddenPropertyName::setNamedHiddenReference(v8::Handle<v8::Object> parent
 v8::Persistent<v8::String> V8HiddenPropertyName::createString(const char* key)
 {
     v8::HandleScope scope;
-    return v8::Persistent<v8::String>::New(v8::String::NewSymbol(key));
+    return v8::Persistent<v8::String>::New(v8::Isolate::GetCurrent(), v8::String::NewSymbol(key));
 }
 
 }  // namespace WebCore
index 787f49d419932fe91b1397be2045368a982b9425..7748227ae7435b809a627e25745f9c6e0bf1cec3 100644 (file)
@@ -215,7 +215,7 @@ void V8LazyEventListener::prepareListenerObject(ScriptExecutionContext* context)
     v8::Persistent<v8::FunctionTemplate>& toStringTemplate =
         V8PerIsolateData::current()->lazyEventListenerToStringTemplate();
     if (toStringTemplate.IsEmpty())
-        toStringTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8LazyEventListenerToString));
+        toStringTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8LazyEventListenerToString));
     v8::Local<v8::Function> toStringFunction;
     if (!toStringTemplate.IsEmpty())
         toStringFunction = toStringTemplate->GetFunction();
index 4c9db8508cd0a66d6bdf470dcb631d694e4f48ba..2bfbbd81eda4ff959cac654b0de86cd45e3126d6 100644 (file)
@@ -200,7 +200,7 @@ private:
     {
         MapType::iterator it = m_map.find(key);
         ASSERT(it != m_map.end());
-        it->value.Dispose();
+        it->value.Dispose(m_isolate);
         it->value.Clear();
         m_map.remove(it);
     }
@@ -250,7 +250,7 @@ static v8::Handle<v8::Value> npObjectGetProperty(v8::Local<v8::Object> self, NPI
             // Create a new template.
             v8::Local<v8::FunctionTemplate> temp = v8::FunctionTemplate::New();
             temp->SetCallHandler(npObjectMethodHandler, key);
-            functionTemplate = v8::Persistent<v8::FunctionTemplate>::New(temp);
+            functionTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, temp);
             V8NPTemplateMap::sharedInstance(isolate).set(id, functionTemplate);
         }
 
@@ -428,8 +428,9 @@ v8::Local<v8::Object> createV8ObjectForNPObject(NPObject* object, NPObject* root
     // FIXME: we should create a Wrapper type as a subclass of JSObject. It has two internal fields, field 0 is the wrapped
     // pointer, and field 1 is the type. There should be an api function that returns unused type id. The same Wrapper type
     // can be used by DOM bindings.
+    v8::Isolate* isolate = v8::Isolate::GetCurrent();
     if (npObjectDesc.IsEmpty()) {
-        npObjectDesc = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New());
+        npObjectDesc = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New());
         npObjectDesc->InstanceTemplate()->SetInternalFieldCount(npObjectInternalFieldCount);
         npObjectDesc->InstanceTemplate()->SetNamedPropertyHandler(npObjectNamedPropertyGetter, npObjectNamedPropertySetter, npObjectQueryProperty, 0, npObjectNamedPropertyEnumerator);
         npObjectDesc->InstanceTemplate()->SetIndexedPropertyHandler(npObjectIndexedPropertyGetter, npObjectIndexedPropertySetter, 0, 0, npObjectIndexedPropertyEnumerator);
index 0591090d24abc3e61f732d8b3b71b1a143308ec8..b392323a8fde7ec74a33f02aa95c6162ea865647 100644 (file)
@@ -39,13 +39,14 @@ namespace WebCore {
 void V8PerContextData::dispose()
 {
     v8::HandleScope handleScope;
+    v8::Isolate* isolate = m_context->GetIsolate();
     m_context->SetAlignedPointerInEmbedderData(v8ContextPerContextDataIndex, 0);
 
     {
         WrapperBoilerplateMap::iterator it = m_wrapperBoilerplates.begin();
         for (; it != m_wrapperBoilerplates.end(); ++it) {
             v8::Persistent<v8::Object> wrapper = it->value;
-            wrapper.Dispose();
+            wrapper.Dispose(isolate);
             wrapper.Clear();
         }
         m_wrapperBoilerplates.clear();
@@ -55,7 +56,7 @@ void V8PerContextData::dispose()
         ConstructorMap::iterator it = m_constructorMap.begin();
         for (; it != m_constructorMap.end(); ++it) {
             v8::Persistent<v8::Function> wrapper = it->value;
-            wrapper.Dispose();
+            wrapper.Dispose(isolate);
             wrapper.Clear();
         }
         m_constructorMap.clear();
@@ -102,7 +103,7 @@ v8::Local<v8::Object> V8PerContextData::createWrapperFromCacheSlowCase(WrapperTy
     v8::Local<v8::Function> function = constructorForType(type);
     v8::Local<v8::Object> instance = V8ObjectConstructor::newInstance(function);
     if (!instance.IsEmpty()) {
-        m_wrapperBoilerplates.set(type, v8::Persistent<v8::Object>::New(instance));
+        m_wrapperBoilerplates.set(type, v8::Persistent<v8::Object>::New(m_context->GetIsolate(), instance));
         return instance->Clone();
     }
     return v8::Local<v8::Object>();
@@ -130,7 +131,7 @@ v8::Local<v8::Function> V8PerContextData::constructorForTypeSlowCase(WrapperType
             prototypeObject->SetPrototype(m_errorPrototype.get());
     }
 
-    m_constructorMap.set(type, v8::Persistent<v8::Function>::New(function));
+    m_constructorMap.set(type, v8::Persistent<v8::Function>::New(m_context->GetIsolate(), function));
 
     return function;
 }
index ad966faa3cd7da7af77a53bafc25eca406b05df5..5c891ab47565d49b68787d9a274eb08a09d4ddc3 100644 (file)
@@ -66,7 +66,7 @@ static void cachedStringCallback(v8::Isolate* isolate, v8::Persistent<v8::Value>
 {
     StringImpl* stringImpl = static_cast<StringImpl*>(parameter);
     V8PerIsolateData::current()->stringCache()->remove(stringImpl);
-    wrapper.Dispose();
+    wrapper.Dispose(isolate);
     wrapper.Clear();
     stringImpl->deref();
 }
@@ -86,7 +86,7 @@ v8::Handle<v8::String> StringCache::v8ExternalStringSlow(StringImpl* stringImpl,
         return v8::String::Empty(isolate);
 
     v8::Persistent<v8::String> cachedV8String = m_stringCache.get(stringImpl);
-    if (cachedV8String.IsWeak()) {
+    if (cachedV8String.IsWeak(isolate)) {
         m_lastStringImpl = stringImpl;
         m_lastV8String = cachedV8String;
         if (handleType == ReturnUnsafeHandle)
@@ -98,12 +98,12 @@ v8::Handle<v8::String> StringCache::v8ExternalStringSlow(StringImpl* stringImpl,
     if (newString.IsEmpty())
         return newString;
 
-    v8::Persistent<v8::String> wrapper = v8::Persistent<v8::String>::New(newString);
+    v8::Persistent<v8::String> wrapper = v8::Persistent<v8::String>::New(isolate, newString);
     if (wrapper.IsEmpty())
         return newString;
 
     stringImpl->ref();
-    wrapper.MarkIndependent();
+    wrapper.MarkIndependent(isolate);
     wrapper.MakeWeak(isolate, stringImpl, cachedStringCallback);
     m_stringCache.set(stringImpl, wrapper);
 
index 1934eb1015c054e1d55fac522af3e6132216d7cc..b310af9a7d2f80120448786a890f3bfa86266526 100644 (file)
@@ -150,7 +150,7 @@ namespace WebCore {
 
         void configureWrapper(v8::Persistent<v8::Object> wrapper, v8::Isolate* isolate) const
         {
-            wrapper.SetWrapperClassId(classId);
+            wrapper.SetWrapperClassId(isolate, classId);
             if (lifetime == Independent)
                 wrapper.MarkIndependent(isolate);
         }
index 7514cb62278312cba0e3d80b7ca3f742252eb345..fd09acf01af2197d84b695ea1c5d2a7eae10fe03 100644 (file)
@@ -56,7 +56,7 @@ v8::Local<v8::Object> V8HTMLDocument::wrapInShadowObject(v8::Local<v8::Object> w
 {
     DEFINE_STATIC_LOCAL(v8::Persistent<v8::FunctionTemplate>, shadowTemplate, ());
     if (shadowTemplate.IsEmpty()) {
-        shadowTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New());
+        shadowTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New());
         if (shadowTemplate.IsEmpty())
             return v8::Local<v8::Object>();
         shadowTemplate->SetClassName(v8::String::NewSymbol("HTMLDocument"));
index 5026adf2aa9c2813fff878851007e8fe787387f2..f5e4814d7cdce27c35a3b873922f05915e4510c2 100644 (file)
@@ -95,7 +95,7 @@ v8::Persistent<v8::FunctionTemplate> V8HTMLImageElementConstructor::GetTemplate(
     result->SetClassName(v8::String::NewSymbol("HTMLImageElement"));
     result->Inherit(V8HTMLImageElement::GetTemplate(isolate));
 
-    cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(result);
+    cachedTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, result);
     return cachedTemplate;
 }
 
index 1c1891852923ed736c8c5271ab39160d77cb037a..b2961e30040dac68b214cba5a48b630dd439fb50 100644 (file)
@@ -49,7 +49,7 @@ static void WeakReferenceCallback(v8::Isolate* isolate, v8::Persistent<v8::Value
 {
     InjectedScriptHost* nativeObject = static_cast<InjectedScriptHost*>(parameter);
     nativeObject->deref();
-    object.Dispose();
+    object.Dispose(isolate);
     object.Clear();
 }
 
@@ -69,7 +69,7 @@ static v8::Local<v8::Object> createInjectedScriptHostV8Wrapper(InjectedScriptHos
     // Create a weak reference to the v8 wrapper of InspectorBackend to deref
     // InspectorBackend when the wrapper is garbage collected.
     host->ref();
-    v8::Persistent<v8::Object> weakHandle = v8::Persistent<v8::Object>::New(instance);
+    v8::Persistent<v8::Object> weakHandle = v8::Persistent<v8::Object>::New(isolate, instance);
     weakHandle.MakeWeak(isolate, host, &WeakReferenceCallback);
     return instance;
 }
index 66f07d34d233e70245bc4acde2910e92fcd96281..2a12aee37cada2c27f53425e1c90fb9fc229eb9e 100644 (file)
@@ -138,8 +138,9 @@ void V8Location::searchAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::
 
 v8::Handle<v8::Value> V8Location::reloadAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
-    static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8Location::reloadCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(info.GetIsolate()))));
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(info.GetIsolate()));
+    v8::Isolate* isolate = info.GetIsolate();
+    static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::reloadCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate))));
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(isolate));
     if (holder.IsEmpty()) {
         // can only reach here by 'object.__proto__.func', and it should passed
         // domain security check already
@@ -147,7 +148,7 @@ v8::Handle<v8::Value> V8Location::reloadAccessorGetter(v8::Local<v8::String> nam
     }
     Location* imp = V8Location::toNative(holder);
     if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) {
-        static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8Location::reloadCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(info.GetIsolate()))));
+        static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::reloadCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate))));
         return sharedTemplate->GetFunction();
     }
     return privateTemplate->GetFunction();
@@ -155,8 +156,9 @@ v8::Handle<v8::Value> V8Location::reloadAccessorGetter(v8::Local<v8::String> nam
 
 v8::Handle<v8::Value> V8Location::replaceAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
-    static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8Location::replaceCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(info.GetIsolate()))));
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(info.GetIsolate()));
+    v8::Isolate* isolate = info.GetIsolate();
+    static v8::Persistent<v8::FunctionTemplate> privateTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::replaceCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate))));
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(isolate));
     if (holder.IsEmpty()) {
         // can only reach here by 'object.__proto__.func', and it should passed
         // domain security check already
@@ -164,7 +166,7 @@ v8::Handle<v8::Value> V8Location::replaceAccessorGetter(v8::Local<v8::String> na
     }
     Location* imp = V8Location::toNative(holder);
     if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) {
-        static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8Location::replaceCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(info.GetIsolate()))));
+        static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::replaceCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate))));
         return sharedTemplate->GetFunction();
     }
     return privateTemplate->GetFunction();
@@ -172,9 +174,10 @@ v8::Handle<v8::Value> V8Location::replaceAccessorGetter(v8::Local<v8::String> na
 
 v8::Handle<v8::Value> V8Location::assignAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
 {
+    v8::Isolate* isolate = info.GetIsolate();
     static v8::Persistent<v8::FunctionTemplate> privateTemplate =
-        v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8Location::assignCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(info.GetIsolate()))));
-    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(info.GetIsolate()));
+        v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::assignCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate))));
+    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(isolate));
     if (holder.IsEmpty()) {
         // can only reach here by 'object.__proto__.func', and it should passed
         // domain security check already
@@ -182,7 +185,7 @@ v8::Handle<v8::Value> V8Location::assignAccessorGetter(v8::Local<v8::String> nam
     }
     Location* imp = V8Location::toNative(holder);
     if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) {
-        static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(v8::FunctionTemplate::New(V8Location::assignCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(info.GetIsolate()))));
+        static v8::Persistent<v8::FunctionTemplate> sharedTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New(V8Location::assignCallback, v8Undefined(), v8::Signature::New(V8Location::GetRawTemplate(isolate))));
         return sharedTemplate->GetFunction();
     }
     return privateTemplate->GetFunction();
index 7b0373d8c38f47ab79d5ebec10160c05f8280f40..0ece97ace5488e23afb685bf0a6549c415b551cb 100644 (file)
@@ -1,3 +1,12 @@
+2013-02-08  Dan Carney  <dcarney@google.com>
+
+        [v8] isolate parameter added to all v8::peristent calls
+        https://bugs.webkit.org/show_bug.cgi?id=109268
+
+        Reviewed by Kentaro Hara.
+
+        * tests/WebFrameTest.cpp:
+
 2013-02-07  Kent Tamura  <tkent@chromium.org>
 
         [Chromium-Android] Disable input[type=datetime]
index ed51d270c7746bf57846cc3866959e4f6185e228..a26ad2722375011d22bb3c7e8694e9bf787049f7 100644 (file)
@@ -987,15 +987,15 @@ public:
     struct Notification {
     public:
         Notification(WebFrame* frame, v8::Handle<v8::Context> context, int worldId)
-            : frame(frame) ,
-              context(v8::Persistent<v8::Context>::New(context)),
-              worldId(worldId)
+            : frame(frame)
+            , context(v8::Persistent<v8::Context>::New(context->GetIsolate(), context))
+            , worldId(worldId)
         {
         }
 
         ~Notification()
         {
-            context.Dispose();
+            context.Dispose(context->GetIsolate());
         }
 
         bool Equals(Notification* other)