Changeset 145802 in webkit


Ignore:
Timestamp:
Mar 14, 2013 4:12:22 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[V8] Store main world and non-main world templates separately.
https://bugs.webkit.org/show_bug.cgi?id=111724

Patch by Marja Hölttä <marja@chromium.org> on 2013-03-14
Reviewed by Jochen Eisinger.

This is needed for generating specialized bindings for the main
world (bug 110874).

Source/WebCore:

No new tests (updated existing bindings tests).

  • bindings/scripts/CodeGeneratorV8.pm:

(GenerateHeader):
(GenerateDomainSafeFunctionGetter):
(GenerateNormalAttrSetter):
(GenerateParametersCheckExpression):
(GenerateParametersCheck):
(GenerateImplementation):
(JSValueToNative):
(CreateCustomSignature):

  • bindings/scripts/test/V8/V8Float64Array.cpp:

(WebCore::Float64ArrayV8Internal::fooMethod):
(WebCore::ConfigureV8Float64ArrayTemplate):
(WebCore::V8Float64Array::GetTemplate):
(WebCore::V8Float64Array::HasInstance):

  • bindings/scripts/test/V8/V8Float64Array.h:

(V8Float64Array):

  • bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:

(WebCore::TestActiveDOMObjectV8Internal::excitingFunctionMethod):
(WebCore::TestActiveDOMObjectV8Internal::postMessageAttrGetter):
(WebCore::ConfigureV8TestActiveDOMObjectTemplate):
(WebCore::V8TestActiveDOMObject::GetTemplate):
(WebCore::V8TestActiveDOMObject::HasInstance):

  • bindings/scripts/test/V8/V8TestActiveDOMObject.h:

(V8TestActiveDOMObject):

  • bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:

(WebCore::V8TestCustomNamedGetter::GetTemplate):
(WebCore::V8TestCustomNamedGetter::HasInstance):

  • bindings/scripts/test/V8/V8TestCustomNamedGetter.h:

(V8TestCustomNamedGetter):

  • bindings/scripts/test/V8/V8TestEventConstructor.cpp:

(WebCore::V8TestEventConstructor::GetTemplate):
(WebCore::V8TestEventConstructor::HasInstance):

  • bindings/scripts/test/V8/V8TestEventConstructor.h:

(V8TestEventConstructor):

  • bindings/scripts/test/V8/V8TestEventTarget.cpp:

(WebCore::TestEventTargetV8Internal::dispatchEventMethod):
(WebCore::ConfigureV8TestEventTargetTemplate):
(WebCore::V8TestEventTarget::GetTemplate):
(WebCore::V8TestEventTarget::HasInstance):

  • bindings/scripts/test/V8/V8TestEventTarget.h:

(V8TestEventTarget):

  • bindings/scripts/test/V8/V8TestException.cpp:

(WebCore::V8TestException::GetTemplate):
(WebCore::V8TestException::HasInstance):

  • bindings/scripts/test/V8/V8TestException.h:

(V8TestException):

  • bindings/scripts/test/V8/V8TestInterface.cpp:

(WebCore::TestInterfaceV8Internal::supplementalNodeAttrSetter):
(WebCore::TestInterfaceV8Internal::supplementalMethod2Method):
(WebCore::ConfigureV8TestInterfaceTemplate):
(WebCore::V8TestInterface::GetTemplate):
(WebCore::V8TestInterface::HasInstance):

  • bindings/scripts/test/V8/V8TestInterface.h:

(V8TestInterface):

  • bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:

(WebCore::V8TestMediaQueryListListener::GetTemplate):
(WebCore::V8TestMediaQueryListListener::HasInstance):

  • bindings/scripts/test/V8/V8TestMediaQueryListListener.h:

(V8TestMediaQueryListListener):

  • bindings/scripts/test/V8/V8TestNamedConstructor.cpp:

(WebCore::V8TestNamedConstructor::GetTemplate):
(WebCore::V8TestNamedConstructor::HasInstance):

  • bindings/scripts/test/V8/V8TestNamedConstructor.h:

(V8TestNamedConstructor):

  • bindings/scripts/test/V8/V8TestNode.cpp:

(WebCore::V8TestNode::GetTemplate):
(WebCore::V8TestNode::HasInstance):

  • bindings/scripts/test/V8/V8TestNode.h:

(V8TestNode):

  • bindings/scripts/test/V8/V8TestObj.cpp:

(WebCore::TestObjV8Internal::testObjAttrAttrSetter):
(WebCore::TestObjV8Internal::XMLObjAttrAttrSetter):
(WebCore::TestObjV8Internal::typedArrayAttrAttrSetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAttributeAttrSetter):
(WebCore::TestObjV8Internal::withScriptStateAttributeRaisesAttrSetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAttributeRaisesAttrSetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeAttrSetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetter):
(WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSetter):
(WebCore::TestObjV8Internal::withScriptArgumentsAndCallStackAttributeAttrSetter):
(WebCore::TestObjV8Internal::mutablePointAttrSetter):
(WebCore::TestObjV8Internal::immutablePointAttrSetter):
(WebCore::TestObjV8Internal::voidMethodWithArgsMethod):
(WebCore::TestObjV8Internal::longMethodWithArgsMethod):
(WebCore::TestObjV8Internal::objMethodWithArgsMethod):
(WebCore::TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod):
(WebCore::TestObjV8Internal::overloadedMethod1Method):
(WebCore::TestObjV8Internal::overloadedMethod2Method):
(WebCore::TestObjV8Internal::overloadedMethod8Method):
(WebCore::TestObjV8Internal::overloadedMethodMethod):
(WebCore::TestObjV8Internal::convert1Method):
(WebCore::TestObjV8Internal::convert2Method):
(WebCore::TestObjV8Internal::convert4Method):
(WebCore::TestObjV8Internal::convert5Method):
(WebCore::TestObjV8Internal::variadicNodeMethodMethod):
(WebCore::ConfigureV8TestObjTemplate):
(WebCore::V8TestObj::GetTemplate):
(WebCore::V8TestObj::HasInstance):

  • bindings/scripts/test/V8/V8TestObj.h:

(V8TestObj):

  • bindings/scripts/test/V8/V8TestOverloadedConstructors.cpp:

(WebCore::TestOverloadedConstructorsV8Internal::constructor1):
(WebCore::TestOverloadedConstructorsV8Internal::constructor2):
(WebCore::TestOverloadedConstructorsV8Internal::constructor3):
(WebCore::TestOverloadedConstructorsV8Internal::constructor):
(WebCore::V8TestOverloadedConstructors::GetTemplate):
(WebCore::V8TestOverloadedConstructors::HasInstance):

  • bindings/scripts/test/V8/V8TestOverloadedConstructors.h:

(V8TestOverloadedConstructors):

  • bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:

(WebCore::V8TestSerializedScriptValueInterface::GetTemplate):
(WebCore::V8TestSerializedScriptValueInterface::HasInstance):

  • bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h:

(V8TestSerializedScriptValueInterface):

  • bindings/scripts/test/V8/V8TestTypedefs.cpp:

(WebCore::TestTypedefsV8Internal::funcMethod):
(WebCore::ConfigureV8TestTypedefsTemplate):
(WebCore::V8TestTypedefs::GetTemplate):
(WebCore::V8TestTypedefs::HasInstance):

  • bindings/scripts/test/V8/V8TestTypedefs.h:

(V8TestTypedefs):

  • bindings/v8/Dictionary.cpp:

(WebCore::Dictionary::get):

  • bindings/v8/ScriptProfiler.cpp:

(WebCore::ScriptProfiler::visitNodeWrappers):

  • bindings/v8/SerializedScriptValue.cpp:
  • bindings/v8/V8AdaptorFunction.cpp:

(WebCore::V8AdaptorFunction::getTemplate):

  • bindings/v8/V8Binding.cpp:

(WebCore::toDOMStringList):
(WebCore::toXPathNSResolver):

  • bindings/v8/V8Binding.h:

(WebCore):
(WebCore::toRefPtrNativeArray):

  • bindings/v8/V8Collection.cpp:

(WebCore::toOptionsCollectionSetter):

  • bindings/v8/V8GCController.cpp:
  • bindings/v8/V8NPObject.cpp:

(WebCore::npObjectInvokeImpl):

  • bindings/v8/V8PerIsolateData.cpp:

(WebCore::V8PerIsolateData::reportMemoryUsage):
(WebCore::V8PerIsolateData::hasPrivateTemplate):
(WebCore::V8PerIsolateData::privateTemplate):
(WebCore::V8PerIsolateData::rawTemplate):
(WebCore::V8PerIsolateData::hasInstance):

  • bindings/v8/V8PerIsolateData.h:

(WebCore::V8PerIsolateData::rawTemplateMap):
(V8PerIsolateData):
(WebCore::V8PerIsolateData::templateMap):

  • bindings/v8/V8Utilities.cpp:

(WebCore::extractTransferables):

  • bindings/v8/custom/V8ArrayBufferViewCustom.h:

(WebCore::constructWebGLArray):
(WebCore::setWebGLArrayHelper):

  • bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp:

(WebCore::V8AudioBufferSourceNode::bufferAttrSetterCustom):

  • bindings/v8/custom/V8BlobCustom.cpp:

(WebCore::V8Blob::constructorCustom):

  • bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:

(WebCore::toCanvasStyle):

  • bindings/v8/custom/V8ClipboardCustom.cpp:

(WebCore::V8Clipboard::setDragImageMethodCustom):

  • bindings/v8/custom/V8CryptoCustom.cpp:

(WebCore::V8Crypto::getRandomValuesMethodCustom):

  • bindings/v8/custom/V8DOMFormDataCustom.cpp:

(WebCore::V8DOMFormData::constructorCustom):
(WebCore::V8DOMFormData::appendMethodCustom):

  • bindings/v8/custom/V8DataViewCustom.cpp:

(WebCore::V8DataView::constructorCustom):

  • bindings/v8/custom/V8DocumentCustom.cpp:

(WebCore::V8Document::evaluateMethodCustom):

  • bindings/v8/custom/V8HTMLMediaElementCustom.cpp:

(WebCore::V8HTMLMediaElement::controllerAttrSetterCustom):

  • bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:

(WebCore::V8HTMLOptionsCollection::addMethodCustom):

  • bindings/v8/custom/V8HTMLSelectElementCustom.cpp:

(WebCore::removeElement):

  • bindings/v8/custom/V8InjectedScriptHostCustom.cpp:

(WebCore::V8InjectedScriptHost::isHTMLAllCollectionMethodCustom):
(WebCore::V8InjectedScriptHost::typeMethodCustom):
(WebCore::V8InjectedScriptHost::getEventListenersMethodCustom):

  • bindings/v8/custom/V8LocationCustom.cpp:

(WebCore::V8Location::reloadAttrGetterCustom):
(WebCore::V8Location::replaceAttrGetterCustom):
(WebCore::V8Location::assignAttrGetterCustom):

  • bindings/v8/custom/V8NodeCustom.cpp:

(WebCore::V8Node::insertBeforeMethodCustom):
(WebCore::V8Node::replaceChildMethodCustom):
(WebCore::V8Node::removeChildMethodCustom):
(WebCore::V8Node::appendChildMethodCustom):

  • bindings/v8/custom/V8NodeListCustom.cpp:

(WebCore::V8NodeList::opaqueRootForGC):

  • bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:

(WebCore::toWebGLUniformLocation):
(WebCore::V8WebGLRenderingContext::getAttachedShadersMethodCustom):
(WebCore::V8WebGLRenderingContext::getProgramParameterMethodCustom):
(WebCore::V8WebGLRenderingContext::getShaderParameterMethodCustom):
(WebCore::V8WebGLRenderingContext::getUniformMethodCustom):
(WebCore::vertexAttribAndUniformHelperf):
(WebCore::uniformHelperi):
(WebCore::uniformMatrixHelper):

  • bindings/v8/custom/V8XMLHttpRequestCustom.cpp:

(WebCore::isDocumentType):
(WebCore::V8XMLHttpRequest::sendMethodCustom):

Source/WebKit/chromium:

  • src/WebArrayBuffer.cpp:

(WebKit::WebArrayBuffer::createFromV8Value):

  • src/WebArrayBufferView.cpp:

(WebKit::WebArrayBufferView::createFromV8Value):

  • src/WebBindings.cpp:

(WebKit::getRangeImpl):
(WebKit::getNodeImpl):
(WebKit::getElementImpl):
(WebKit::getArrayBufferImpl):
(WebKit::getArrayBufferViewImpl):

