Title: [98695] trunk/Source/WebCore
Revision
98695
Author
[email protected]
Date
2011-10-27 22:52:58 -0700 (Thu, 27 Oct 2011)

Log Message

Deprecate [V8ConstructorSetsActiveDOMWrapper] IDL
https://bugs.webkit.org/show_bug.cgi?id=71088

Reviewed by Adam Barth.

I introduced [V8ConstructorSetsActiveDOMWrapper] IDL in bug 66536,
but I found that it has the same meaning as [ActiveDOMObject] IDL.
This patch removes [V8ConstructorSetsActiveDOMWrapper] IDL.

No change in behavior.

Tests: fast/dom/global-constructors.html
       fast/eventsource/eventsource-constructor.html
       fast/eventsource/eventsource-attribute-listeners.html
       fast/files/blob-slice-test.html
       fast/files/file-reader-abort.html
       ui_tests:WorkerTest.FLAKY_SharedWorkerFastConstructor
       ui_tests:WorkerTest.FLAKY_SharedWorkerFastName
       ui_tests:WorkerTest.FLAKY_WorkerConstructor
       ui_tests:WorkerTest.FLAKY_WorkerEventListener

* bindings/scripts/CodeGeneratorV8.pm: Replaced "V8ConstructorSetsActiveDOMWrapper" with "ActiveDOMObject".
(GenerateConstructorCallback):
* bindings/scripts/test/TestInterface.idl: Ditto.
* bindings/scripts/test/JS/JSTestInterface.cpp: Updated a test result.
(WebCore::isObservable):
(WebCore::JSTestInterfaceOwner::isReachableFromOpaqueRoots):
(WebCore::JSTestInterfaceOwner::finalize):
* bindings/scripts/test/JS/JSTestInterface.h: Ditto.
(WebCore::wrapperOwner):
(WebCore::wrapperContext):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Ditto.
* bindings/scripts/test/JS/JSTestMediaQueryListListener.h: Ditto.
* bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
* bindings/scripts/test/JS/JSTestObj.h: Ditto.
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Ditto.
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: Ditto.
* bindings/scripts/test/V8/V8TestInterface.cpp: Ditto.
(WebCore::V8TestInterface::toActiveDOMObject):
(WebCore::V8TestInterface::wrapSlow):
* bindings/scripts/test/V8/V8TestInterface.h: Ditto.
(WebCore::V8TestInterface::existingWrapper):
* fileapi/FileReader.idl: Removed [V8ConstructorSetsActiveDOMWrapper] IDL.
* mediastream/PeerConnection.idl: Ditto.
* page/EventSource.idl: Ditto.
* workers/SharedWorker.idl: Ditto.
* workers/Worker.idl: Ditto.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (98694 => 98695)


