Unreviewed, rolling out r112199.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Mar 2012 05:32:16 +0000 (05:32 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 27 Mar 2012 05:32:16 +0000 (05:32 +0000)
http://trac.webkit.org/changeset/112199
https://bugs.webkit.org/show_bug.cgi?id=82295

Breaks Chromium Win compilation (Requested by pfeldman on
#webkit).

Patch by Sheriff Bot <webkit.review.bot@gmail.com> on 2012-03-26

* bindings/scripts/CodeGeneratorV8.pm:
(GenerateConstructorCallback):
(GenerateNamedConstructorCallback):
(GenerateToV8Converters):
(GetDomMapFunction):
* bindings/scripts/test/V8/V8Float64Array.cpp:
(WebCore::V8Float64Array::wrapSlow):
* bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
(WebCore::V8TestActiveDOMObject::wrapSlow):
* bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
(WebCore::V8TestCustomNamedGetter::wrapSlow):
* bindings/scripts/test/V8/V8TestEventConstructor.cpp:
(WebCore::V8TestEventConstructor::wrapSlow):
* bindings/scripts/test/V8/V8TestEventTarget.cpp:
(WebCore::V8TestEventTarget::wrapSlow):
* bindings/scripts/test/V8/V8TestInterface.cpp:
(WebCore::V8TestInterface::wrapSlow):
* bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
(WebCore::V8TestMediaQueryListListener::wrapSlow):
* bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
(WebCore::V8TestNamedConstructor::wrapSlow):
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::V8TestObj::wrapSlow):
* bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
(WebCore::V8TestSerializedScriptValueInterface::wrapSlow):
* bindings/v8/V8DOMWrapper.cpp:
(WebCore::V8DOMWrapper::setJSWrapperForDOMNode):
(WebCore):
* bindings/v8/V8DOMWrapper.h:
(WebCore):
(V8DOMWrapper):
(WebCore::V8DOMWrapper::setJSWrapperForDOMObject):
(WebCore::V8DOMWrapper::setJSWrapperForActiveDOMObject):

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

14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
Source/WebCore/bindings/scripts/test/V8/V8Float64Array.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestActiveDOMObject.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestEventConstructor.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestEventTarget.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestNamedConstructor.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp
Source/WebCore/bindings/v8/V8DOMWrapper.cpp
Source/WebCore/bindings/v8/V8DOMWrapper.h

index 2616dc1..2c8997f 100644 (file)
@@ -1,3 +1,46 @@
+2012-03-26  Sheriff Bot  <webkit.review.bot@gmail.com>
+
+        Unreviewed, rolling out r112199.
+        http://trac.webkit.org/changeset/112199
+        https://bugs.webkit.org/show_bug.cgi?id=82295
+
+        Breaks Chromium Win compilation (Requested by pfeldman on
+        #webkit).
+
+        * bindings/scripts/CodeGeneratorV8.pm:
+        (GenerateConstructorCallback):
+        (GenerateNamedConstructorCallback):
+        (GenerateToV8Converters):
+        (GetDomMapFunction):
+        * bindings/scripts/test/V8/V8Float64Array.cpp:
+        (WebCore::V8Float64Array::wrapSlow):
+        * bindings/scripts/test/V8/V8TestActiveDOMObject.cpp:
+        (WebCore::V8TestActiveDOMObject::wrapSlow):
+        * bindings/scripts/test/V8/V8TestCustomNamedGetter.cpp:
+        (WebCore::V8TestCustomNamedGetter::wrapSlow):
+        * bindings/scripts/test/V8/V8TestEventConstructor.cpp:
+        (WebCore::V8TestEventConstructor::wrapSlow):
+        * bindings/scripts/test/V8/V8TestEventTarget.cpp:
+        (WebCore::V8TestEventTarget::wrapSlow):
+        * bindings/scripts/test/V8/V8TestInterface.cpp:
+        (WebCore::V8TestInterface::wrapSlow):
+        * bindings/scripts/test/V8/V8TestMediaQueryListListener.cpp:
+        (WebCore::V8TestMediaQueryListListener::wrapSlow):
+        * bindings/scripts/test/V8/V8TestNamedConstructor.cpp:
+        (WebCore::V8TestNamedConstructor::wrapSlow):
+        * bindings/scripts/test/V8/V8TestObj.cpp:
+        (WebCore::V8TestObj::wrapSlow):
+        * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
+        (WebCore::V8TestSerializedScriptValueInterface::wrapSlow):
+        * bindings/v8/V8DOMWrapper.cpp:
+        (WebCore::V8DOMWrapper::setJSWrapperForDOMNode):
+        (WebCore):
+        * bindings/v8/V8DOMWrapper.h:
+        (WebCore):
+        (V8DOMWrapper):
+        (WebCore::V8DOMWrapper::setJSWrapperForDOMObject):
+        (WebCore::V8DOMWrapper::setJSWrapperForActiveDOMObject):
+
 2012-03-26  David Kilzer  <ddkilzer@apple.com>
 
         Build system prep work for upstreaming iOS changes
index b43b4a2..cb4e342 100644 (file)
@@ -1752,7 +1752,13 @@ END
         push(@implContent, "        goto fail;\n");
     }
 
-    my $DOMObject = GetDomWrapperMapName($dataNode, $implClassName);
+    my $DOMObject = "DOMObject";
+    if (IsNodeSubType($dataNode)) {
+        $DOMObject = "DOMNode";
+    } elsif ($dataNode->extendedAttributes->{"ActiveDOMObject"}) {
+        $DOMObject = "ActiveDOMObject";
+    }
+
     push(@implContent, <<END);
 
     V8DOMWrapper::setDOMWrapper(wrapper, &info, impl.get());
@@ -1926,7 +1932,14 @@ END
         push(@implContent, "        goto fail;\n");
     }
 