Location:
trunk/Source
Files:
64 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r145801 r145802  
     12013-03-14  Marja Hölttä  <marja@chromium.org>
     2
     3        [V8] Store main world and non-main world templates separately.
     4        https://bugs.webkit.org/show_bug.cgi?id=111724
     5
     6        Reviewed by Jochen Eisinger.
     7
     8        This is needed for generating specialized bindings for the main
     9        world (bug 110874).
     10
     11        No new tests (updated existing bindings tests).
     12
     13        * bindings/scripts/CodeGeneratorV8.pm:
     14        (GenerateHeader):
     15        (GenerateDomainSafeFunctionGetter):
     16        (GenerateNormalAttrSetter):
     17        (GenerateParametersCheckExpression):
     18        (GenerateParametersCheck):
     19        (GenerateImplementation):
     20        (JSValueToNative):
     21        (CreateCustomSignature):
     22        * bindings/scripts/test/V8/V8Float64Array.cpp:
     23        (WebCore::Float64ArrayV8Internal::fooMethod):
     24        (WebCore::ConfigureV8Float64ArrayTemplate):
     25        (WebCore::V8Float64Array::GetTemplate):
     26        (WebCore::V8Float64Array::HasInstance):
     27        * bindings/scripts/test/V8/V8Float64Array.h:
     28        (V8Float64Array):
     29        * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
     30        (WebCore::TestActiveDOMObjectV8Internal::excitingFunctionMethod):
     31        (WebCore::TestActiveDOMObjectV8Internal::postMessageAttrGetter):
     32        (WebCore::ConfigureV8TestActiveDOMObjectTemplate):
     33        (WebCore::V8TestActiveDOMObject::GetTemplate):
     34        (WebCore::V8TestActiveDOMObject::HasInstance):
     35        * bindings/scripts/test/V8/V8TestActiveDOMObject.h:
     36        (V8TestActiveDOMObject):
     37        * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
     38        (WebCore::V8TestCustomNamedGetter::GetTemplate):
     39        (WebCore::V8TestCustomNamedGetter::HasInstance):
     40        * bindings/scripts/test/V8/V8TestCustomNamedGetter.h:
     41        (V8TestCustomNamedGetter):
     42        * bindings/scripts/test/V8/V8TestEventConstructor.cpp:
     43        (WebCore::V8TestEventConstructor::GetTemplate):
     44        (WebCore::V8TestEventConstructor::HasInstance):
     45        * bindings/scripts/test/V8/V8TestEventConstructor.h:
     46        (V8TestEventConstructor):
     47        * bindings/scripts/test/V8/V8TestEventTarget.cpp:
     48        (WebCore::TestEventTargetV8Internal::dispatchEventMethod):
     49        (WebCore::ConfigureV8TestEventTargetTemplate):
     50        (WebCore::V8TestEventTarget::GetTemplate):
     51        (WebCore::V8TestEventTarget::HasInstance):
     52        * bindings/scripts/test/V8/V8TestEventTarget.h:
     53        (V8TestEventTarget):
     54        * bindings/scripts/test/V8/V8TestException.cpp:
     55        (WebCore::V8TestException::GetTemplate):
     56        (WebCore::V8TestException::HasInstance):
     57        * bindings/scripts/test/V8/V8TestException.h:
     58        (V8TestException):
     59        * bindings/scripts/test/V8/V8TestInterface.cpp:
     60        (WebCore::TestInterfaceV8Internal::supplementalNodeAttrSetter):
     61        (WebCore::TestInterfaceV8Internal::supplementalMethod2Method):
     62        (WebCore::ConfigureV8TestInterfaceTemplate):
     63        (WebCore::V8TestInterface::GetTemplate):
     64        (WebCore::V8TestInterface::HasInstance):
     65        * bindings/scripts/test/V8/V8TestInterface.h:
     66        (V8TestInterface):
     67        * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
     68        (WebCore::V8TestMediaQueryListListener::GetTemplate):
     69        (WebCore::V8TestMediaQueryListListener::HasInstance):
     70        * bindings/scripts/test/V8/V8TestMediaQueryListListener.h:
     71        (V8TestMediaQueryListListener):
     72        * bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
     73        (WebCore::V8TestNamedConstructor::GetTemplate):
     74        (WebCore::V8TestNamedConstructor::HasInstance):
     75        * bindings/scripts/test/V8/V8TestNamedConstructor.h:
     76        (V8TestNamedConstructor):
     77        * bindings/scripts/test/V8/V8TestNode.cpp:
     78        (WebCore::V8TestNode::GetTemplate):
     79        (WebCore::V8TestNode::HasInstance):
     80        * bindings/scripts/test/V8/V8TestNode.h:
     81        (V8TestNode):
     82        * bindings/scripts/test/V8/V8TestObj.cpp:
     83        (WebCore::TestObjV8Internal::testObjAttrAttrSetter):
     84        (WebCore::TestObjV8Internal::XMLObjAttrAttrSetter):
     85        (WebCore::TestObjV8Internal::typedArrayAttrAttrSetter):
     86        (WebCore::TestObjV8Internal::withScriptExecutionContextAttributeAttrSetter):
     87        (WebCore::TestObjV8Internal::withScriptStateAttributeRaisesAttrSetter):
     88        (WebCore::TestObjV8Internal::withScriptExecutionContextAttributeRaisesAttrSetter):
     89        (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeAttrSetter):
     90        (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateAttributeRaisesAttrSetter):
     91        (WebCore::TestObjV8Internal::withScriptExecutionContextAndScriptStateWithSpacesAttributeAttrSetter):
     92        (WebCore::TestObjV8Internal::withScriptArgumentsAndCallStackAttributeAttrSetter):
     93        (WebCore::TestObjV8Internal::mutablePointAttrSetter):
     94        (WebCore::TestObjV8Internal::immutablePointAttrSetter):
     95        (WebCore::TestObjV8Internal::voidMethodWithArgsMethod):
     96        (WebCore::TestObjV8Internal::longMethodWithArgsMethod):
     97        (WebCore::TestObjV8Internal::objMethodWithArgsMethod):
     98        (WebCore::TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod):
     99        (WebCore::TestObjV8Internal::overloadedMethod1Method):
     100        (WebCore::TestObjV8Internal::overloadedMethod2Method):
     101        (WebCore::TestObjV8Internal::overloadedMethod8Method):
     102        (WebCore::TestObjV8Internal::overloadedMethodMethod):
     103        (WebCore::TestObjV8Internal::convert1Method):
     104        (WebCore::TestObjV8Internal::convert2Method):
     105        (WebCore::TestObjV8Internal::convert4Method):
     106        (WebCore::TestObjV8Internal::convert5Method):
     107        (WebCore::TestObjV8Internal::variadicNodeMethodMethod):
     108        (WebCore::ConfigureV8TestObjTemplate):
     109        (WebCore::V8TestObj::GetTemplate):
     110        (WebCore::V8TestObj::HasInstance):
     111        * bindings/scripts/test/V8/V8TestObj.h:
     112        (V8TestObj):
     113        * bindings/scripts/test/V8/V8TestOverloadedConstructors.cpp:
     114        (WebCore::TestOverloadedConstructorsV8Internal::constructor1):
     115        (WebCore::TestOverloadedConstructorsV8Internal::constructor2):
     116        (WebCore::TestOverloadedConstructorsV8Internal::constructor3):
     117        (WebCore::TestOverloadedConstructorsV8Internal::constructor):
     118        (WebCore::V8TestOverloadedConstructors::GetTemplate):
     119        (WebCore::V8TestOverloadedConstructors::HasInstance):
     120        * bindings/scripts/test/V8/V8TestOverloadedConstructors.h:
     121        (V8TestOverloadedConstructors):
     122        * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
     123        (WebCore::V8TestSerializedScriptValueInterface::GetTemplate):
     124        (WebCore::V8TestSerializedScriptValueInterface::HasInstance):
     125        * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h:
     126        (V8TestSerializedScriptValueInterface):
     127        * bindings/scripts/test/V8/V8TestTypedefs.cpp:
     128        (WebCore::TestTypedefsV8Internal::funcMethod):
     129        (WebCore::ConfigureV8TestTypedefsTemplate):
     130        (WebCore::V8TestTypedefs::GetTemplate):
     131        (WebCore::V8TestTypedefs::HasInstance):
     132        * bindings/scripts/test/V8/V8TestTypedefs.h:
     133        (V8TestTypedefs):
     134        * bindings/v8/Dictionary.cpp:
     135        (WebCore::Dictionary::get):
     136        * bindings/v8/ScriptProfiler.cpp:
     137        (WebCore::ScriptProfiler::visitNodeWrappers):
     138        * bindings/v8/SerializedScriptValue.cpp:
     139        * bindings/v8/V8AdaptorFunction.cpp:
     140        (WebCore::V8AdaptorFunction::getTemplate):
     141        * bindings/v8/V8Binding.cpp:
     142        (WebCore::toDOMStringList):
     143        (WebCore::toXPathNSResolver):
     144        * bindings/v8/V8Binding.h:
     145        (WebCore):
     146        (WebCore::toRefPtrNativeArray):
     147        * bindings/v8/V8Collection.cpp:
     148        (WebCore::toOptionsCollectionSetter):
     149        * bindings/v8/V8GCController.cpp:
     150        * bindings/v8/V8NPObject.cpp:
     151        (WebCore::npObjectInvokeImpl):
     152        * bindings/v8/V8PerIsolateData.cpp:
     153        (WebCore::V8PerIsolateData::reportMemoryUsage):
     154        (WebCore::V8PerIsolateData::hasPrivateTemplate):
     155        (WebCore::V8PerIsolateData::privateTemplate):
     156        (WebCore::V8PerIsolateData::rawTemplate):
     157        (WebCore::V8PerIsolateData::hasInstance):
     158        * bindings/v8/V8PerIsolateData.h:
     159        (WebCore::V8PerIsolateData::rawTemplateMap):
     160        (V8PerIsolateData):
     161        (WebCore::V8PerIsolateData::templateMap):
     162        * bindings/v8/V8Utilities.cpp:
     163        (WebCore::extractTransferables):
     164        * bindings/v8/custom/V8ArrayBufferViewCustom.h:
     165        (WebCore::constructWebGLArray):
     166        (WebCore::setWebGLArrayHelper):
     167        * bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp:
     168        (WebCore::V8AudioBufferSourceNode::bufferAttrSetterCustom):
     169        * bindings/v8/custom/V8BlobCustom.cpp:
     170        (WebCore::V8Blob::constructorCustom):
     171        * bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:
     172        (WebCore::toCanvasStyle):
     173        * bindings/v8/custom/V8ClipboardCustom.cpp:
     174        (WebCore::V8Clipboard::setDragImageMethodCustom):
     175        * bindings/v8/custom/V8CryptoCustom.cpp:
     176        (WebCore::V8Crypto::getRandomValuesMethodCustom):
     177        * bindings/v8/custom/V8DOMFormDataCustom.cpp:
     178        (WebCore::V8DOMFormData::constructorCustom):
     179        (WebCore::V8DOMFormData::appendMethodCustom):
     180        * bindings/v8/custom/V8DataViewCustom.cpp:
     181        (WebCore::V8DataView::constructorCustom):
     182        * bindings/v8/custom/V8DocumentCustom.cpp:
     183        (WebCore::V8Document::evaluateMethodCustom):
     184        * bindings/v8/custom/V8HTMLMediaElementCustom.cpp:
     185        (WebCore::V8HTMLMediaElement::controllerAttrSetterCustom):
     186        * bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp:
     187        (WebCore::V8HTMLOptionsCollection::addMethodCustom):
     188        * bindings/v8/custom/V8HTMLSelectElementCustom.cpp:
     189        (WebCore::removeElement):
     190        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
     191        (WebCore::V8InjectedScriptHost::isHTMLAllCollectionMethodCustom):
     192        (WebCore::V8InjectedScriptHost::typeMethodCustom):
     193        (WebCore::V8InjectedScriptHost::getEventListenersMethodCustom):
     194        * bindings/v8/custom/V8LocationCustom.cpp:
     195        (WebCore::V8Location::reloadAttrGetterCustom):
     196        (WebCore::V8Location::replaceAttrGetterCustom):
     197        (WebCore::V8Location::assignAttrGetterCustom):
     198        * bindings/v8/custom/V8NodeCustom.cpp:
     199        (WebCore::V8Node::insertBeforeMethodCustom):
     200        (WebCore::V8Node::replaceChildMethodCustom):
     201        (WebCore::V8Node::removeChildMethodCustom):
     202        (WebCore::V8Node::appendChildMethodCustom):
     203        * bindings/v8/custom/V8NodeListCustom.cpp:
     204        (WebCore::V8NodeList::opaqueRootForGC):
     205        * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
     206        (WebCore::toWebGLUniformLocation):
     207        (WebCore::V8WebGLRenderingContext::getAttachedShadersMethodCustom):
     208        (WebCore::V8WebGLRenderingContext::getProgramParameterMethodCustom):
     209        (WebCore::V8WebGLRenderingContext::getShaderParameterMethodCustom):
     210        (WebCore::V8WebGLRenderingContext::getUniformMethodCustom):
     211        (WebCore::vertexAttribAndUniformHelperf):
     212        (WebCore::uniformHelperi):
     213        (WebCore::uniformMatrixHelper):
     214        * bindings/v8/custom/V8XMLHttpRequestCustom.cpp:
     215        (WebCore::isDocumentType):
     216        (WebCore::V8XMLHttpRequest::sendMethodCustom):
     217
    12182013-03-14  Mike West  <mkwst@chromium.org>
    2219
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r145765 r145802  
    361361
    362362    push(@headerContent, <<END);
    363     static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*);
     363    static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
    364364    static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
    365365    static ${nativeType}* toNative(v8::Handle<v8::Object> object)
     
    781781    my $funcName = $function->signature->name;
    782782
    783     my $signature = "v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&" . $v8InterfaceName . "::info))";
     783    my $signature = "v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&" . $v8InterfaceName . "::info, currentWorldType))";
    784784    if ($function->signature->extendedAttributes->{"V8DoNotCheckSignature"}) {
    785785        $signature = "v8::Local<v8::Signature>()";
     
    12501250        my $argType = $attribute->signature->type;
    12511251        if (IsWrapperType($argType)) {
    1252             push(@implContentInternals, "    if (!isUndefinedOrNull(value) && !V8${argType}::HasInstance(value, info.GetIsolate())) {\n");
     1252            push(@implContentInternals, "    if (!isUndefinedOrNull(value) && !V8${argType}::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate()))) {\n");
    12531253            push(@implContentInternals, "        throwTypeError(0, info.GetIsolate());\n");
    12541254            push(@implContentInternals, "        return;\n");
     
    14511451        } elsif (IsWrapperType($type)) {
    14521452            if ($parameter->isNullable) {
    1453                 push(@andExpression, "(${value}->IsNull() || V8${type}::HasInstance($value, args.GetIsolate()))");
     1453                push(@andExpression, "(${value}->IsNull() || V8${type}::HasInstance($value, args.GetIsolate(), worldType(args.GetIsolate())))");
    14541454            } else {
    1455                 push(@andExpression, "(V8${type}::HasInstance($value, args.GetIsolate()))");
     1455                push(@andExpression, "(V8${type}::HasInstance($value, args.GetIsolate(), worldType(args.GetIsolate())))");
    14561456            }
    14571457        }
     
    18691869                $parameterCheckString .= "    Vector<$nativeElementType> $parameterName;\n";
    18701870                $parameterCheckString .= "    for (int i = $paramIndex; i < args.Length(); ++i) {\n";
    1871                 $parameterCheckString .= "        if (!V8${argType}::HasInstance(args[i], args.GetIsolate()))\n";
     1871                $parameterCheckString .= "        if (!V8${argType}::HasInstance(args[i], args.GetIsolate(), worldType(args.GetIsolate())))\n";
    18721872                $parameterCheckString .= "            return throwTypeError(0, args.GetIsolate());\n";
    18731873                $parameterCheckString .= "        $parameterName.append(V8${argType}::toNative(v8::Handle<v8::Object>::Cast(args[i])));\n";
     
    18901890                my $argType = $parameter->type;
    18911891                if (IsWrapperType($argType)) {
    1892                     $parameterCheckString .= "    if (args.Length() > $paramIndex && !isUndefinedOrNull($argValue) && !V8${argType}::HasInstance($argValue, args.GetIsolate()))\n";
     1892                    $parameterCheckString .= "    if (args.Length() > $paramIndex && !isUndefinedOrNull($argValue) && !V8${argType}::HasInstance($argValue, args.GetIsolate(), worldType(args.GetIsolate())))\n";
    18931893                    $parameterCheckString .= "        return throwTypeError(0, args.GetIsolate());\n";
    18941894                }
     
    31563156{
    31573157    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    3158     V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    3159     if (result != data->templateMap().end())
     3158    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(worldType).find(&info);
     3159    if (result != data->templateMap(worldType).end())
    31603160        return result->value;
    31613161
    31623162    v8::HandleScope handleScope;
    31633163    v8::Persistent<v8::FunctionTemplate> templ =
    3164         Configure${v8InterfaceName}Template(data->rawTemplate(&info), isolate, worldType);
    3165     data->templateMap().add(&info, templ);
     3164        Configure${v8InterfaceName}Template(data->rawTemplate(&info, worldType), isolate, worldType);
     3165    data->templateMap(worldType).add(&info, templ);
    31663166    return templ;
    31673167}
    31683168
    3169 bool ${v8InterfaceName}::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate)
    3170 {
    3171     return V8PerIsolateData::from(isolate)->hasInstance(&info, value);
     3169bool ${v8InterfaceName}::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType worldType)
     3170{
     3171    return V8PerIsolateData::from(isolate)->hasInstance(&info, value, worldType);
    31723172}
    31733173
     
    40484048
    40494049    AddToImplIncludes("V8${type}.h");
    4050     return "V8${type}::HasInstance($value, $getIsolate) ? V8${type}::toNative(v8::Handle<v8::Object>::Cast($value)) : 0";
     4050    return "V8${type}::HasInstance($value, $getIsolate, worldType($getIsolate)) ? V8${type}::toNative(v8::Handle<v8::Object>::Cast($value)) : 0";
    40514051}
    40524052
     
    40994099                    AddToImplIncludes(GetV8HeaderName($type));
    41004100                }
    4101                 $result .= "V8PerIsolateData::from(isolate)->rawTemplate(&V8${type}::info)";
     4101                $result .= "V8PerIsolateData::from(isolate)->rawTemplate(&V8${type}::info, worldType)";
    41024102            }
    41034103        } else {
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp

    r145575 r145802  
    8686        return throwNotEnoughArgumentsError(args.GetIsolate());
    8787    Float64Array* imp = V8Float64Array::toNative(args.Holder());
    88     V8TRYCATCH(Float32Array*, array, V8Float32Array::HasInstance(args[0], args.GetIsolate()) ? V8Float32Array::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     88    V8TRYCATCH(Float32Array*, array, V8Float32Array::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Float32Array::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    8989    return toV8(imp->foo(array), args.Holder(), args.GetIsolate());
    9090}
     
    154154    // Custom Signature 'foo'
    155155    const int fooArgc = 1;
    156     v8::Handle<v8::FunctionTemplate> fooArgv[fooArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Float32Array::info) };
     156    v8::Handle<v8::FunctionTemplate> fooArgv[fooArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Float32Array::info, worldType) };
    157157    v8::Handle<v8::Signature> fooSignature = v8::Signature::New(desc, fooArgc, fooArgv);
    158158    proto->Set(v8::String::NewSymbol("foo"), v8::FunctionTemplate::New(Float64ArrayV8Internal::fooMethodCallback, v8Undefined(), fooSignature));
     
    166166{
    167167    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    168     V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    169     if (result != data->templateMap().end())
     168    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(worldType).find(&info);
     169    if (result != data->templateMap(worldType).end())
    170170        return result->value;
    171171
    172172    v8::HandleScope handleScope;
    173173    v8::Persistent<v8::FunctionTemplate> templ =
    174         ConfigureV8Float64ArrayTemplate(data->rawTemplate(&info), isolate, worldType);
    175     data->templateMap().add(&info, templ);
     174        ConfigureV8Float64ArrayTemplate(data->rawTemplate(&info, worldType), isolate, worldType);
     175    data->templateMap(worldType).add(&info, templ);
    176176    return templ;
    177177}
    178178
    179 bool V8Float64Array::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate)
    180 {
    181     return V8PerIsolateData::from(isolate)->hasInstance(&info, value);
     179bool V8Float64Array::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType worldType)
     180{
     181    return V8PerIsolateData::from(isolate)->hasInstance(&info, value, worldType);
    182182}
    183183
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8Float64Array.h

    r145575 r145802  
    3636public:
    3737    static const bool hasDependentLifetime = V8ArrayBufferView::hasDependentLifetime;
    38     static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*);
     38    static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
    3939    static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
    4040    static Float64Array* toNative(v8::Handle<v8::Object> object)
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp

    r145575 r145802  
    102102    if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame()))
    103103        return v8Undefined();
    104     V8TRYCATCH(Node*, nextChild, V8Node::HasInstance(args[0], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     104    V8TRYCATCH(Node*, nextChild, V8Node::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    105105    imp->excitingFunction(nextChild);
    106106    return v8Undefined();
     
    133133    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
    134134    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
    135     v8::Persistent<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestActiveDOMObjectV8Internal::postMessageMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestActiveDOMObject::info)));
     135    v8::Persistent<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, TestActiveDOMObjectV8Internal::postMessageMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestActiveDOMObject::info, currentWorldType)));
    136136
    137137    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8TestActiveDOMObject::GetTemplate(info.GetIsolate(), currentWorldType));
     
    144144    if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) {
    145145        static const char* sharedTemplateUniqueKey = "postMessageSharedTemplate";
    146         v8::Persistent<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestActiveDOMObjectV8Internal::postMessageMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestActiveDOMObject::info)));
     146        v8::Persistent<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, TestActiveDOMObjectV8Internal::postMessageMethodCallback, v8Undefined(), v8::Signature::New(V8PerIsolateData::from(info.GetIsolate())->rawTemplate(&V8TestActiveDOMObject::info, currentWorldType)));
    147147        return sharedTemplate->GetFunction();
    148148    }
     
    196196    // Custom Signature 'excitingFunction'
    197197    const int excitingFunctionArgc = 1;
    198     v8::Handle<v8::FunctionTemplate> excitingFunctionArgv[excitingFunctionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::info) };
     198    v8::Handle<v8::FunctionTemplate> excitingFunctionArgv[excitingFunctionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::info, worldType) };
    199199    v8::Handle<v8::Signature> excitingFunctionSignature = v8::Signature::New(desc, excitingFunctionArgc, excitingFunctionArgv);
    200200    proto->Set(v8::String::NewSymbol("excitingFunction"), v8::FunctionTemplate::New(TestActiveDOMObjectV8Internal::excitingFunctionMethodCallback, v8Undefined(), excitingFunctionSignature));
     
    211211{
    212212    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    213     V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    214     if (result != data->templateMap().end())
     213    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(worldType).find(&info);
     214    if (result != data->templateMap(worldType).end())
    215215        return result->value;
    216216
    217217    v8::HandleScope handleScope;
    218218    v8::Persistent<v8::FunctionTemplate> templ =
    219         ConfigureV8TestActiveDOMObjectTemplate(data->rawTemplate(&info), isolate, worldType);
    220     data->templateMap().add(&info, templ);
     219        ConfigureV8TestActiveDOMObjectTemplate(data->rawTemplate(&info, worldType), isolate, worldType);
     220    data->templateMap(worldType).add(&info, templ);
    221221    return templ;
    222222}
    223223
    224 bool V8TestActiveDOMObject::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate)
    225 {
    226     return V8PerIsolateData::from(isolate)->hasInstance(&info, value);
     224bool V8TestActiveDOMObject::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType worldType)
     225{
     226    return V8PerIsolateData::from(isolate)->hasInstance(&info, value, worldType);
    227227}
    228228
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.h

    r145575 r145802  
    3535public:
    3636    static const bool hasDependentLifetime = false;
    37     static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*);
     37    static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
    3838    static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
    3939    static TestActiveDOMObject* toNative(v8::Handle<v8::Object> object)
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp

    r145575 r145802  
    116116{
    117117    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    118     V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    119     if (result != data->templateMap().end())
     118    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(worldType).find(&info);
     119    if (result != data->templateMap(worldType).end())
    120120        return result->value;
    121121
    122122    v8::HandleScope handleScope;
    123123    v8::Persistent<v8::FunctionTemplate> templ =
    124         ConfigureV8TestCustomNamedGetterTemplate(data->rawTemplate(&info), isolate, worldType);
    125     data->templateMap().add(&info, templ);
     124        ConfigureV8TestCustomNamedGetterTemplate(data->rawTemplate(&info, worldType), isolate, worldType);
     125    data->templateMap(worldType).add(&info, templ);
    126126    return templ;
    127127}
    128128
    129 bool V8TestCustomNamedGetter::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate)
     129bool V8TestCustomNamedGetter::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType worldType)
    130130{
    131     return V8PerIsolateData::from(isolate)->hasInstance(&info, value);
     131    return V8PerIsolateData::from(isolate)->hasInstance(&info, value, worldType);
    132132}
    133133
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.h

    r145575 r145802  
    3535public:
    3636    static const bool hasDependentLifetime = false;
    37     static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*);
     37    static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
    3838    static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
    3939    static TestCustomNamedGetter* toNative(v8::Handle<v8::Object> object)
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp

    r145575 r145802  
    158158{
    159159    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    160     V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    161     if (result != data->templateMap().end())
     160    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(worldType).find(&info);
     161    if (result != data->templateMap(worldType).end())
    162162        return result->value;
    163163
    164164    v8::HandleScope handleScope;
    165165    v8::Persistent<v8::FunctionTemplate> templ =
    166         ConfigureV8TestEventConstructorTemplate(data->rawTemplate(&info), isolate, worldType);
    167     data->templateMap().add(&info, templ);
     166        ConfigureV8TestEventConstructorTemplate(data->rawTemplate(&info, worldType), isolate, worldType);
     167    data->templateMap(worldType).add(&info, templ);
    168168    return templ;
    169169}
    170170
    171 bool V8TestEventConstructor::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate)
     171bool V8TestEventConstructor::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType worldType)
    172172{
    173     return V8PerIsolateData::from(isolate)->hasInstance(&info, value);
     173    return V8PerIsolateData::from(isolate)->hasInstance(&info, value, worldType);
    174174}
    175175
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.h

    r145575 r145802  
    3636public:
    3737    static const bool hasDependentLifetime = false;
    38     static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*);
     38    static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
    3939    static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
    4040    static TestEventConstructor* toNative(v8::Handle<v8::Object> object)
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp

    r145575 r145802  
    137137    ExceptionCode ec = 0;
    138138    {
    139     V8TRYCATCH(Event*, evt, V8Event::HasInstance(args[0], args.GetIsolate()) ? V8Event::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     139    V8TRYCATCH(Event*, evt, V8Event::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Event::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    140140    bool result = imp->dispatchEvent(evt, ec);
    141141    if (UNLIKELY(ec))
     
    180180    // Custom Signature 'dispatchEvent'
    181181    const int dispatchEventArgc = 1;
    182     v8::Handle<v8::FunctionTemplate> dispatchEventArgv[dispatchEventArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Event::info) };
     182    v8::Handle<v8::FunctionTemplate> dispatchEventArgv[dispatchEventArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Event::info, worldType) };
    183183    v8::Handle<v8::Signature> dispatchEventSignature = v8::Signature::New(desc, dispatchEventArgc, dispatchEventArgv);
    184184    proto->Set(v8::String::NewSymbol("dispatchEvent"), v8::FunctionTemplate::New(TestEventTargetV8Internal::dispatchEventMethodCallback, v8Undefined(), dispatchEventSignature));
     
    192192{
    193193    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    194     V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    195     if (result != data->templateMap().end())
     194    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(worldType).find(&info);
     195    if (result != data->templateMap(worldType).end())
    196196        return result->value;
    197197
    198198    v8::HandleScope handleScope;
    199199    v8::Persistent<v8::FunctionTemplate> templ =
    200         ConfigureV8TestEventTargetTemplate(data->rawTemplate(&info), isolate, worldType);
    201     data->templateMap().add(&info, templ);
     200        ConfigureV8TestEventTargetTemplate(data->rawTemplate(&info, worldType), isolate, worldType);
     201    data->templateMap(worldType).add(&info, templ);
    202202    return templ;
    203203}
    204204
    205 bool V8TestEventTarget::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate)
    206 {
    207     return V8PerIsolateData::from(isolate)->hasInstance(&info, value);
     205bool V8TestEventTarget::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType worldType)
     206{
     207    return V8PerIsolateData::from(isolate)->hasInstance(&info, value, worldType);
    208208}
    209209
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.h

    r145575 r145802  
    3535public:
    3636    static const bool hasDependentLifetime = false;
    37     static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*);
     37    static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
    3838    static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
    3939    static TestEventTarget* toNative(v8::Handle<v8::Object> object)
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestException.cpp

    r145575 r145802  
    107107{
    108108    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    109     V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    110     if (result != data->templateMap().end())
     109    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(worldType).find(&info);
     110    if (result != data->templateMap(worldType).end())
    111111        return result->value;
    112112
    113113    v8::HandleScope handleScope;
    114114    v8::Persistent<v8::FunctionTemplate> templ =
    115         ConfigureV8TestExceptionTemplate(data->rawTemplate(&info), isolate, worldType);
    116     data->templateMap().add(&info, templ);
     115        ConfigureV8TestExceptionTemplate(data->rawTemplate(&info, worldType), isolate, worldType);
     116    data->templateMap(worldType).add(&info, templ);
    117117    return templ;
    118118}
    119119
    120 bool V8TestException::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate)
     120bool V8TestException::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType worldType)
    121121{
    122     return V8PerIsolateData::from(isolate)->hasInstance(&info, value);
     122    return V8PerIsolateData::from(isolate)->hasInstance(&info, value, worldType);
    123123}
    124124
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestException.h

    r145575 r145802  
    3535public:
    3636    static const bool hasDependentLifetime = false;
    37     static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*);
     37    static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
    3838    static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
    3939    static TestException* toNative(v8::Handle<v8::Object> object)
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp

    r145575 r145802  
    235235{
    236236    TestInterface* imp = V8TestInterface::toNative(info.Holder());
    237     Node* v = V8Node::HasInstance(value, info.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
     237    Node* v = V8Node::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
    238238    TestSupplemental::setSupplementalNode(imp, WTF::getPtr(v));
    239239    return;
     
    281281    {
    282282    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]);
    283     V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[1], args.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
     283    V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[1], args.GetIsolate(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
    284284    ScriptExecutionContext* scriptContext = getScriptExecutionContext();
    285285    RefPtr<TestObj> result = TestSupplemental::supplementalMethod2(scriptContext, imp, strArg, objArg, ec);
     
    439439    // Custom Signature 'supplementalMethod2'
    440440    const int supplementalMethod2Argc = 2;
    441     v8::Handle<v8::FunctionTemplate> supplementalMethod2Argv[supplementalMethod2Argc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info) };
     441    v8::Handle<v8::FunctionTemplate> supplementalMethod2Argv[supplementalMethod2Argc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, worldType) };
    442442    v8::Handle<v8::Signature> supplementalMethod2Signature = v8::Signature::New(desc, supplementalMethod2Argc, supplementalMethod2Argv);
    443443#if ENABLE(Condition11) || ENABLE(Condition12)
     
    457457{
    458458    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    459     V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    460     if (result != data->templateMap().end())
     459    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(worldType).find(&info);
     460    if (result != data->templateMap(worldType).end())
    461461        return result->value;
    462462
    463463    v8::HandleScope handleScope;
    464464    v8::Persistent<v8::FunctionTemplate> templ =
    465         ConfigureV8TestInterfaceTemplate(data->rawTemplate(&info), isolate, worldType);
    466     data->templateMap().add(&info, templ);
     465        ConfigureV8TestInterfaceTemplate(data->rawTemplate(&info, worldType), isolate, worldType);
     466    data->templateMap(worldType).add(&info, templ);
    467467    return templ;
    468468}
    469469
    470 bool V8TestInterface::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate)
    471 {
    472     return V8PerIsolateData::from(isolate)->hasInstance(&info, value);
     470bool V8TestInterface::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType worldType)
     471{
     472    return V8PerIsolateData::from(isolate)->hasInstance(&info, value, worldType);
    473473}
    474474
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h

    r145575 r145802  
    3636public:
    3737    static const bool hasDependentLifetime = true;
    38     static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*);
     38    static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
    3939    static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
    4040    static TestInterface* toNative(v8::Handle<v8::Object> object)
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp

    r145575 r145802  
    116116{
    117117    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    118     V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    119     if (result != data->templateMap().end())
     118    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(worldType).find(&info);
     119    if (result != data->templateMap(worldType).end())
    120120        return result->value;
    121121
    122122    v8::HandleScope handleScope;
    123123    v8::Persistent<v8::FunctionTemplate> templ =
    124         ConfigureV8TestMediaQueryListListenerTemplate(data->rawTemplate(&info), isolate, worldType);
    125     data->templateMap().add(&info, templ);
     124        ConfigureV8TestMediaQueryListListenerTemplate(data->rawTemplate(&info, worldType), isolate, worldType);
     125    data->templateMap(worldType).add(&info, templ);
    126126    return templ;
    127127}
    128128
    129 bool V8TestMediaQueryListListener::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate)
     129bool V8TestMediaQueryListListener::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType worldType)
    130130{
    131     return V8PerIsolateData::from(isolate)->hasInstance(&info, value);
     131    return V8PerIsolateData::from(isolate)->hasInstance(&info, value, worldType);
    132132}
    133133
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.h

    r145575 r145802  
    3535public:
    3636    static const bool hasDependentLifetime = false;
    37     static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*);
     37    static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
    3838    static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
    3939    static TestMediaQueryListListener* toNative(v8::Handle<v8::Object> object)
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp

    r145575 r145802  
    147147{
    148148    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    149     V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    150     if (result != data->templateMap().end())
     149    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(worldType).find(&info);
     150    if (result != data->templateMap(worldType).end())
    151151        return result->value;
    152152
    153153    v8::HandleScope handleScope;
    154154    v8::Persistent<v8::FunctionTemplate> templ =
    155         ConfigureV8TestNamedConstructorTemplate(data->rawTemplate(&info), isolate, worldType);
    156     data->templateMap().add(&info, templ);
     155        ConfigureV8TestNamedConstructorTemplate(data->rawTemplate(&info, worldType), isolate, worldType);
     156    data->templateMap(worldType).add(&info, templ);
    157157    return templ;
    158158}
    159159
    160 bool V8TestNamedConstructor::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate)
     160bool V8TestNamedConstructor::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType worldType)
    161161{
    162     return V8PerIsolateData::from(isolate)->hasInstance(&info, value);
     162    return V8PerIsolateData::from(isolate)->hasInstance(&info, value, worldType);
    163163}
    164164
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.h

    r145575 r145802  
    4141public:
    4242    static const bool hasDependentLifetime = true;
    43     static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*);
     43    static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
    4444    static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
    4545    static TestNamedConstructor* toNative(v8::Handle<v8::Object> object)
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.cpp

    r145575 r145802  
    114114{
    115115    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    116     V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    117     if (result != data->templateMap().end())
     116    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(worldType).find(&info);
     117    if (result != data->templateMap(worldType).end())
    118118        return result->value;
    119119
    120120    v8::HandleScope handleScope;
    121121    v8::Persistent<v8::FunctionTemplate> templ =
    122         ConfigureV8TestNodeTemplate(data->rawTemplate(&info), isolate, worldType);
    123     data->templateMap().add(&info, templ);
     122        ConfigureV8TestNodeTemplate(data->rawTemplate(&info, worldType), isolate, worldType);
     123    data->templateMap(worldType).add(&info, templ);
    124124    return templ;
    125125}
    126126
    127 bool V8TestNode::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate)
     127bool V8TestNode::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType worldType)
    128128{
    129     return V8PerIsolateData::from(isolate)->hasInstance(&info, value);
     129    return V8PerIsolateData::from(isolate)->hasInstance(&info, value, worldType);
    130130}
    131131
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestNode.h

    r145575 r145802  
    3535public:
    3636    static const bool hasDependentLifetime = true;
    37     static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*);
     37    static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
    3838    static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
    3939    static TestNode* toNative(v8::Handle<v8::Object> object)
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp

    r145745 r145802  
    371371{
    372372    TestObj* imp = V8TestObj::toNative(info.Holder());
    373     TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
     373    TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
    374374    imp->setTestObjAttr(WTF::getPtr(v));
    375375    return;
     
    396396{
    397397    TestObj* imp = V8TestObj::toNative(info.Holder());
    398     TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
     398    TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
    399399    imp->setXMLObjAttr(WTF::getPtr(v));
    400400    return;
     
    660660{
    661661    TestObj* imp = V8TestObj::toNative(info.Holder());
    662     Float32Array* v = V8Float32Array::HasInstance(value, info.GetIsolate()) ? V8Float32Array::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
     662    Float32Array* v = V8Float32Array::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8Float32Array::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
    663663    imp->setTypedArrayAttr(WTF::getPtr(v));
    664664    return;
     
    839839{
    840840    TestObj* imp = V8TestObj::toNative(info.Holder());
    841     TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
     841    TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
    842842    ScriptExecutionContext* scriptContext = getScriptExecutionContext();
    843843    imp->setWithScriptExecutionContextAttribute(scriptContext, WTF::getPtr(v));
     
    874874{
    875875    TestObj* imp = V8TestObj::toNative(info.Holder());
    876     TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
     876    TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
    877877    ScriptState* currentState = ScriptState::current();
    878878    if (!currentState)
     
    909909{
    910910    TestObj* imp = V8TestObj::toNative(info.Holder());
    911     TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
     911    TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
    912912    ScriptExecutionContext* scriptContext = getScriptExecutionContext();
    913913    imp->setWithScriptExecutionContextAttributeRaises(scriptContext, WTF::getPtr(v));
     
    939939{
    940940    TestObj* imp = V8TestObj::toNative(info.Holder());
    941     TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
     941    TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
    942942    ScriptState* currentState = ScriptState::current();
    943943    if (!currentState)
     
    981981{
    982982    TestObj* imp = V8TestObj::toNative(info.Holder());
    983     TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
     983    TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
    984984    ScriptState* currentState = ScriptState::current();
    985985    if (!currentState)
     
    10171017{
    10181018    TestObj* imp = V8TestObj::toNative(info.Holder());
    1019     TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
     1019    TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
    10201020    ScriptState* currentState = ScriptState::current();
    10211021    if (!currentState)
     
    10481048{
    10491049    TestObj* imp = V8TestObj::toNative(info.Holder());
    1050     TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
     1050    TestObj* v = V8TestObj::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
    10511051    imp->setWithScriptArgumentsAndCallStackAttribute(WTF::getPtr(v));
    10521052    return;
     
    13961396{
    13971397    TestObj* imp = V8TestObj::toNative(info.Holder());
    1398     RefPtr<SVGPropertyTearOff<FloatPoint> > v = V8SVGPoint::HasInstance(value, info.GetIsolate()) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
     1398    RefPtr<SVGPropertyTearOff<FloatPoint> > v = V8SVGPoint::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
    13991399    imp->setMutablePoint(WTF::getPtr(v));
    14001400    return;
     
    14201420{
    14211421    TestObj* imp = V8TestObj::toNative(info.Holder());
    1422     RefPtr<SVGPropertyTearOff<FloatPoint> > v = V8SVGPoint::HasInstance(value, info.GetIsolate()) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
     1422    RefPtr<SVGPropertyTearOff<FloatPoint> > v = V8SVGPoint::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint::toNative(v8::Handle<v8::Object>::Cast(value)) : 0;
    14231423    imp->setImmutablePoint(WTF::getPtr(v));
    14241424    return;
     
    15731573    V8TRYCATCH(int, longArg, toInt32(args[0]));
    15741574    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]);
    1575     V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[2], args.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[2])) : 0);
     1575    V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[2], args.GetIsolate(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[2])) : 0);
    15761576    imp->voidMethodWithArgs(longArg, strArg, objArg);
    15771577    return v8Undefined();
     
    16011601    V8TRYCATCH(int, longArg, toInt32(args[0]));
    16021602    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]);
    1603     V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[2], args.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[2])) : 0);
     1603    V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[2], args.GetIsolate(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[2])) : 0);
    16041604    return v8Integer(imp->longMethodWithArgs(longArg, strArg, objArg), args.GetIsolate());
    16051605}
     
    16291629    V8TRYCATCH(int, longArg, toInt32(args[0]));
    16301630    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]);
    1631     V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[2], args.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[2])) : 0);
     1631    V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[2], args.GetIsolate(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[2])) : 0);
    16321632    return toV8(imp->objMethodWithArgs(longArg, strArg, objArg), args.Holder(), args.GetIsolate());
    16331633}
     
    16751675    {
    16761676    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[0]);
    1677     V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[1], args.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
     1677    V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[1], args.GetIsolate(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0);
    16781678    RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, objArg, ec);
    16791679    if (UNLIKELY(ec))
     
    22422242        return throwNotEnoughArgumentsError(args.GetIsolate());
    22432243    TestObj* imp = V8TestObj::toNative(args.Holder());
    2244     V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[0], args.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     2244    V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    22452245    V8TRYCATCH_FOR_V8STRINGRESOURCE(V8StringResource<>, strArg, args[1]);
    22462246    imp->overloadedMethod(objArg, strArg);
     
    22532253        return throwNotEnoughArgumentsError(args.GetIsolate());
    22542254    TestObj* imp = V8TestObj::toNative(args.Holder());
    2255     V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[0], args.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     2255    V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    22562256    if (args.Length() <= 1) {
    22572257        imp->overloadedMethod(objArg);
     
    23202320        return throwNotEnoughArgumentsError(args.GetIsolate());
    23212321    TestObj* imp = V8TestObj::toNative(args.Holder());
    2322     V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[0], args.GetIsolate()) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     2322    V8TRYCATCH(TestObj*, objArg, V8TestObj::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8TestObj::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    23232323    imp->overloadedMethod(objArg);
    23242324    return v8Undefined();
     
    23572357static v8::Handle<v8::Value> overloadedMethodMethod(const v8::Arguments& args)
    23582358{
    2359     if ((args.Length() == 2 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0], args.GetIsolate())) && (args[1]->IsNull() || args[1]->IsUndefined() || args[1]->IsString() || args[1]->IsObject())))
     2359    if ((args.Length() == 2 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate()))) && (args[1]->IsNull() || args[1]->IsUndefined() || args[1]->IsString() || args[1]->IsObject())))
    23602360        return overloadedMethod1Method(args);
    2361     if ((args.Length() == 1 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0], args.GetIsolate()))) || (args.Length() == 2 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0], args.GetIsolate()))))
     2361    if ((args.Length() == 1 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))) || (args.Length() == 2 && (args[0]->IsNull() || V8TestObj::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))))
    23622362        return overloadedMethod2Method(args);
    23632363    if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsUndefined() || args[0]->IsString() || args[0]->IsObject())))
     
    23672367    if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsFunction())))
    23682368        return overloadedMethod5Method(args);
    2369     if ((args.Length() == 1 && (args[0]->IsNull() || V8DOMStringList::HasInstance(args[0], args.GetIsolate()))))
     2369    if ((args.Length() == 1 && (args[0]->IsNull() || V8DOMStringList::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))))
    23702370        return overloadedMethod6Method(args);
    23712371    if ((args.Length() == 1 && (args[0]->IsNull() || args[0]->IsArray())))
    23722372        return overloadedMethod7Method(args);
    2373     if ((args.Length() == 1 && (V8TestObj::HasInstance(args[0], args.GetIsolate()))))
     2373    if ((args.Length() == 1 && (V8TestObj::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))))
    23742374        return overloadedMethod8Method(args);
    23752375    if ((args.Length() == 1 && (args[0]->IsArray())))
     
    26212621        return throwNotEnoughArgumentsError(args.GetIsolate());
    26222622    TestObj* imp = V8TestObj::toNative(args.Holder());
    2623     V8TRYCATCH(a*, value, V8a::HasInstance(args[0], args.GetIsolate()) ? V8a::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     2623    V8TRYCATCH(a*, value, V8a::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8a::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    26242624    imp->convert1(value);
    26252625    return v8Undefined();
     
    26362636        return throwNotEnoughArgumentsError(args.GetIsolate());
    26372637    TestObj* imp = V8TestObj::toNative(args.Holder());
    2638     V8TRYCATCH(b*, value, V8b::HasInstance(args[0], args.GetIsolate()) ? V8b::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     2638    V8TRYCATCH(b*, value, V8b::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8b::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    26392639    imp->convert2(value);
    26402640    return v8Undefined();
     
    26512651        return throwNotEnoughArgumentsError(args.GetIsolate());
    26522652    TestObj* imp = V8TestObj::toNative(args.Holder());
    2653     V8TRYCATCH(d*, value, V8d::HasInstance(args[0], args.GetIsolate()) ? V8d::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     2653    V8TRYCATCH(d*, value, V8d::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8d::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    26542654    imp->convert4(value);
    26552655    return v8Undefined();
     
    26662666        return throwNotEnoughArgumentsError(args.GetIsolate());
    26672667    TestObj* imp = V8TestObj::toNative(args.Holder());
    2668     V8TRYCATCH(e*, value, V8e::HasInstance(args[0], args.GetIsolate()) ? V8e::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     2668    V8TRYCATCH(e*, value, V8e::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8e::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    26692669    imp->convert5(value);
    26702670    return v8Undefined();
     
    27712771        return throwNotEnoughArgumentsError(args.GetIsolate());
    27722772    TestObj* imp = V8TestObj::toNative(args.Holder());
    2773     V8TRYCATCH(Node*, head, V8Node::HasInstance(args[0], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     2773    V8TRYCATCH(Node*, head, V8Node::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    27742774    Vector<RefPtr<Node> > tail;
    27752775    for (int i = 1; i < args.Length(); ++i) {
    2776         if (!V8Node::HasInstance(args[i], args.GetIsolate()))
     2776        if (!V8Node::HasInstance(args[i], args.GetIsolate(), worldType(args.GetIsolate())))
    27772777            return throwTypeError(0, args.GetIsolate());
    27782778        tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(args[i])));
     
    30633063    // Custom Signature 'voidMethodWithArgs'
    30643064    const int voidMethodWithArgsArgc = 3;
    3065     v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info) };
     3065    v8::Handle<v8::FunctionTemplate> voidMethodWithArgsArgv[voidMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, worldType) };
    30663066    v8::Handle<v8::Signature> voidMethodWithArgsSignature = v8::Signature::New(desc, voidMethodWithArgsArgc, voidMethodWithArgsArgv);
    30673067    proto->Set(v8::String::NewSymbol("voidMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::voidMethodWithArgsMethodCallback, v8Undefined(), voidMethodWithArgsSignature));
     
    30693069    // Custom Signature 'longMethodWithArgs'
    30703070    const int longMethodWithArgsArgc = 3;
    3071     v8::Handle<v8::FunctionTemplate> longMethodWithArgsArgv[longMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info) };
     3071    v8::Handle<v8::FunctionTemplate> longMethodWithArgsArgv[longMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, worldType) };
    30723072    v8::Handle<v8::Signature> longMethodWithArgsSignature = v8::Signature::New(desc, longMethodWithArgsArgc, longMethodWithArgsArgv);
    30733073    proto->Set(v8::String::NewSymbol("longMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::longMethodWithArgsMethodCallback, v8Undefined(), longMethodWithArgsSignature));
     
    30753075    // Custom Signature 'objMethodWithArgs'
    30763076    const int objMethodWithArgsArgc = 3;
    3077     v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info) };
     3077    v8::Handle<v8::FunctionTemplate> objMethodWithArgsArgv[objMethodWithArgsArgc] = { v8::Handle<v8::FunctionTemplate>(), v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, worldType) };
    30783078    v8::Handle<v8::Signature> objMethodWithArgsSignature = v8::Signature::New(desc, objMethodWithArgsArgc, objMethodWithArgsArgv);
    30793079    proto->Set(v8::String::NewSymbol("objMethodWithArgs"), v8::FunctionTemplate::New(TestObjV8Internal::objMethodWithArgsMethodCallback, v8Undefined(), objMethodWithArgsSignature));
     
    30813081    // Custom Signature 'methodWithSequenceArg'
    30823082    const int methodWithSequenceArgArgc = 1;
    3083     v8::Handle<v8::FunctionTemplate> methodWithSequenceArgArgv[methodWithSequenceArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8sequence<ScriptProfile>::info) };
     3083    v8::Handle<v8::FunctionTemplate> methodWithSequenceArgArgv[methodWithSequenceArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8sequence<ScriptProfile>::info, worldType) };
    30843084    v8::Handle<v8::Signature> methodWithSequenceArgSignature = v8::Signature::New(desc, methodWithSequenceArgArgc, methodWithSequenceArgArgv);
    30853085    proto->Set(v8::String::NewSymbol("methodWithSequenceArg"), v8::FunctionTemplate::New(TestObjV8Internal::methodWithSequenceArgMethodCallback, v8Undefined(), methodWithSequenceArgSignature));
     
    30873087    // Custom Signature 'methodThatRequiresAllArgsAndThrows'
    30883088    const int methodThatRequiresAllArgsAndThrowsArgc = 2;
    3089     v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[methodThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info) };
     3089    v8::Handle<v8::FunctionTemplate> methodThatRequiresAllArgsAndThrowsArgv[methodThatRequiresAllArgsAndThrowsArgc] = { v8::Handle<v8::FunctionTemplate>(), V8PerIsolateData::from(isolate)->rawTemplate(&V8TestObj::info, worldType) };
    30903090    v8::Handle<v8::Signature> methodThatRequiresAllArgsAndThrowsSignature = v8::Signature::New(desc, methodThatRequiresAllArgsAndThrowsArgc, methodThatRequiresAllArgsAndThrowsArgv);
    30913091    proto->Set(v8::String::NewSymbol("methodThatRequiresAllArgsAndThrows"), v8::FunctionTemplate::New(TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethodCallback, v8Undefined(), methodThatRequiresAllArgsAndThrowsSignature));
     
    31053105    // Custom Signature 'stringArrayFunction'
    31063106    const int stringArrayFunctionArgc = 1;
    3107     v8::Handle<v8::FunctionTemplate> stringArrayFunctionArgv[stringArrayFunctionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMString[]::info) };
     3107    v8::Handle<v8::FunctionTemplate> stringArrayFunctionArgv[stringArrayFunctionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMString[]::info, worldType) };
    31083108    v8::Handle<v8::Signature> stringArrayFunctionSignature = v8::Signature::New(desc, stringArrayFunctionArgc, stringArrayFunctionArgv);
    31093109    proto->Set(v8::String::NewSymbol("stringArrayFunction"), v8::FunctionTemplate::New(TestObjV8Internal::stringArrayFunctionMethodCallback, v8Undefined(), stringArrayFunctionSignature));
     
    31113111    // Custom Signature 'domStringListFunction'
    31123112    const int domStringListFunctionArgc = 1;
    3113     v8::Handle<v8::FunctionTemplate> domStringListFunctionArgv[domStringListFunctionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMStringList::info) };
     3113    v8::Handle<v8::FunctionTemplate> domStringListFunctionArgv[domStringListFunctionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMStringList::info, worldType) };
    31143114    v8::Handle<v8::Signature> domStringListFunctionSignature = v8::Signature::New(desc, domStringListFunctionArgc, domStringListFunctionArgv);
    31153115    proto->Set(v8::String::NewSymbol("domStringListFunction"), v8::FunctionTemplate::New(TestObjV8Internal::domStringListFunctionMethodCallback, v8Undefined(), domStringListFunctionSignature));
     
    31173117    // Custom Signature 'convert1'
    31183118    const int convert1Argc = 1;
    3119     v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8a::info) };
     3119    v8::Handle<v8::FunctionTemplate> convert1Argv[convert1Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8a::info, worldType) };
    31203120    v8::Handle<v8::Signature> convert1Signature = v8::Signature::New(desc, convert1Argc, convert1Argv);
    31213121    proto->Set(v8::String::NewSymbol("convert1"), v8::FunctionTemplate::New(TestObjV8Internal::convert1MethodCallback, v8Undefined(), convert1Signature));
     
    31233123    // Custom Signature 'convert2'
    31243124    const int convert2Argc = 1;
    3125     v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8b::info) };
     3125    v8::Handle<v8::FunctionTemplate> convert2Argv[convert2Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8b::info, worldType) };
    31263126    v8::Handle<v8::Signature> convert2Signature = v8::Signature::New(desc, convert2Argc, convert2Argv);
    31273127    proto->Set(v8::String::NewSymbol("convert2"), v8::FunctionTemplate::New(TestObjV8Internal::convert2MethodCallback, v8Undefined(), convert2Signature));
     
    31293129    // Custom Signature 'convert4'
    31303130    const int convert4Argc = 1;
    3131     v8::Handle<v8::FunctionTemplate> convert4Argv[convert4Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8d::info) };
     3131    v8::Handle<v8::FunctionTemplate> convert4Argv[convert4Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8d::info, worldType) };
    31323132    v8::Handle<v8::Signature> convert4Signature = v8::Signature::New(desc, convert4Argc, convert4Argv);
    31333133    proto->Set(v8::String::NewSymbol("convert4"), v8::FunctionTemplate::New(TestObjV8Internal::convert4MethodCallback, v8Undefined(), convert4Signature));
     
    31353135    // Custom Signature 'convert5'
    31363136    const int convert5Argc = 1;
    3137     v8::Handle<v8::FunctionTemplate> convert5Argv[convert5Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8e::info) };
     3137    v8::Handle<v8::FunctionTemplate> convert5Argv[convert5Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8e::info, worldType) };
    31383138    v8::Handle<v8::Signature> convert5Signature = v8::Signature::New(desc, convert5Argc, convert5Argv);
    31393139    proto->Set(v8::String::NewSymbol("convert5"), v8::FunctionTemplate::New(TestObjV8Internal::convert5MethodCallback, v8Undefined(), convert5Signature));
     
    31413141    // Custom Signature 'variadicNodeMethod'
    31423142    const int variadicNodeMethodArgc = 2;
    3143     v8::Handle<v8::FunctionTemplate> variadicNodeMethodArgv[variadicNodeMethodArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::info), V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::info) };
     3143    v8::Handle<v8::FunctionTemplate> variadicNodeMethodArgv[variadicNodeMethodArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::info, worldType), V8PerIsolateData::from(isolate)->rawTemplate(&V8Node::info, worldType) };
    31443144    v8::Handle<v8::Signature> variadicNodeMethodSignature = v8::Signature::New(desc, variadicNodeMethodArgc, variadicNodeMethodArgv);
    31453145    proto->Set(v8::String::NewSymbol("variadicNodeMethod"), v8::FunctionTemplate::New(TestObjV8Internal::variadicNodeMethodMethodCallback, v8Undefined(), variadicNodeMethodSignature));
     
    31543154{
    31553155    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    3156     V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    3157     if (result != data->templateMap().end())
     3156    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(worldType).find(&info);
     3157    if (result != data->templateMap(worldType).end())
    31583158        return result->value;
    31593159
    31603160    v8::HandleScope handleScope;
    31613161    v8::Persistent<v8::FunctionTemplate> templ =
    3162         ConfigureV8TestObjTemplate(data->rawTemplate(&info), isolate, worldType);
    3163     data->templateMap().add(&info, templ);
     3162        ConfigureV8TestObjTemplate(data->rawTemplate(&info, worldType), isolate, worldType);
     3163    data->templateMap(worldType).add(&info, templ);
    31643164    return templ;
    31653165}
    31663166
    3167 bool V8TestObj::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate)
    3168 {
    3169     return V8PerIsolateData::from(isolate)->hasInstance(&info, value);
     3167bool V8TestObj::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType worldType)
     3168{
     3169    return V8PerIsolateData::from(isolate)->hasInstance(&info, value, worldType);
    31703170}
    31713171
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.h

    r145575 r145802  
    3535public:
    3636    static const bool hasDependentLifetime = false;
    37     static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*);
     37    static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
    3838    static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
    3939    static TestObj* toNative(v8::Handle<v8::Object> object)
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestOverloadedConstructors.cpp

    r145575 r145802  
    7878static v8::Handle<v8::Value> constructor1(const v8::Arguments& args)
    7979{
    80     V8TRYCATCH(ArrayBuffer*, arrayBuffer, V8ArrayBuffer::HasInstance(args[0], args.GetIsolate()) ? V8ArrayBuffer::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     80    V8TRYCATCH(ArrayBuffer*, arrayBuffer, V8ArrayBuffer::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8ArrayBuffer::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    8181
    8282    RefPtr<TestOverloadedConstructors> impl = TestOverloadedConstructors::create(arrayBuffer);
     
    8989static v8::Handle<v8::Value> constructor2(const v8::Arguments& args)
    9090{
    91     V8TRYCATCH(ArrayBufferView*, arrayBufferView, V8ArrayBufferView::HasInstance(args[0], args.GetIsolate()) ? V8ArrayBufferView::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     91    V8TRYCATCH(ArrayBufferView*, arrayBufferView, V8ArrayBufferView::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8ArrayBufferView::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    9292
    9393    RefPtr<TestOverloadedConstructors> impl = TestOverloadedConstructors::create(arrayBufferView);
     
    100100static v8::Handle<v8::Value> constructor3(const v8::Arguments& args)
    101101{
    102     V8TRYCATCH(Blob*, blob, V8Blob::HasInstance(args[0], args.GetIsolate()) ? V8Blob::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
     102    V8TRYCATCH(Blob*, blob, V8Blob::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Blob::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
    103103
    104104    RefPtr<TestOverloadedConstructors> impl = TestOverloadedConstructors::create(blob);
     
    122122static v8::Handle<v8::Value> constructor(const v8::Arguments& args)
    123123{
    124     if ((args.Length() == 1 && (V8ArrayBuffer::HasInstance(args[0], args.GetIsolate()))))
     124    if ((args.Length() == 1 && (V8ArrayBuffer::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))))
    125125        return TestOverloadedConstructorsV8Internal::constructor1(args);
    126     if ((args.Length() == 1 && (V8ArrayBufferView::HasInstance(args[0], args.GetIsolate()))))
     126    if ((args.Length() == 1 && (V8ArrayBufferView::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))))
    127127        return TestOverloadedConstructorsV8Internal::constructor2(args);
    128     if ((args.Length() == 1 && (V8Blob::HasInstance(args[0], args.GetIsolate()))))
     128    if ((args.Length() == 1 && (V8Blob::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))))
    129129        return TestOverloadedConstructorsV8Internal::constructor3(args);
    130130    if (args.Length() == 1)
     
    168168{
    169169    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    170     V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    171     if (result != data->templateMap().end())
     170    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(worldType).find(&info);
     171    if (result != data->templateMap(worldType).end())
    172172        return result->value;
    173173
    174174    v8::HandleScope handleScope;
    175175    v8::Persistent<v8::FunctionTemplate> templ =
    176         ConfigureV8TestOverloadedConstructorsTemplate(data->rawTemplate(&info), isolate, worldType);
    177     data->templateMap().add(&info, templ);
     176        ConfigureV8TestOverloadedConstructorsTemplate(data->rawTemplate(&info, worldType), isolate, worldType);
     177    data->templateMap(worldType).add(&info, templ);
    178178    return templ;
    179179}
    180180
    181 bool V8TestOverloadedConstructors::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate)
    182 {
    183     return V8PerIsolateData::from(isolate)->hasInstance(&info, value);
     181bool V8TestOverloadedConstructors::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType worldType)
     182{
     183    return V8PerIsolateData::from(isolate)->hasInstance(&info, value, worldType);
    184184}
    185185
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestOverloadedConstructors.h

    r145575 r145802  
    3535public:
    3636    static const bool hasDependentLifetime = false;
    37     static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*);
     37    static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
    3838    static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
    3939    static TestOverloadedConstructors* toNative(v8::Handle<v8::Object> object)
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp

    r145575 r145802  
    333333{
    334334    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    335     V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    336     if (result != data->templateMap().end())
     335    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(worldType).find(&info);
     336    if (result != data->templateMap(worldType).end())
    337337        return result->value;
    338338
    339339    v8::HandleScope handleScope;
    340340    v8::Persistent<v8::FunctionTemplate> templ =
    341         ConfigureV8TestSerializedScriptValueInterfaceTemplate(data->rawTemplate(&info), isolate, worldType);
    342     data->templateMap().add(&info, templ);
     341        ConfigureV8TestSerializedScriptValueInterfaceTemplate(data->rawTemplate(&info, worldType), isolate, worldType);
     342    data->templateMap(worldType).add(&info, templ);
    343343    return templ;
    344344}
    345345
    346 bool V8TestSerializedScriptValueInterface::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate)
    347 {
    348     return V8PerIsolateData::from(isolate)->hasInstance(&info, value);
     346bool V8TestSerializedScriptValueInterface::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType worldType)
     347{
     348    return V8PerIsolateData::from(isolate)->hasInstance(&info, value, worldType);
    349349}
    350350
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.h

    r145575 r145802  
    3636public:
    3737    static const bool hasDependentLifetime = false;
    38     static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*);
     38    static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
    3939    static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
    4040    static TestSerializedScriptValueInterface* toNative(v8::Handle<v8::Object> object)
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestTypedefs.cpp

    r145575 r145802  
    265265        return v8Undefined();
    266266    }
    267     if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8long[]::HasInstance(args[0], args.GetIsolate()))
     267    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8long[]::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))
    268268        return throwTypeError(0, args.GetIsolate());
    269269    V8TRYCATCH(Vector<int>, x, toNativeArray<int>(args[0]));
     
    552552    // Custom Signature 'methodWithSequenceArg'
    553553    const int methodWithSequenceArgArgc = 1;
    554     v8::Handle<v8::FunctionTemplate> methodWithSequenceArgArgv[methodWithSequenceArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8sequence<SerializedScriptValue>::info) };
     554    v8::Handle<v8::FunctionTemplate> methodWithSequenceArgArgv[methodWithSequenceArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8sequence<SerializedScriptValue>::info, worldType) };
    555555    v8::Handle<v8::Signature> methodWithSequenceArgSignature = v8::Signature::New(desc, methodWithSequenceArgArgc, methodWithSequenceArgArgv);
    556556    proto->Set(v8::String::NewSymbol("methodWithSequenceArg"), v8::FunctionTemplate::New(TestTypedefsV8Internal::methodWithSequenceArgMethodCallback, v8Undefined(), methodWithSequenceArgSignature));
     
    558558    // Custom Signature 'nullableArrayArg'
    559559    const int nullableArrayArgArgc = 1;
    560     v8::Handle<v8::FunctionTemplate> nullableArrayArgArgv[nullableArrayArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMString[]::info) };
     560    v8::Handle<v8::FunctionTemplate> nullableArrayArgArgv[nullableArrayArgArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMString[]::info, worldType) };
    561561    v8::Handle<v8::Signature> nullableArrayArgSignature = v8::Signature::New(desc, nullableArrayArgArgc, nullableArrayArgArgv);
    562562    proto->Set(v8::String::NewSymbol("nullableArrayArg"), v8::FunctionTemplate::New(TestTypedefsV8Internal::nullableArrayArgMethodCallback, v8Undefined(), nullableArrayArgSignature));
     
    564564    // Custom Signature 'stringArrayFunction'
    565565    const int stringArrayFunctionArgc = 1;
    566     v8::Handle<v8::FunctionTemplate> stringArrayFunctionArgv[stringArrayFunctionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMString[]::info) };
     566    v8::Handle<v8::FunctionTemplate> stringArrayFunctionArgv[stringArrayFunctionArgc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMString[]::info, worldType) };
    567567    v8::Handle<v8::Signature> stringArrayFunctionSignature = v8::Signature::New(desc, stringArrayFunctionArgc, stringArrayFunctionArgv);
    568568    proto->Set(v8::String::NewSymbol("stringArrayFunction"), v8::FunctionTemplate::New(TestTypedefsV8Internal::stringArrayFunctionMethodCallback, v8Undefined(), stringArrayFunctionSignature));
     
    570570    // Custom Signature 'stringArrayFunction2'
    571571    const int stringArrayFunction2Argc = 1;
    572     v8::Handle<v8::FunctionTemplate> stringArrayFunction2Argv[stringArrayFunction2Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMString[]::info) };
     572    v8::Handle<v8::FunctionTemplate> stringArrayFunction2Argv[stringArrayFunction2Argc] = { V8PerIsolateData::from(isolate)->rawTemplate(&V8DOMString[]::info, worldType) };
    573573    v8::Handle<v8::Signature> stringArrayFunction2Signature = v8::Signature::New(desc, stringArrayFunction2Argc, stringArrayFunction2Argv);
    574574    proto->Set(v8::String::NewSymbol("stringArrayFunction2"), v8::FunctionTemplate::New(TestTypedefsV8Internal::stringArrayFunction2MethodCallback, v8Undefined(), stringArrayFunction2Signature));
     
    582582{
    583583    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    584     V8PerIsolateData::TemplateMap::iterator result = data->templateMap().find(&info);
    585     if (result != data->templateMap().end())
     584    V8PerIsolateData::TemplateMap::iterator result = data->templateMap(worldType).find(&info);
     585    if (result != data->templateMap(worldType).end())
    586586        return result->value;
    587587
    588588    v8::HandleScope handleScope;
    589589    v8::Persistent<v8::FunctionTemplate> templ =
    590         ConfigureV8TestTypedefsTemplate(data->rawTemplate(&info), isolate, worldType);
    591     data->templateMap().add(&info, templ);
     590        ConfigureV8TestTypedefsTemplate(data->rawTemplate(&info, worldType), isolate, worldType);
     591    data->templateMap(worldType).add(&info, templ);
    592592    return templ;
    593593}
    594594
    595 bool V8TestTypedefs::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate)
    596 {
    597     return V8PerIsolateData::from(isolate)->hasInstance(&info, value);
     595bool V8TestTypedefs::HasInstance(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType worldType)
     596{
     597    return V8PerIsolateData::from(isolate)->hasInstance(&info, value, worldType);
    598598}
    599599
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestTypedefs.h

    r145575 r145802  
    3535public:
    3636    static const bool hasDependentLifetime = false;
    37     static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*);
     37    static bool HasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldType);
    3838    static v8::Persistent<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWorldType);
    3939    static TestTypedefs* toNative(v8::Handle<v8::Object> object)
  • trunk/Source/WebCore/bindings/v8/Dictionary.cpp

    r145787 r145802  
    280280
    281281    value = 0;
    282     if (V8Storage::HasInstance(v8Value, m_isolate))
     282    if (V8Storage::HasInstance(v8Value, m_isolate, worldType(m_isolate)))
    283283        value = V8Storage::toNative(v8::Handle<v8::Object>::Cast(v8Value));
    284284    return true;
     
    338338
    339339    value = 0;
    340     if (V8Uint8Array::HasInstance(v8Value, m_isolate))
     340    if (V8Uint8Array::HasInstance(v8Value, m_isolate, worldType(m_isolate)))
    341341        value = V8Uint8Array::toNative(v8::Handle<v8::Object>::Cast(v8Value));
    342342    return true;
     
    351351
    352352    value = 0;
    353     if (V8MediaKeyError::HasInstance(v8Value, m_isolate))
     353    if (V8MediaKeyError::HasInstance(v8Value, m_isolate, worldType(m_isolate)))
    354354        value = V8MediaKeyError::toNative(v8::Handle<v8::Object>::Cast(v8Value));
    355355    return true;
     
    387387
    388388    value = 0;
    389     if (V8SpeechRecognitionError::HasInstance(v8Value, m_isolate))
     389    if (V8SpeechRecognitionError::HasInstance(v8Value, m_isolate, worldType(m_isolate)))
    390390        value = V8SpeechRecognitionError::toNative(v8::Handle<v8::Object>::Cast(v8Value));
    391391    return true;
     
    399399
    400400    value = 0;
    401     if (V8SpeechRecognitionResult::HasInstance(v8Value, m_isolate))
     401    if (V8SpeechRecognitionResult::HasInstance(v8Value, m_isolate, worldType(m_isolate)))
    402402        value = V8SpeechRecognitionResult::toNative(v8::Handle<v8::Object>::Cast(v8Value));
    403403    return true;
     
    411411
    412412    value = 0;
    413     if (V8SpeechRecognitionResultList::HasInstance(v8Value, m_isolate))
     413    if (V8SpeechRecognitionResultList::HasInstance(v8Value, m_isolate, worldType(m_isolate)))
    414414        value = V8SpeechRecognitionResultList::toNative(v8::Handle<v8::Object>::Cast(v8Value));
    415415    return true;
     
    426426
    427427    value = 0;
    428     if (V8MediaStream::HasInstance(v8Value, m_isolate))
     428    if (V8MediaStream::HasInstance(v8Value, m_isolate, worldType(m_isolate)))
    429429        value = V8MediaStream::toNative(v8::Handle<v8::Object>::Cast(v8Value));
    430430    return true;
  • trunk/Source/WebCore/bindings/v8/ScriptProfiler.cpp

    r141946 r145802  
    236236                return;
    237237            UNUSED_PARAM(m_isolate);
    238             ASSERT(V8Node::HasInstance(value, m_isolate));
     238            ASSERT(V8Node::HasInstance(value, m_isolate, worldType(m_isolate)));
    239239            ASSERT(value->IsObject());
    240240            v8::Persistent<v8::Object> wrapper = v8::Persistent<v8::Object>::Cast(value);
  • trunk/Source/WebCore/bindings/v8/SerializedScriptValue.cpp

    r141816 r145802  
    12521252    uint32_t objectReference;
    12531253    uint32_t arrayBufferIndex;
     1254    WrapperWorldType currentWorldType = worldType(m_isolate);
    12541255    if ((value->IsObject() || value->IsDate() || value->IsRegExp())
    12551256        && m_objectPool.tryGet(value.As<v8::Object>(), &objectReference)) {
     
    12741275    else if (value->IsNumber())
    12751276        m_writer.writeNumber(value.As<v8::Number>()->Value());
    1276     else if (V8ArrayBufferView::HasInstance(value, m_isolate))
     1277    else if (V8ArrayBufferView::HasInstance(value, m_isolate, currentWorldType))
    12771278        return writeAndGreyArrayBufferView(value.As<v8::Object>(), next);
    12781279    else if (value->IsString())
    12791280        writeString(value);
    1280     else if (V8MessagePort::HasInstance(value, m_isolate)) {
     1281    else if (V8MessagePort::HasInstance(value, m_isolate, currentWorldType)) {
    12811282        uint32_t messagePortIndex;
    12821283        if (m_transferredMessagePorts.tryGet(value.As<v8::Object>(), &messagePortIndex))
     
    12841285            else
    12851286                return handleError(DataCloneError, next);
    1286     } else if (V8ArrayBuffer::HasInstance(value, m_isolate) && m_transferredArrayBuffers.tryGet(value.As<v8::Object>(), &arrayBufferIndex))
     1287    } else if (V8ArrayBuffer::HasInstance(value, m_isolate, currentWorldType) && m_transferredArrayBuffers.tryGet(value.As<v8::Object>(), &arrayBufferIndex))
    12871288        return writeTransferredArrayBuffer(value, arrayBufferIndex, next);
    12881289    else {
     
    13011302        else if (value->IsArray()) {
    13021303            return startArrayState(value.As<v8::Array>(), next);
    1303         } else if (V8File::HasInstance(value, m_isolate))
     1304        } else if (V8File::HasInstance(value, m_isolate, currentWorldType))
    13041305            writeFile(value);
    1305         else if (V8Blob::HasInstance(value, m_isolate))
     1306        else if (V8Blob::HasInstance(value, m_isolate, currentWorldType))
    13061307            writeBlob(value);
    13071308#if ENABLE(FILE_SYSTEM)
    1308         else if (V8DOMFileSystem::HasInstance(value, m_isolate))
     1309        else if (V8DOMFileSystem::HasInstance(value, m_isolate, currentWorldType))
    13091310            return writeDOMFileSystem(value, next);
    13101311#endif
    1311         else if (V8FileList::HasInstance(value, m_isolate))
     1312        else if (V8FileList::HasInstance(value, m_isolate, currentWorldType))
    13121313            writeFileList(value);
    1313         else if (V8ImageData::HasInstance(value, m_isolate))
     1314        else if (V8ImageData::HasInstance(value, m_isolate, currentWorldType))
    13141315            writeImageData(value);
    13151316        else if (value->IsRegExp())
    13161317            writeRegExp(value);
    1317         else if (V8ArrayBuffer::HasInstance(value, m_isolate))
     1318        else if (V8ArrayBuffer::HasInstance(value, m_isolate, currentWorldType))
    13181319            return writeArrayBuffer(value, next);
    13191320        else if (value->IsObject()) {
  • trunk/Source/WebCore/bindings/v8/V8AdaptorFunction.cpp

    r145575 r145802  
    4545    ASSERT(isolate);
    4646    V8PerIsolateData* data = V8PerIsolateData::from(isolate);
    47     V8PerIsolateData::TemplateMap::iterator result = data->rawTemplateMap().find(&info);
    48     if (result != data->rawTemplateMap().end())
     47    V8PerIsolateData::TemplateMap::iterator result = data->rawTemplateMap(worldType).find(&info);
     48    if (result != data->rawTemplateMap(worldType).end())
    4949        return result->value;
    5050    // The lifetime is of newTemplate is delegated to the TemplateMap thus this won't be leaked.
    5151    v8::Persistent<v8::FunctionTemplate> newTemplate = v8::Persistent<v8::FunctionTemplate>::New(isolate, v8::FunctionTemplate::New());
    52     data->rawTemplateMap().add(&info, configureTemplate(newTemplate));
     52    data->rawTemplateMap(worldType).add(&info, configureTemplate(newTemplate));
    5353    return newTemplate;
    5454}
  • trunk/Source/WebCore/bindings/v8/V8Binding.cpp

    r145745 r145802  
    186186    v8::Local<v8::Value> v8Value(v8::Local<v8::Value>::New(value));
    187187
    188     if (V8DOMStringList::HasInstance(v8Value, isolate)) {
     188    if (V8DOMStringList::HasInstance(v8Value, isolate, worldType(isolate))) {
    189189        RefPtr<DOMStringList> ret = V8DOMStringList::toNative(v8::Handle<v8::Object>::Cast(v8Value));
    190190        return ret.release();
     
    206206{
    207207    RefPtr<XPathNSResolver> resolver;
    208     if (V8XPathNSResolver::HasInstance(value, isolate))
     208    if (V8XPathNSResolver::HasInstance(value, isolate, worldType(isolate)))
    209209        resolver = V8XPathNSResolver::toNative(v8::Handle<v8::Object>::Cast(value));
    210210    else if (value->IsObject())
  • trunk/Source/WebCore/bindings/v8/V8Binding.h

    r144617 r145802  
    276276    }
    277277
     278    WrapperWorldType worldType(v8::Isolate*);
     279    WrapperWorldType worldTypeInMainThread(v8::Isolate*);
     280
    278281    template<class T> struct NativeValueTraits;
    279282
     
    323326            v8::Handle<v8::Value> element = array->Get(i);
    324327
    325             if (V8T::HasInstance(element, isolate)) {
     328            if (V8T::HasInstance(element, isolate, worldType(isolate))) {
    326329                v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(element);
    327330                result.append(V8T::toNative(object));
     
    468471    void crashIfV8IsDead();
    469472
    470     WrapperWorldType worldType(v8::Isolate*);
    471     WrapperWorldType worldTypeInMainThread(v8::Isolate*);
    472 
    473473} // namespace WebCore
    474474
  • trunk/Source/WebCore/bindings/v8/V8Collection.cpp

    r141721 r145802  
    4848
    4949    // Check that the value is an HTMLOptionElement.  If not, throw a TYPE_MISMATCH_ERR DOMException.
    50     if (!V8HTMLOptionElement::HasInstance(value, isolate)) {
     50    if (!V8HTMLOptionElement::HasInstance(value, isolate, worldType(isolate))) {
    5151        setDOMException(TYPE_MISMATCH_ERR, isolate);
    5252        return value;
  • trunk/Source/WebCore/bindings/v8/V8GCController.cpp

    r145575 r145802  
    304304        v8::Persistent<v8::Object> wrapper = v8::Persistent<v8::Object>::Cast(value);
    305305        ASSERT(V8DOMWrapper::maybeDOMWrapper(value));
    306         ASSERT(V8Node::HasInstance(wrapper, m_isolate));
     306        ASSERT(V8Node::HasInstance(wrapper, m_isolate, MainWorld) || V8Node::HasInstance(wrapper, m_isolate, IsolatedWorld));
    307307        Node* node = V8Node::toNative(wrapper);
    308308        // A minor DOM GC can handle only node wrappers in the main world.
     
    377377        if (classId == v8DOMNodeClassId) {
    378378            UNUSED_PARAM(m_isolate);
    379             ASSERT(V8Node::HasInstance(wrapper, m_isolate));
     379            ASSERT(V8Node::HasInstance(wrapper, m_isolate, MainWorld) || V8Node::HasInstance(wrapper, m_isolate, IsolatedWorld));
    380380            ASSERT(!wrapper.IsIndependent(m_isolate));
    381381
  • trunk/Source/WebCore/bindings/v8/V8NPObject.cpp

    r142250 r145802  
    7070    NPObject* npObject;
    7171
     72    WrapperWorldType currentWorldType = worldType(args.GetIsolate());
    7273    // These three types are subtypes of HTMLPlugInElement.
    73     if (V8HTMLAppletElement::HasInstance(args.Holder(), args.GetIsolate()) || V8HTMLEmbedElement::HasInstance(args.Holder(), args.GetIsolate())
    74         || V8HTMLObjectElement::HasInstance(args.Holder(), args.GetIsolate())) {
     74    if (V8HTMLAppletElement::HasInstance(args.Holder(), args.GetIsolate(), currentWorldType) || V8HTMLEmbedElement::HasInstance(args.Holder(), args.GetIsolate(), currentWorldType)
     75        || V8HTMLObjectElement::HasInstance(args.Holder(), args.GetIsolate(), currentWorldType)) {
    7576        // The holder object is a subtype of HTMLPlugInElement.
    7677        HTMLPlugInElement* element;
    77         if (V8HTMLAppletElement::HasInstance(args.Holder(), args.GetIsolate()))
     78        if (V8HTMLAppletElement::HasInstance(args.Holder(), args.GetIsolate(), currentWorldType))
    7879            element = V8HTMLAppletElement::toNative(args.Holder());
    79         else if (V8HTMLEmbedElement::HasInstance(args.Holder(), args.GetIsolate()))
     80        else if (V8HTMLEmbedElement::HasInstance(args.Holder(), args.GetIsolate(), currentWorldType))
    8081            element = V8HTMLEmbedElement::toNative(args.Holder());
    8182        else
  • trunk/Source/WebCore/bindings/v8/V8PerIsolateData.cpp

    r145765 r145802  
    105105{
    106106    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::Binding);
    107     info.addMember(m_rawTemplates, "rawTemplates");
    108     info.addMember(m_templates, "templates");
     107    info.addMember(m_rawTemplatesForMainWorld, "rawTemplatesForMainWorld");
     108    info.addMember(m_rawTemplatesForNonMainWorld, "rawTemplatesForNonMainWorld");
     109    info.addMember(m_templatesForMainWorld, "templatesForMainWorld");
     110    info.addMember(m_templatesForNonMainWorld, "templatesForNonMainWorld");
    109111    info.addMember(m_stringCache, "stringCache");
    110112    info.addMember(m_integerCache, "integerCache");
     
    123125}
    124126
    125 bool V8PerIsolateData::hasPrivateTemplate(WrapperWorldType, void* privatePointer)
    126 {
    127     return m_templates.find(privatePointer) != m_templates.end();
    128 }
    129 
    130 v8::Persistent<v8::FunctionTemplate> V8PerIsolateData::privateTemplate(WrapperWorldType, void* privatePointer, v8::InvocationCallback callback, v8::Handle<v8::Value> data, v8::Handle<v8::Signature> signature, int length)
     127bool V8PerIsolateData::hasPrivateTemplate(WrapperWorldType currentWorldType, void* privatePointer)
     128{
     129    if (currentWorldType == MainWorld)
     130        return m_templatesForMainWorld.find(privatePointer) != m_templatesForMainWorld.end();
     131    return m_templatesForNonMainWorld.find(privatePointer) != m_templatesForNonMainWorld.end();
     132}
     133
     134v8::Persistent<v8::FunctionTemplate> V8PerIsolateData::privateTemplate(WrapperWorldType currentWorldType, void* privatePointer, v8::InvocationCallback callback, v8::Handle<v8::Value> data, v8::Handle<v8::Signature> signature, int length)
    131135{
    132136    v8::Persistent<v8::FunctionTemplate> privateTemplate;
    133     V8PerIsolateData::TemplateMap::iterator result = m_templates.find(privatePointer);
    134     if (result != m_templates.end())
     137    TemplateMap& templates = templateMap(currentWorldType);
     138    TemplateMap::iterator result = templates.find(privatePointer);
     139    if (result != templates.end())
    135140        return result->value;
    136141    v8::Persistent<v8::FunctionTemplate> newPrivateTemplate = v8::Persistent<v8::FunctionTemplate>::New(m_isolate, v8::FunctionTemplate::New(callback, data, signature, length));
    137     m_templates.add(privatePointer, newPrivateTemplate);
     142    templates.add(privatePointer, newPrivateTemplate);
    138143    return newPrivateTemplate;
    139144}
    140145
    141 v8::Persistent<v8::FunctionTemplate> V8PerIsolateData::rawTemplate(WrapperTypeInfo* info)
    142 {
    143     TemplateMap::iterator result = m_rawTemplates.find(info);
    144     if (result != m_rawTemplates.end())
     146v8::Persistent<v8::FunctionTemplate> V8PerIsolateData::rawTemplate(WrapperTypeInfo* info, WrapperWorldType currentWorldType)
     147{
     148    TemplateMap& templates = rawTemplateMap(currentWorldType);
     149    TemplateMap::iterator result = templates.find(info);
     150    if (result != templates.end())
    145151        return result->value;
    146152
    147153    v8::HandleScope handleScope;
    148154    v8::Persistent<v8::FunctionTemplate> templ = createRawTemplate(m_isolate);
    149     m_rawTemplates.add(info, templ);
     155    templates.add(info, templ);
    150156    return templ;
    151157}
    152158
    153 bool V8PerIsolateData::hasInstance(WrapperTypeInfo* info, v8::Handle<v8::Value> value)
    154 {
    155     return rawTemplate(info)->HasInstance(value);
     159bool V8PerIsolateData::hasInstance(WrapperTypeInfo* info, v8::Handle<v8::Value> value, WrapperWorldType currentWorldType)
     160{
     161    TemplateMap& templates = rawTemplateMap(currentWorldType);
     162    TemplateMap::iterator result = templates.find(info);
     163    if (result == templates.end())
     164        return false;
     165    return result->value->HasInstance(value);
    156166}
    157167
  • trunk/Source/WebCore/bindings/v8/V8PerIsolateData.h

    r145765 r145802  
    6868    typedef HashMap<void*, v8::Persistent<v8::FunctionTemplate> > TemplateMap;
    6969
    70     TemplateMap& rawTemplateMap() { return m_rawTemplates; }
    71     TemplateMap& templateMap() { return m_templates; }
     70    TemplateMap& rawTemplateMap(WrapperWorldType worldType)
     71    {
     72        if (worldType == MainWorld)
     73            return m_rawTemplatesForMainWorld;
     74        return m_rawTemplatesForNonMainWorld;
     75    }
     76
     77    TemplateMap& templateMap(WrapperWorldType worldType)
     78    {
     79        if (worldType == MainWorld)
     80            return m_templatesForMainWorld;
     81        return m_templatesForNonMainWorld;
     82    }
    7283
    7384    v8::Handle<v8::FunctionTemplate> toStringTemplate();
     
    132143    v8::Persistent<v8::FunctionTemplate> privateTemplate(WrapperWorldType, void* privatePointer, v8::InvocationCallback, v8::Handle<v8::Value> data, v8::Handle<v8::Signature>, int length = 0);
    133144
    134     v8::Persistent<v8::FunctionTemplate> rawTemplate(WrapperTypeInfo*);
     145    v8::Persistent<v8::FunctionTemplate> rawTemplate(WrapperTypeInfo*, WrapperWorldType);
    135146
    136     bool hasInstance(WrapperTypeInfo*, v8::Handle<v8::Value>);
     147    bool hasInstance(WrapperTypeInfo*, v8::Handle<v8::Value>, WrapperWorldType);
    137148
    138149private:
     
    142153
    143154    v8::Isolate* m_isolate;
    144     TemplateMap m_rawTemplates;
    145     TemplateMap m_templates;
     155    TemplateMap m_rawTemplatesForMainWorld;
     156    TemplateMap m_rawTemplatesForNonMainWorld;
     157    TemplateMap m_templatesForMainWorld;
     158    TemplateMap m_templatesForNonMainWorld;
    146159    ScopedPersistent<v8::FunctionTemplate> m_toStringTemplate;
    147160    v8::Persistent<v8::FunctionTemplate> m_lazyEventListenerToStringTemplate;
  • trunk/Source/WebCore/bindings/v8/V8Utilities.cpp

    r141946 r145802  
    9191        }
    9292        // Validation of Objects implementing an interface, per WebIDL spec 4.1.15.
    93         if (V8MessagePort::HasInstance(transferrable, isolate)) {
     93        if (V8MessagePort::HasInstance(transferrable, isolate, worldType(isolate))) {
    9494            RefPtr<MessagePort> port = V8MessagePort::toNative(v8::Handle<v8::Object>::Cast(transferrable));
    9595            // Check for duplicate MessagePorts.
     
    9999            }
    100100            ports.append(port.release());
    101         } else if (V8ArrayBuffer::HasInstance(transferrable, isolate))
     101        } else if (V8ArrayBuffer::HasInstance(transferrable, isolate, worldType(isolate)))
    102102            arrayBuffers.append(V8ArrayBuffer::toNative(v8::Handle<v8::Object>::Cast(transferrable)));
    103103        else {
  • trunk/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h

    r142159 r145802  
    139139
    140140    // See whether the first argument is a ArrayBuffer.
    141     if (V8ArrayBuffer::HasInstance(args[0], args.GetIsolate()))
     141    if (V8ArrayBuffer::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))
    142142      return constructWebGLArrayWithArrayBufferArgument<ArrayClass, ElementType>(args, type, arrayType, true);
    143143
    144144    // See whether the first argument is the same type as impl. In that case,
    145145    // we can simply memcpy data from source to impl.
    146     if (JavaScriptWrapperArrayType::HasInstance(args[0], args.GetIsolate())) {
     146    if (JavaScriptWrapperArrayType::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate()))) {
    147147        ArrayClass* source = JavaScriptWrapperArrayType::toNative(args[0]->ToObject());
    148148        uint32_t length = source->length();
     
    237237    CPlusPlusArrayType* impl = JavaScriptWrapperArrayType::toNative(args.Holder());
    238238
    239     if (JavaScriptWrapperArrayType::HasInstance(args[0], args.GetIsolate())) {
     239    if (JavaScriptWrapperArrayType::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate()))) {
    240240        // void set(in WebGL<T>Array array, [Optional] in unsigned long offset);
    241241        CPlusPlusArrayType* src = JavaScriptWrapperArrayType::toNative(args[0]->ToObject());
  • trunk/Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp

    r142834 r145802  
    4343
    4444    AudioBuffer* buffer = 0;
    45     if (V8AudioBuffer::HasInstance(value, info.GetIsolate())) {
     45    if (V8AudioBuffer::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate()))) {
    4646        buffer = V8AudioBuffer::toNative(value->ToObject());
    4747        if (buffer && !imp->setBuffer(buffer)) {
  • trunk/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp

    r143851 r145802  
    9898        ASSERT(!item.IsEmpty());
    9999#if ENABLE(BLOB)
    100         if (V8ArrayBuffer::HasInstance(item, args.GetIsolate())) {
     100        if (V8ArrayBuffer::HasInstance(item, args.GetIsolate(), worldType(args.GetIsolate()))) {
    101101            ArrayBuffer* arrayBuffer = V8ArrayBuffer::toNative(v8::Handle<v8::Object>::Cast(item));
    102102            ASSERT(arrayBuffer);
    103103            blobBuilder.append(context, arrayBuffer);
    104         } else if (V8ArrayBufferView::HasInstance(item, args.GetIsolate())) {
     104        } else if (V8ArrayBufferView::HasInstance(item, args.GetIsolate(), worldType(args.GetIsolate()))) {
    105105            ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(v8::Handle<v8::Object>::Cast(item));
    106106            ASSERT(arrayBufferView);
     
    108108        } else
    109109#endif
    110         if (V8Blob::HasInstance(item, args.GetIsolate())) {
     110        if (V8Blob::HasInstance(item, args.GetIsolate(), worldType(args.GetIsolate()))) {
    111111            Blob* blob = V8Blob::toNative(v8::Handle<v8::Object>::Cast(item));
    112112            ASSERT(blob);
  • trunk/Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp

    r142834 r145802  
    6262static PassRefPtr<CanvasStyle> toCanvasStyle(v8::Handle<v8::Value> value, v8::Isolate* isolate)
    6363{
    64     if (V8CanvasGradient::HasInstance(value, isolate))
     64    if (V8CanvasGradient::HasInstance(value, isolate, worldType(isolate)))
    6565        return CanvasStyle::createFromGradient(V8CanvasGradient::toNative(v8::Handle<v8::Object>::Cast(value)));
    6666
    67     if (V8CanvasPattern::HasInstance(value, isolate))
     67    if (V8CanvasPattern::HasInstance(value, isolate, worldType(isolate)))
    6868        return CanvasStyle::createFromPattern(V8CanvasPattern::toNative(v8::Handle<v8::Object>::Cast(value)));
    6969
  • trunk/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp

    r143850 r145802  
    9292
    9393    Node* node = 0;
    94     if (V8Node::HasInstance(args[0], args.GetIsolate()))
     94    if (V8Node::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))
    9595        node = V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0]));
    9696
  • trunk/Source/WebCore/bindings/v8/custom/V8CryptoCustom.cpp

    r143850 r145802  
    4242
    4343    v8::Handle<v8::Value> buffer = args[0];
    44     if (!V8ArrayBufferView::HasInstance(buffer, args.GetIsolate()))
     44    if (!V8ArrayBufferView::HasInstance(buffer, args.GetIsolate(), worldType(args.GetIsolate())))
    4545        return throwTypeError("First argument is not an ArrayBufferView", args.GetIsolate());
    4646
  • trunk/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp

    r143851 r145802  
    4343{
    4444    HTMLFormElement* form = 0;
    45     if (args.Length() > 0 && V8HTMLFormElement::HasInstance(args[0], args.GetIsolate()))
     45    if (args.Length() > 0 && V8HTMLFormElement::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))
    4646        form = V8HTMLFormElement::toNative(args[0]->ToObject());
    4747    RefPtr<DOMFormData> domFormData = DOMFormData::create(form);
     
    6262
    6363    v8::Handle<v8::Value> arg = args[1];
    64     if (V8Blob::HasInstance(arg, args.GetIsolate())) {
     64    if (V8Blob::HasInstance(arg, args.GetIsolate(), worldType(args.GetIsolate()))) {
    6565        v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
    6666        Blob* blob = V8Blob::toNative(object);
  • trunk/Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp

    r143851 r145802  
    4343        return wrapper;
    4444    }
    45     if (args[0]->IsNull() || !V8ArrayBuffer::HasInstance(args[0], args.GetIsolate()))
     45    if (args[0]->IsNull() || !V8ArrayBuffer::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))
    4646        return throwTypeError(0, args.GetIsolate());
    4747    return constructWebGLArrayWithArrayBufferArgument<DataView, char>(args, &info, v8::kExternalByteArray, false);
  • trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp

    r145745 r145802  
    7171    String expression = toWebCoreString(args[0]);
    7272    RefPtr<Node> contextNode;
    73     if (V8Node::HasInstance(args[1], args.GetIsolate()))
     73    if (V8Node::HasInstance(args[1], args.GetIsolate(), worldType(args.GetIsolate())))
    7474        contextNode = V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1]));
    7575
     
    8080    int type = toInt32(args[3]);
    8181    RefPtr<XPathResult> inResult;
    82     if (V8XPathResult::HasInstance(args[4], args.GetIsolate()))
     82    if (V8XPathResult::HasInstance(args[4], args.GetIsolate(), worldType(args.GetIsolate())))
    8383        inResult = V8XPathResult::toNative(v8::Handle<v8::Object>::Cast(args[4]));
    8484
  • trunk/Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp

    r142834 r145802  
    3838    HTMLMediaElement* imp = V8HTMLMediaElement::toNative(info.Holder());
    3939    MediaController* controller = 0;
    40     if (V8MediaController::HasInstance(value, info.GetIsolate()))
     40    if (V8MediaController::HasInstance(value, info.GetIsolate(), worldType(info.GetIsolate())))
    4141        controller = V8MediaController::toNative(value->ToObject());
    4242   
     
    5656
    5757#endif
    58 
  • trunk/Source/WebCore/bindings/v8/custom/V8HTMLOptionsCollectionCustom.cpp

    r145444 r145802  
    9292v8::Handle<v8::Value> V8HTMLOptionsCollection::addMethodCustom(const v8::Arguments& args)
    9393{
    94     if (!V8HTMLOptionElement::HasInstance(args[0], args.GetIsolate()))
     94    if (!V8HTMLOptionElement::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))
    9595        return setDOMException(TYPE_MISMATCH_ERR, args.GetIsolate());
    9696    HTMLOptionsCollection* imp = V8HTMLOptionsCollection::toNative(args.Holder());
  • trunk/Source/WebCore/bindings/v8/custom/V8HTMLSelectElementCustom.cpp

    r143850 r145802  
    7171v8::Handle<v8::Value> removeElement(HTMLSelectElement* imp, const v8::Arguments& args)
    7272{
    73     if (V8HTMLOptionElement::HasInstance(args[0], args.GetIsolate())) {
     73    if (V8HTMLOptionElement::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate()))) {
    7474        HTMLOptionElement* element = V8HTMLOptionElement::toNative(v8::Handle<v8::Object>::Cast(args[0]));
    7575        imp->remove(element->index());
  • trunk/Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp

    r144950 r145802  
    113113
    114114    v8::HandleScope handleScope;
    115     return v8::Boolean::New(V8HTMLAllCollection::HasInstance(args[0], args.GetIsolate()));
     115    return v8::Boolean::New(V8HTMLAllCollection::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())));
    116116}
    117117
     
    134134    if (value->IsRegExp())
    135135        return v8::String::NewSymbol("regexp");
    136     if (V8Node::HasInstance(value, args.GetIsolate()))
     136    WrapperWorldType currentWorldType = worldType(args.GetIsolate());
     137    if (V8Node::HasInstance(value, args.GetIsolate(), currentWorldType))
    137138        return v8::String::NewSymbol("node");
    138     if (V8NodeList::HasInstance(value, args.GetIsolate()))
    139         return v8::String::NewSymbol("array");
    140     if (V8HTMLCollection::HasInstance(value, args.GetIsolate()))
    141         return v8::String::NewSymbol("array");
    142     if (V8Int8Array::HasInstance(value, args.GetIsolate()) || V8Int16Array::HasInstance(value, args.GetIsolate()) || V8Int32Array::HasInstance(value, args.GetIsolate()))
    143         return v8::String::NewSymbol("array");
    144     if (V8Uint8Array::HasInstance(value, args.GetIsolate()) || V8Uint16Array::HasInstance(value, args.GetIsolate()) || V8Uint32Array::HasInstance(value, args.GetIsolate()))
    145         return v8::String::NewSymbol("array");
    146     if (V8Float32Array::HasInstance(value, args.GetIsolate()) || V8Float64Array::HasInstance(value, args.GetIsolate()))
    147         return v8::String::NewSymbol("array");
    148     if (V8Uint8ClampedArray::HasInstance(value, args.GetIsolate()))
     139    if (V8NodeList::HasInstance(value, args.GetIsolate(), currentWorldType))
     140        return v8::String::NewSymbol("array");
     141    if (V8HTMLCollection::HasInstance(value, args.GetIsolate(), currentWorldType))
     142        return v8::String::NewSymbol("array");
     143    if (V8Int8Array::HasInstance(value, args.GetIsolate(), currentWorldType) || V8Int16Array::HasInstance(value, args.GetIsolate(), currentWorldType) || V8Int32Array::HasInstance(value, args.GetIsolate(), currentWorldType))
     144        return v8::String::NewSymbol("array");
     145    if (V8Uint8Array::HasInstance(value, args.GetIsolate(), currentWorldType) || V8Uint16Array::HasInstance(value, args.GetIsolate(), currentWorldType) || V8Uint32Array::HasInstance(value, args.GetIsolate(), currentWorldType))
     146        return v8::String::NewSymbol("array");
     147    if (V8Float32Array::HasInstance(value, args.GetIsolate(), currentWorldType) || V8Float64Array::HasInstance(value, args.GetIsolate(), currentWorldType))
     148        return v8::String::NewSymbol("array");
     149    if (V8Uint8ClampedArray::HasInstance(value, args.GetIsolate(), currentWorldType))
    149150        return v8::String::NewSymbol("array");
    150151    return v8::Undefined();
     
    244245
    245246    v8::Local<v8::Value> value = args[0];
    246     if (!V8Node::HasInstance(value, args.GetIsolate()))
     247    if (!V8Node::HasInstance(value, args.GetIsolate(), worldType(args.GetIsolate())))
    247248        return v8::Undefined();
    248249    Node* node = V8Node::toNative(value->ToObject());
  • trunk/Source/WebCore/bindings/v8/custom/V8LocationCustom.cpp

    r145575 r145802  
    144144    WrapperWorldType currentWorldType = worldType(isolate);
    145145    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
    146     v8::Persistent<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, V8Location::reloadMethodCustom, v8Undefined(), v8::Signature::New(data->rawTemplate(&V8Location::info)));
     146    v8::Persistent<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, V8Location::reloadMethodCustom, v8Undefined(), v8::Signature::New(data->rawTemplate(&V8Location::info, currentWorldType)));
    147147
    148148    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(isolate, currentWorldType));
     
    155155    if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) {
    156156        static const char* sharedTemplateUniqueKey = "reloadSharedTemplate";
    157         v8::Persistent<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, V8Location::reloadMethodCustom, v8Undefined(), v8::Signature::New(data->rawTemplate(&V8Location::info)));
     157        v8::Persistent<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, V8Location::reloadMethodCustom, v8Undefined(), v8::Signature::New(data->rawTemplate(&V8Location::info, currentWorldType)));
    158158        return sharedTemplate->GetFunction();
    159159    }
     
    168168    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
    169169    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
    170     v8::Persistent<v8::FunctionTemplate> privateTemplate = V8PerIsolateData::from(isolate)->privateTemplate(currentWorldType, &privateTemplateUniqueKey, V8Location::replaceMethodCustom, v8Undefined(), v8::Signature::New(data->rawTemplate(&V8Location::info)));
     170    v8::Persistent<v8::FunctionTemplate> privateTemplate = V8PerIsolateData::from(isolate)->privateTemplate(currentWorldType, &privateTemplateUniqueKey, V8Location::replaceMethodCustom, v8Undefined(), v8::Signature::New(data->rawTemplate(&V8Location::info, currentWorldType)));
    171171
    172172    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(isolate, currentWorldType));
     
    179179    if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) {
    180180        static const char* sharedTemplateUniqueKey = "replaceSharedTemplate";
    181         v8::Persistent<v8::FunctionTemplate> sharedTemplate = V8PerIsolateData::from(info.GetIsolate())->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, V8Location::replaceMethodCustom, v8Undefined(), v8::Signature::New(data->rawTemplate(&V8Location::info)));
     181        v8::Persistent<v8::FunctionTemplate> sharedTemplate = V8PerIsolateData::from(info.GetIsolate())->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, V8Location::replaceMethodCustom, v8Undefined(), v8::Signature::New(data->rawTemplate(&V8Location::info, currentWorldType)));
    182182        return sharedTemplate->GetFunction();
    183183    }
     
    192192    WrapperWorldType currentWorldType = worldType(info.GetIsolate());
    193193    V8PerIsolateData* data = V8PerIsolateData::from(info.GetIsolate());
    194     v8::Persistent<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, V8Location::assignMethodCustom, v8Undefined(), v8::Signature::New(data->rawTemplate(&V8Location::info)));
     194    v8::Persistent<v8::FunctionTemplate> privateTemplate = data->privateTemplate(currentWorldType, &privateTemplateUniqueKey, V8Location::assignMethodCustom, v8Undefined(), v8::Signature::New(data->rawTemplate(&V8Location::info, currentWorldType)));
    195195
    196196    v8::Handle<v8::Object> holder = info.This()->FindInstanceInPrototypeChain(V8Location::GetTemplate(isolate, currentWorldType));
     
    203203    if (!BindingSecurity::shouldAllowAccessToFrame(BindingState::instance(), imp->frame(), DoNotReportSecurityError)) {
    204204        static const char* sharedTemplateUniqueKey = "assignSharedTemplate";
    205         v8::Persistent<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, V8Location::assignMethodCustom, v8Undefined(), v8::Signature::New(data->rawTemplate(&V8Location::info)));
     205        v8::Persistent<v8::FunctionTemplate> sharedTemplate = data->privateTemplate(currentWorldType, &sharedTemplateUniqueKey, V8Location::assignMethodCustom, v8Undefined(), v8::Signature::New(data->rawTemplate(&V8Location::info, currentWorldType)));
    206206        return sharedTemplate->GetFunction();
    207207    }
  • trunk/Source/WebCore/bindings/v8/custom/V8NodeCustom.cpp

    r145745 r145802  
    6767    Node* imp = V8Node::toNative(holder);
    6868    ExceptionCode ec = 0;
    69     Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
    70     Node* refChild = V8Node::HasInstance(args[1], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
     69    Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     70    Node* refChild = V8Node::HasInstance(args[1], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
    7171    bool success = imp->insertBefore(newChild, refChild, ec, AttachLazily);
    7272    if (ec)
     
    8383    Node* imp = V8Node::toNative(holder);
    8484    ExceptionCode ec = 0;
    85     Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
    86     Node* oldChild = V8Node::HasInstance(args[1], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
     85    Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     86    Node* oldChild = V8Node::HasInstance(args[1], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[1])) : 0;
    8787    bool success = imp->replaceChild(newChild, oldChild, ec, AttachLazily);
    8888    if (ec)
     
    9898    Node* imp = V8Node::toNative(holder);
    9999    ExceptionCode ec = 0;
    100     Node* oldChild = V8Node::HasInstance(args[0], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     100    Node* oldChild = V8Node::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
    101101    bool success = imp->removeChild(oldChild, ec);
    102102    if (ec)
     
    113113    Node* imp = V8Node::toNative(holder);
    114114    ExceptionCode ec = 0;
    115     Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate()) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     115    Node* newChild = V8Node::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
    116116    bool success = imp->appendChild(newChild, ec, AttachLazily);
    117117    if (ec)
  • trunk/Source/WebCore/bindings/v8/custom/V8NodeListCustom.cpp

    r145575 r145802  
    6262void* V8NodeList::opaqueRootForGC(void* object, v8::Persistent<v8::Object> wrapper, v8::Isolate* isolate)
    6363{
    64     ASSERT(V8NodeList::HasInstance(wrapper, isolate));
     64    ASSERT(V8NodeList::HasInstance(wrapper, isolate, MainWorld) || V8NodeList::HasInstance(wrapper, isolate, IsolatedWorld));
    6565    NodeList* impl = static_cast<NodeList*>(object);
    6666    if (!impl->isLiveNodeList())
  • trunk/Source/WebCore/bindings/v8/custom/V8WebGLRenderingContextCustom.cpp

    r144723 r145802  
    275275    ok = false;
    276276    WebGLUniformLocation* location = 0;
    277     if (V8WebGLUniformLocation::HasInstance(value, isolate)) {
     277    if (V8WebGLUniformLocation::HasInstance(value, isolate, worldType(isolate))) {
    278278        location = V8WebGLUniformLocation::toNative(value->ToObject());
    279279        ok = true;
     
    293293    ExceptionCode ec = 0;
    294294    WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
    295     if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0], args.GetIsolate()))
    296         return throwTypeError(0, args.GetIsolate());
    297     WebGLProgram* program = V8WebGLProgram::HasInstance(args[0], args.GetIsolate()) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     295    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))
     296        return throwTypeError(0, args.GetIsolate());
     297    WebGLProgram* program = V8WebGLProgram::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
    298298    Vector<RefPtr<WebGLShader> > shaders;
    299299    bool succeed = context->getAttachedShaders(program, shaders, ec);
     
    362362    ExceptionCode ec = 0;
    363363    WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
    364     if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0], args.GetIsolate()))
    365         return throwTypeError(0, args.GetIsolate());
    366     WebGLProgram* program = V8WebGLProgram::HasInstance(args[0], args.GetIsolate()) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     364    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))
     365        return throwTypeError(0, args.GetIsolate());
     366    WebGLProgram* program = V8WebGLProgram::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
    367367    unsigned pname = toInt32(args[1]);
    368368    WebGLGetInfo info = context->getProgramParameter(program, pname, ec);
     
    384384    ExceptionCode ec = 0;
    385385    WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
    386     if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLShader::HasInstance(args[0], args.GetIsolate()))
    387         return throwTypeError(0, args.GetIsolate());
    388     WebGLShader* shader = V8WebGLShader::HasInstance(args[0], args.GetIsolate()) ? V8WebGLShader::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     386    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLShader::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))
     387        return throwTypeError(0, args.GetIsolate());
     388    WebGLShader* shader = V8WebGLShader::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8WebGLShader::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
    389389    unsigned pname = toInt32(args[1]);
    390390    WebGLGetInfo info = context->getShaderParameter(shader, pname, ec);
     
    419419    ExceptionCode ec = 0;
    420420    WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
    421     if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0], args.GetIsolate()))
    422         return throwTypeError(0, args.GetIsolate());
    423     WebGLProgram* program = V8WebGLProgram::HasInstance(args[0], args.GetIsolate()) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
    424 
    425     if (args.Length() > 1 && !isUndefinedOrNull(args[1]) && !V8WebGLUniformLocation::HasInstance(args[1], args.GetIsolate()))
     421    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLProgram::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))
     422        return throwTypeError(0, args.GetIsolate());
     423    WebGLProgram* program = V8WebGLProgram::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())) ? V8WebGLProgram::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0;
     424
     425    if (args.Length() > 1 && !isUndefinedOrNull(args[1]) && !V8WebGLUniformLocation::HasInstance(args[1], args.GetIsolate(), worldType(args.GetIsolate())))
    426426        return throwTypeError(0, args.GetIsolate());
    427427    bool ok = false;
     
    488488        index = toInt32(args[0]);
    489489    else {
    490         if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0], args.GetIsolate()))
     490        if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))
    491491            return throwTypeError(0, args.GetIsolate());
    492492        location = toWebGLUniformLocation(args[0], ok, args.GetIsolate());
     
    495495    WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
    496496
    497     if (V8Float32Array::HasInstance(args[1], args.GetIsolate())) {
     497    if (V8Float32Array::HasInstance(args[1], args.GetIsolate(), worldType(args.GetIsolate()))) {
    498498        Float32Array* array = V8Float32Array::toNative(args[1]->ToObject());
    499499        ASSERT(array != NULL);
     
    559559
    560560    WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
    561     if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0], args.GetIsolate()))
     561    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))
    562562        return throwTypeError(0, args.GetIsolate());
    563563    bool ok = false;
    564564    WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok, args.GetIsolate());
    565565
    566     if (V8Int32Array::HasInstance(args[1], args.GetIsolate())) {
     566    if (V8Int32Array::HasInstance(args[1], args.GetIsolate(), worldType(args.GetIsolate()))) {
    567567        Int32Array* array = V8Int32Array::toNative(args[1]->ToObject());
    568568        ASSERT(array != NULL);
     
    661661    WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
    662662
    663     if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0], args.GetIsolate()))
     663    if (args.Length() > 0 && !isUndefinedOrNull(args[0]) && !V8WebGLUniformLocation::HasInstance(args[0], args.GetIsolate(), worldType(args.GetIsolate())))
    664664        return throwTypeError(0, args.GetIsolate());
    665665    bool ok = false;
     
    667667   
    668668    bool transpose = args[1]->BooleanValue();
    669     if (V8Float32Array::HasInstance(args[2], args.GetIsolate())) {
     669    if (V8Float32Array::HasInstance(args[2], args.GetIsolate(), worldType(args.GetIsolate()))) {
    670670        Float32Array* array = V8Float32Array::toNative(args[2]->ToObject());
    671671        ASSERT(array != NULL);
  • trunk/Source/WebCore/bindings/v8/custom/V8XMLHttpRequestCustom.cpp

    r144587 r145802  
    159159}
    160160
    161 static bool isDocumentType(v8::Handle<v8::Value> value, v8::Isolate* isolate)
     161static bool isDocumentType(v8::Handle<v8::Value> value, v8::Isolate* isolate, WrapperWorldType currentWorldType)
    162162{
    163163    // FIXME: add other document types.
    164     return V8Document::HasInstance(value, isolate) || V8HTMLDocument::HasInstance(value, isolate);
     164    return V8Document::HasInstance(value, isolate, currentWorldType) || V8HTMLDocument::HasInstance(value, isolate, currentWorldType);
    165165}
    166166
     
    176176    else {
    177177        v8::Handle<v8::Value> arg = args[0];
     178        WrapperWorldType currentWorldType = worldType(args.GetIsolate());
    178179        if (isUndefinedOrNull(arg))
    179180            xmlHttpRequest->send(ec);
    180         else if (isDocumentType(arg, args.GetIsolate())) {
     181        else if (isDocumentType(arg, args.GetIsolate(), currentWorldType)) {
    181182            v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
    182183            Document* document = V8Document::toNative(object);
    183184            ASSERT(document);
    184185            xmlHttpRequest->send(document, ec);
    185         } else if (V8Blob::HasInstance(arg, args.GetIsolate())) {
     186        } else if (V8Blob::HasInstance(arg, args.GetIsolate(), currentWorldType)) {
    186187            v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
    187188            Blob* blob = V8Blob::toNative(object);
    188189            ASSERT(blob);
    189190            xmlHttpRequest->send(blob, ec);
    190         } else if (V8DOMFormData::HasInstance(arg, args.GetIsolate())) {
     191        } else if (V8DOMFormData::HasInstance(arg, args.GetIsolate(), currentWorldType)) {
    191192            v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
    192193            DOMFormData* domFormData = V8DOMFormData::toNative(object);
     
    194195            xmlHttpRequest->send(domFormData, ec);
    195196#if ENABLE(WEBGL) || ENABLE(BLOB)
    196         } else if (V8ArrayBuffer::HasInstance(arg, args.GetIsolate())) {
     197        } else if (V8ArrayBuffer::HasInstance(arg, args.GetIsolate(), currentWorldType)) {
    197198            v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
    198199            ArrayBuffer* arrayBuffer = V8ArrayBuffer::toNative(object);
    199200            ASSERT(arrayBuffer);
    200201            xmlHttpRequest->send(arrayBuffer, ec);
    201         } else if (V8ArrayBufferView::HasInstance(arg, args.GetIsolate())) {
     202        } else if (V8ArrayBufferView::HasInstance(arg, args.GetIsolate(), currentWorldType)) {
    202203            v8::Handle<v8::Object> object = v8::Handle<v8::Object>::Cast(arg);
    203204            ArrayBufferView* arrayBufferView = V8ArrayBufferView::toNative(object);
  • trunk/Source/WebKit/chromium/ChangeLog

    r145784 r145802  
     12013-03-14  Marja Hölttä  <marja@chromium.org>
     2
     3        [V8] Store main world and non-main world templates separately.
     4        https://bugs.webkit.org/show_bug.cgi?id=111724
     5
     6        Reviewed by Jochen Eisinger.
     7
     8        This is needed for generating specialized bindings for the main
     9        world (bug 110874).
     10
     11        * src/WebArrayBuffer.cpp:
     12        (WebKit::WebArrayBuffer::createFromV8Value):
     13        * src/WebArrayBufferView.cpp:
     14        (WebKit::WebArrayBufferView::createFromV8Value):
     15        * src/WebBindings.cpp:
     16        (WebKit::getRangeImpl):
     17        (WebKit::getNodeImpl):
     18        (WebKit::getElementImpl):
     19        (WebKit::getArrayBufferImpl):
     20        (WebKit::getArrayBufferViewImpl):
     21
    1222013-03-13  Rik Cabanier  <cabanier@adobe.com>
    223
  • trunk/Source/WebKit/chromium/src/WebArrayBuffer.cpp

    r145589 r145802  
    7979WebArrayBuffer* WebArrayBuffer::createFromV8Value(v8::Handle<v8::Value> value)
    8080{
    81     if (!V8ArrayBuffer::HasInstance(value, v8::Isolate::GetCurrent()))
     81    if (!V8ArrayBuffer::HasInstance(value, v8::Isolate::GetCurrent(), WebCore::MainWorld) && !V8ArrayBuffer::HasInstance(value, v8::Isolate::GetCurrent(), WebCore::IsolatedWorld) && !V8ArrayBuffer::HasInstance(value, v8::Isolate::GetCurrent(), WebCore::WorkerWorld))
    8282        return 0;
    8383    WTF::ArrayBuffer* buffer = V8ArrayBuffer::toNative(value->ToObject());
  • trunk/Source/WebKit/chromium/src/WebArrayBufferView.cpp

    r145589 r145802  
    6464WebArrayBufferView* WebArrayBufferView::createFromV8Value(v8::Handle<v8::Value> value)
    6565{
    66     if (!WebCore::V8ArrayBufferView::HasInstance(value, v8::Isolate::GetCurrent()))
     66    if (!WebCore::V8ArrayBufferView::HasInstance(value, v8::Isolate::GetCurrent(), WebCore::MainWorld) && !WebCore::V8ArrayBufferView::HasInstance(value, v8::Isolate::GetCurrent(), WebCore::IsolatedWorld) && !WebCore::V8ArrayBufferView::HasInstance(value, v8::Isolate::GetCurrent(), WebCore::WorkerWorld))
    6767        return 0;
    6868    ArrayBufferView* view = WebCore::V8ArrayBufferView::toNative(value->ToObject());
  • trunk/Source/WebKit/chromium/src/WebBindings.cpp

    r145589 r145802  
    215215        return false;
    216216
    217     Range* native = V8Range::HasInstance(v8Object, isolate) ? V8Range::toNative(v8Object) : 0;
     217    Range* native = V8Range::HasInstance(v8Object, isolate, worldType(isolate)) ? V8Range::toNative(v8Object) : 0;
    218218    if (!native)
    219219        return false;
     
    230230    V8NPObject* v8NPObject = reinterpret_cast<V8NPObject*>(object);
    231231    v8::Handle<v8::Object> v8Object(v8NPObject->v8Object);
    232     Node* native = V8Node::HasInstance(v8Object, isolate) ? V8Node::toNative(v8Object) : 0;
     232    Node* native = V8Node::HasInstance(v8Object, isolate, worldType(isolate)) ? V8Node::toNative(v8Object) : 0;
    233233    if (!native)
    234234        return false;
     
    245245    V8NPObject* v8NPObject = reinterpret_cast<V8NPObject*>(object);
    246246    v8::Handle<v8::Object> v8Object(v8NPObject->v8Object);
    247     Element* native = V8Element::HasInstance(v8Object, isolate) ? V8Element::toNative(v8Object) : 0;
     247    Element* native = V8Element::HasInstance(v8Object, isolate, worldType(isolate)) ? V8Element::toNative(v8Object) : 0;
    248248    if (!native)
    249249        return false;
     
    260260    V8NPObject* v8NPObject = reinterpret_cast<V8NPObject*>(object);
    261261    v8::Handle<v8::Object> v8Object(v8NPObject->v8Object);
    262     ArrayBuffer* native = V8ArrayBuffer::HasInstance(v8Object, isolate) ? V8ArrayBuffer::toNative(v8Object) : 0;
     262    ArrayBuffer* native = V8ArrayBuffer::HasInstance(v8Object, isolate, worldType(isolate)) ? V8ArrayBuffer::toNative(v8Object) : 0;
    263263    if (!native)
    264264        return false;
     
    275275    V8NPObject* v8NPObject = reinterpret_cast<V8NPObject*>(object);
    276276    v8::Handle<v8::Object> v8Object(v8NPObject->v8Object);
    277     ArrayBufferView* native = V8ArrayBufferView::HasInstance(v8Object, isolate) ? V8ArrayBufferView::toNative(v8Object) : 0;
     277    ArrayBufferView* native = V8ArrayBufferView::HasInstance(v8Object, isolate, worldType(isolate)) ? V8ArrayBufferView::toNative(v8Object) : 0;
    278278    if (!native)
    279279        return false;
Note: See TracChangeset for help on using the changeset viewer.