--- trunk/Source/WebCore/ChangeLog	2011-10-28 05:39:15 UTC (rev 98694)
+++ trunk/Source/WebCore/ChangeLog	2011-10-28 05:52:58 UTC (rev 98695)
@@ -1,3 +1,53 @@
+2011-10-27  Kentaro Hara  <[email protected]>
+
+        Deprecate [V8ConstructorSetsActiveDOMWrapper] IDL
+        https://bugs.webkit.org/show_bug.cgi?id=71088
+
+        Reviewed by Adam Barth.
+
+        I introduced [V8ConstructorSetsActiveDOMWrapper] IDL in bug 66536,
+        but I found that it has the same meaning as [ActiveDOMObject] IDL.
+        This patch removes [V8ConstructorSetsActiveDOMWrapper] IDL.
+
+        No change in behavior.
+
+        Tests: fast/dom/global-constructors.html
+               fast/eventsource/eventsource-constructor.html
+               fast/eventsource/eventsource-attribute-listeners.html
+               fast/files/blob-slice-test.html
+               fast/files/file-reader-abort.html
+               ui_tests:WorkerTest.FLAKY_SharedWorkerFastConstructor
+               ui_tests:WorkerTest.FLAKY_SharedWorkerFastName
+               ui_tests:WorkerTest.FLAKY_WorkerConstructor
+               ui_tests:WorkerTest.FLAKY_WorkerEventListener
+
+        * bindings/scripts/CodeGeneratorV8.pm: Replaced "V8ConstructorSetsActiveDOMWrapper" with "ActiveDOMObject".
+        (GenerateConstructorCallback):
+        * bindings/scripts/test/TestInterface.idl: Ditto.
+        * bindings/scripts/test/JS/JSTestInterface.cpp: Updated a test result.
+        (WebCore::isObservable):
+        (WebCore::JSTestInterfaceOwner::isReachableFromOpaqueRoots):
+        (WebCore::JSTestInterfaceOwner::finalize):
+        * bindings/scripts/test/JS/JSTestInterface.h: Ditto.
+        (WebCore::wrapperOwner):
+        (WebCore::wrapperContext):
+        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: Ditto.
+        * bindings/scripts/test/JS/JSTestMediaQueryListListener.h: Ditto.
+        * bindings/scripts/test/JS/JSTestObj.cpp: Ditto.
+        * bindings/scripts/test/JS/JSTestObj.h: Ditto.
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: Ditto.
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h: Ditto.
+        * bindings/scripts/test/V8/V8TestInterface.cpp: Ditto.
+        (WebCore::V8TestInterface::toActiveDOMObject):
+        (WebCore::V8TestInterface::wrapSlow):
+        * bindings/scripts/test/V8/V8TestInterface.h: Ditto.
+        (WebCore::V8TestInterface::existingWrapper):
+        * fileapi/FileReader.idl: Removed [V8ConstructorSetsActiveDOMWrapper] IDL.
+        * mediastream/PeerConnection.idl: Ditto.
+        * page/EventSource.idl: Ditto.
+        * workers/SharedWorker.idl: Ditto.
+        * workers/Worker.idl: Ditto.
+
 2011-10-28  Yuta Kitamura  <[email protected]>
 
         Race condition in SocketStreamHandleCFNet when PAC script is used

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (98694 => 98695)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2011-10-28 05:39:15 UTC (rev 98694)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm	2011-10-28 05:52:58 UTC (rev 98695)
@@ -1584,7 +1584,7 @@
         push(@implContent, "        goto fail;\n");
     }
 
-    my $DOMObject = $dataNode->extendedAttributes->{"V8ConstructorSetsActiveDOMWrapper"} ? "ActiveDOMObject" : "DOMObject";
+    my $DOMObject = $dataNode->extendedAttributes->{"ActiveDOMObject"} ? "ActiveDOMObject" : "DOMObject";
     push(@implContent, <<END);
 
     V8DOMWrapper::setDOMWrapper(args.Holder(), &info, obj.get());

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (98694 => 98695)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp	2011-10-28 05:39:15 UTC (rev 98694)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp	2011-10-28 05:52:58 UTC (rev 98695)
@@ -197,6 +197,31 @@
     return getDOMConstructor<JSTestInterfaceConstructor>(exec, static_cast<JSDOMGlobalObject*>(globalObject));
 }
 
+static inline bool isObservable(JSTestInterface* jsTestInterface)
+{
+    if (jsTestInterface->hasCustomProperties())
+        return true;
+    return false;
+}
+
+bool JSTestInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+    JSTestInterface* jsTestInterface = static_cast<JSTestInterface*>(handle.get().asCell());
+    if (jsTestInterface->impl()->hasPendingActivity())
+        return true;
+    if (!isObservable(jsTestInterface))
+        return false;
+    UNUSED_PARAM(visitor);
+    return false;
+}
+
+void JSTestInterfaceOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
+{
+    JSTestInterface* jsTestInterface = static_cast<JSTestInterface*>(handle.get().asCell());
+    DOMWrapperWorld* world = static_cast<DOMWrapperWorld*>(context);
+    uncacheWrapper(world, jsTestInterface->impl(), jsTestInterface);
+}
+
 JSC::JSValue toJS(JSC::ExecState* exec, JSDOMGlobalObject* globalObject, TestInterface* impl)
 {
     return wrap<JSTestInterface>(exec, globalObject, impl);

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h (98694 => 98695)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h	2011-10-28 05:39:15 UTC (rev 98694)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.h	2011-10-28 05:52:58 UTC (rev 98695)
@@ -62,6 +62,22 @@
     static const unsigned StructureFlags = JSC::OverridesGetOwnPropertySlot | Base::StructureFlags;
 };
 