-    my $DOMObject = GetDomWrapperMapName($dataNode, $implClassName);
+    my $DOMObject = "DOMObject";
+    # A DOMObject that is an ActiveDOMObject and also a DOMNode should be treated as an DOMNode here.
+    # setJSWrapperForDOMNode() will look if node is active and choose correct map to add node to.
+    if (IsNodeSubType($dataNode)) {
+        $DOMObject = "DOMNode";
+    } elsif ($dataNode->extendedAttributes->{"ActiveDOMObject"}) {
+        $DOMObject = "ActiveDOMObject";
+    }
     push(@implContent, <<END);
 
     V8DOMWrapper::setDOMWrapper(wrapper, &V8${implClassName}Constructor::info, impl.get());
@@ -3080,7 +3093,7 @@ sub GenerateToV8Converters
     my $className = shift;
     my $nativeType = shift;
 
-    my $domMapName = GetDomWrapperMapName($dataNode, $interfaceName);
+    my $domMapFunction = GetDomMapFunction($dataNode, $interfaceName);
     my $forceNewObjectInput = IsDOMNodeType($interfaceName) ? ", bool forceNewObject" : "";
     my $forceNewObjectCall = IsDOMNodeType($interfaceName) ? ", forceNewObject" : "";
     my $wrapSlowArgumentType = GetPassRefPtrType($nativeType);
@@ -3167,7 +3180,7 @@ END
 END
     }
     push(@implContent, <<END);
-    V8DOMWrapper::setJSWrapperFor${domMapName}(impl, wrapperHandle);
+    ${domMapFunction}.set(impl.leakRef(), wrapperHandle);
     return wrapper;
 }
 END