+class JSTestInterfaceOwner : public JSC::WeakHandleOwner {
+    virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
+    virtual void finalize(JSC::Handle<JSC::Unknown>, void* context);
+};
+
+inline JSC::WeakHandleOwner* wrapperOwner(DOMWrapperWorld*, TestInterface*)
+{
+    DEFINE_STATIC_LOCAL(JSTestInterfaceOwner, jsTestInterfaceOwner, ());
+    return &jsTestInterfaceOwner;
+}
+
+inline void* wrapperContext(DOMWrapperWorld* world, TestInterface*)
+{
+    return world;
+}
+
 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject*, TestInterface*);
 TestInterface* toTestInterface(JSC::JSValue);
 

Modified: trunk/Source/WebCore/bindings/scripts/test/TestInterface.idl (98694 => 98695)


--- trunk/Source/WebCore/bindings/scripts/test/TestInterface.idl	2011-10-28 05:39:15 UTC (rev 98694)
+++ trunk/Source/WebCore/bindings/scripts/test/TestInterface.idl	2011-10-28 05:52:58 UTC (rev 98695)
@@ -30,11 +30,11 @@
 // changes in its ouput.
 module test {
     interface [
+        ActiveDOMObject,
         Conditional=Condition1|Condition2,
         CanBeConstructed,
         CallWith=ScriptExecutionContext,
         Constructor(in DOMString str1, in [Optional=CallWithDefaultValue] DOMString str2),
-        V8ConstructorSetsActiveDOMWrapper,
         ConstructorRaisesException
     ] TestInterface {
     };

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp (98694 => 98695)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp	2011-10-28 05:39:15 UTC (rev 98694)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp	2011-10-28 05:52:58 UTC (rev 98695)
@@ -35,7 +35,7 @@
 
 namespace WebCore {
 
-WrapperTypeInfo V8TestInterface::info = { V8TestInterface::GetTemplate, V8TestInterface::derefObject, 0, 0 };
+WrapperTypeInfo V8TestInterface::info = { V8TestInterface::GetTemplate, V8TestInterface::derefObject, V8TestInterface::toActiveDOMObject, 0 };
 
 namespace TestInterfaceInternal {
 
@@ -124,6 +124,10 @@
     return GetRawTemplate()->HasInstance(value);
 }
 
+ActiveDOMObject* V8TestInterface::toActiveDOMObject(v8::Handle<v8::Object> object)
+{
+    return toNative(object);
+}      
 
 v8::Handle<v8::Object> V8TestInterface::wrapSlow(TestInterface* impl)
 {
@@ -138,7 +142,7 @@
 
     if (!hasDependentLifetime)
         wrapperHandle.MarkIndependent();
-    getDOMObjectMap().set(impl, wrapperHandle);
+    getActiveDOMObjectMap().set(impl, wrapperHandle);
     return wrapper;
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h (98694 => 98695)


--- trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h	2011-10-28 05:39:15 UTC (rev 98694)
+++ trunk/Source/WebCore/bindings/scripts/test/V8/V8TestInterface.h	2011-10-28 05:52:58 UTC (rev 98695)
@@ -34,7 +34,7 @@
 
 class V8TestInterface {
 public:
-    static const bool hasDependentLifetime = false;
+    static const bool hasDependentLifetime = true;
     static bool HasInstance(v8::Handle<v8::Value> value);
     static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
     static v8::Persistent<v8::FunctionTemplate> GetTemplate();
@@ -45,6 +45,7 @@
     inline static v8::Handle<v8::Object> wrap(TestInterface*);
     static void derefObject(void*);
     static WrapperTypeInfo info;
+    static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
     static v8::Handle<v8::Value> constructorCallback(const v8::Arguments& args);
     static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
     static v8::Handle<v8::Object> existingWrapper(TestInterface*);
@@ -55,7 +56,7 @@
 
 ALWAYS_INLINE v8::Handle<v8::Object> V8TestInterface::existingWrapper(TestInterface* impl)
 {
-    return getDOMObjectMap().get(impl);
+    return getActiveDOMObjectMap().get(impl);
 }
 
 v8::Handle<v8::Object> V8TestInterface::wrap(TestInterface* impl)

Modified: trunk/Source/WebCore/fileapi/FileReader.idl (98694 => 98695)


--- trunk/Source/WebCore/fileapi/FileReader.idl	2011-10-28 05:39:15 UTC (rev 98694)
+++ trunk/Source/WebCore/fileapi/FileReader.idl	2011-10-28 05:52:58 UTC (rev 98695)
@@ -37,8 +37,7 @@
         CallWith=ScriptExecutionContext,
         EventTarget,
         NoStaticTables,
-        Constructor,
-        V8ConstructorSetsActiveDOMWrapper
+        Constructor
     ] FileReader {
         // ready states
         const unsigned short EMPTY = 0;

Modified: trunk/Source/WebCore/mediastream/PeerConnection.idl (98694 => 98695)


--- trunk/Source/WebCore/mediastream/PeerConnection.idl	2011-10-28 05:39:15 UTC (rev 98694)
+++ trunk/Source/WebCore/mediastream/PeerConnection.idl	2011-10-28 05:52:58 UTC (rev 98695)
@@ -32,7 +32,6 @@
         Constructor(in DOMString serverConfiguration, in [Callback=FunctionOnly] SignalingCallback signalingCallback),
         CallWith=ScriptExecutionContext,
         JSCustomConstructor,
-        V8ConstructorSetsActiveDOMWrapper,
         EventTarget
     ] PeerConnection {
         void processSignalingMessage(in DOMString message)

Modified: trunk/Source/WebCore/page/EventSource.idl (98694 => 98695)


--- trunk/Source/WebCore/page/EventSource.idl	2011-10-28 05:39:15 UTC (rev 98694)
+++ trunk/Source/WebCore/page/EventSource.idl	2011-10-28 05:52:58 UTC (rev 98695)
@@ -38,7 +38,6 @@
         Constructor(in DOMString scriptUrl),
         CallWith=ScriptExecutionContext,
         ConstructorRaisesException,
-        V8ConstructorSetsActiveDOMWrapper,
         EventTarget,
         NoStaticTables
     ] EventSource {

Modified: trunk/Source/WebCore/workers/SharedWorker.idl (98694 => 98695)


--- trunk/Source/WebCore/workers/SharedWorker.idl	2011-10-28 05:39:15 UTC (rev 98694)
+++ trunk/Source/WebCore/workers/SharedWorker.idl	2011-10-28 05:52:58 UTC (rev 98695)
@@ -40,7 +40,6 @@
         Constructor(in DOMString scriptURL, in [Optional=CallWithNullValue] DOMString name),
         CallWith=ScriptExecutionContext,
         ConstructorRaisesException,
-        V8ConstructorSetsActiveDOMWrapper,
         CustomMarkFunction,
         GenerateNativeConverter,
         GenerateToJS

Modified: trunk/Source/WebCore/workers/Worker.idl (98694 => 98695)


--- trunk/Source/WebCore/workers/Worker.idl	2011-10-28 05:39:15 UTC (rev 98694)
+++ trunk/Source/WebCore/workers/Worker.idl	2011-10-28 05:52:58 UTC (rev 98695)
@@ -36,7 +36,6 @@
         Constructor(in DOMString scriptUrl),
         CallWith=ScriptExecutionContext,
         ConstructorRaisesException,
-        V8ConstructorSetsActiveDOMWrapper,
         GenerateNativeConverter,
         GenerateToJS
     ] Worker : AbstractWorker {
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to