@@ -3175,19 +3188,13 @@ END
 
 sub GetDomMapFunction
 {
-    my $mapName = GetDomWrapperMapName(@_);
-    return "get${mapName}Map()";
-}
-
-sub GetDomWrapperMapName
-{
     my $dataNode = shift;
     my $type = shift;
-    return "DOMSVGElementInstance" if $type eq "SVGElementInstance";
-    return "ActiveDOMNode" if (IsNodeSubType($dataNode) && $dataNode->extendedAttributes->{"ActiveDOMObject"});
-    return "DOMNode" if (IsNodeSubType($dataNode));
-    return "ActiveDOMObject" if $dataNode->extendedAttributes->{"ActiveDOMObject"};
-    return "DOMObject";
+    return "getDOMSVGElementInstanceMap()" if $type eq "SVGElementInstance";
+    return "getActiveDOMNodeMap()" if (IsNodeSubType($dataNode) && $dataNode->extendedAttributes->{"ActiveDOMObject"});
+    return "getDOMNodeMap()" if (IsNodeSubType($dataNode));
+    return "getActiveDOMObjectMap()" if $dataNode->extendedAttributes->{"ActiveDOMObject"};
+    return "getDOMObjectMap()";
 }
 
 sub GetNativeTypeForConversions
index 7a3697b..48c1dcf 100644 (file)
@@ -132,7 +132,7 @@ v8::Handle<v8::Object> V8Float64Array::wrapSlow(PassRefPtr<Float64Array> impl)
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
+    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     return wrapper;
 }
 
index 56c9e1b..034bda6 100644 (file)
@@ -186,7 +186,7 @@ v8::Handle<v8::Object> V8TestActiveDOMObject::wrapSlow(PassRefPtr<TestActiveDOMO
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
+    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     return wrapper;
 }
 
index 4cfd534..dc8d144 100644 (file)
@@ -122,7 +122,7 @@ v8::Handle<v8::Object> V8TestCustomNamedGetter::wrapSlow(PassRefPtr<TestCustomNa
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
+    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     return wrapper;
 }
 
index 919d1ff..7f64679 100644 (file)
@@ -157,7 +157,7 @@ v8::Handle<v8::Object> V8TestEventConstructor::wrapSlow(PassRefPtr<TestEventCons
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
+    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     return wrapper;
 }
 
index 0e803c2..7add639 100644 (file)
@@ -185,7 +185,7 @@ v8::Handle<v8::Object> V8TestEventTarget::wrapSlow(PassRefPtr<TestEventTarget> i
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
+    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     return wrapper;
 }
 
index d2bb81f..6835a28 100644 (file)
@@ -317,7 +317,7 @@ v8::Handle<v8::Object> V8TestInterface::wrapSlow(PassRefPtr<TestInterface> impl)
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    V8DOMWrapper::setJSWrapperForActiveDOMObject(impl, wrapperHandle);
+    getActiveDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     return wrapper;
 }
 
index 91c9faa..28853c5 100644 (file)
@@ -122,7 +122,7 @@ v8::Handle<v8::Object> V8TestMediaQueryListListener::wrapSlow(PassRefPtr<TestMed
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
+    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     return wrapper;
 }
 
index 8ee40e4..9f8ffb0 100644 (file)
@@ -166,7 +166,7 @@ v8::Handle<v8::Object> V8TestNamedConstructor::wrapSlow(PassRefPtr<TestNamedCons
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    V8DOMWrapper::setJSWrapperForActiveDOMObject(impl, wrapperHandle);
+    getActiveDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     return wrapper;
 }
 
index 4c2e2cf..d3677ac 100644 (file)
@@ -2172,7 +2172,7 @@ v8::Handle<v8::Object> V8TestObj::wrapSlow(PassRefPtr<TestObj> impl)
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
+    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     return wrapper;
 }
 
index 34117fa..22fe288 100644 (file)
@@ -288,7 +288,7 @@ v8::Handle<v8::Object> V8TestSerializedScriptValueInterface::wrapSlow(PassRefPtr
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    V8DOMWrapper::setJSWrapperForDOMObject(impl, wrapperHandle);
+    getDOMObjectMap().set(impl.leakRef(), wrapperHandle);
     return wrapper;
 }
 
index 0a4ada5..1714062 100644 (file)
 
 namespace WebCore {
 
+void V8DOMWrapper::setJSWrapperForDOMNode(PassRefPtr<Node> node, v8::Persistent<v8::Object> wrapper)
+{
+    ASSERT(maybeDOMWrapper(wrapper));
+    if (node->isActiveNode())
+        getActiveDOMNodeMap().set(node.leakRef(), wrapper);
+    else
+        getDOMNodeMap().set(node.leakRef(), wrapper);
+}
+
 v8::Local<v8::Function> V8DOMWrapper::getConstructor(WrapperTypeInfo* type, v8::Handle<v8::Value> objectPrototype)
 {
     // A DOM constructor is a function instance created from a DOM constructor
index 4505525..a94b4bd 100644 (file)
@@ -54,7 +54,7 @@ namespace WebCore {
     class DOMWindow;
     class EventTarget;
     class Frame;
-    class SVGElementInstance;
+    class Node;
     class V8Proxy;
     class WorkerContext;
 
@@ -110,10 +110,6 @@ namespace WebCore {
         template<typename T> static void setJSWrapperForDOMObject(PassRefPtr<T>, v8::Persistent<v8::Object>);
         template<typename T> static void setJSWrapperForActiveDOMObject(PassRefPtr<T>, v8::Persistent<v8::Object>);
         static void setJSWrapperForDOMNode(PassRefPtr<Node>, v8::Persistent<v8::Object>);
-        static void setJSWrapperForActiveDOMNode(PassRefPtr<Node>, v8::Persistent<v8::Object>);
-#if ENABLE(SVG)
-        static void setJSWrapperForDOMSVGElementInstance(PassRefPtr<SVGElementInstance>, v8::Persistent<v8::Object>);
-#endif
 
         static bool isValidDOMObject(v8::Handle<v8::Value>);
 
@@ -154,7 +150,7 @@ namespace WebCore {
     };
 
     template<typename T>
-    inline void V8DOMWrapper::setJSWrapperForDOMObject(PassRefPtr<T> object, v8::Persistent<v8::Object> wrapper)
+    void V8DOMWrapper::setJSWrapperForDOMObject(PassRefPtr<T> object, v8::Persistent<v8::Object> wrapper)
     {
         ASSERT(maybeDOMWrapper(wrapper));
         ASSERT(!domWrapperType(wrapper)->toActiveDOMObjectFunction);
@@ -162,37 +158,12 @@ namespace WebCore {
     }
 
     template<typename T>
-    inline void V8DOMWrapper::setJSWrapperForActiveDOMObject(PassRefPtr<T> object, v8::Persistent<v8::Object> wrapper)
+    void V8DOMWrapper::setJSWrapperForActiveDOMObject(PassRefPtr<T> object, v8::Persistent<v8::Object> wrapper)
     {
         ASSERT(maybeDOMWrapper(wrapper));
         ASSERT(domWrapperType(wrapper)->toActiveDOMObjectFunction);
         getActiveDOMObjectMap().set(object.leakRef(), wrapper);
     }
-
-    inline void V8DOMWrapper::setJSWrapperForDOMNode(PassRefPtr<Node> node, v8::Persistent<v8::Object> wrapper)
-    {
-        ASSERT(maybeDOMWrapper(wrapper));
-        ASSERT(!domWrapperType(wrapper)->toActiveDOMObjectFunction);
-        ASSERT(!node->isActiveNode());
-        getDOMNodeMap().set(node.leakRef(), wrapper);
-    }
-
-    inline void V8DOMWrapper::setJSWrapperForActiveDOMNode(PassRefPtr<Node> node, v8::Persistent<v8::Object> wrapper)
-    {
-        ASSERT(maybeDOMWrapper(wrapper));
-        ASSERT(domWrapperType(wrapper)->toActiveDOMObjectFunction);
-        ASSERT(node->isActiveNode());
-        getActiveDOMNodeMap().set(node.leakRef(), wrapper);
-    }
-
-#if ENABLE(SVG)
-    inline void V8DOMWrapper::setJSWrapperForDOMSVGElementInstance(PassRefPtr<SVGElementInstance> element, v8::Persistent<v8::Object> wrapper)
-    {
-        ASSERT(maybeDOMWrapper(wrapper));
-        getDOMSVGElementInstanceMap().set(element.leakRef(), wrapper);
-    }
-#endif
-
 } // namespace WebCore
 
 #endif // V8DOMWrapper_h