Title: [150580] trunk/Source/WebCore
Revision
150580
Author
ch.du...@sisa.samsung.com
Date
2013-05-23 05:22:23 -0700 (Thu, 23 May 2013)

Log Message

Remove special case for MessagePortArray from bindings generator
https://bugs.webkit.org/show_bug.cgi?id=116653

Reviewed by Kentaro Hara.

Use MessagePort[] instead of MessagePortArray type in the IDL as MessagePortArray
is not defined on IDL side. This allows us to remove the special case for
MessagePortArray from the bindings generator.

No new tests, no behavior change.

* bindings/js/JSMessageEventCustom.cpp:
(WebCore::JSMessageEvent::data):
* bindings/scripts/CodeGeneratorJS.pm:
(NativeToJSValue): Remove special case for MessagePortArray.
* bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp:
* bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.h:
(WebDOMTestSerializedScriptValueInterface):
* bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
(webkit_dom_test_serialized_script_value_interface_get_property):
(webkit_dom_test_serialized_script_value_interface_class_init):
* bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::jsTestSerializedScriptValueInterfacePorts):
* bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h:
* bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm:
* bindings/scripts/test/TestSerializedScriptValueInterface.idl: Replace MessagePortArray
by MessagePort[].
* dom/MessageEvent.h:
(WebCore::MessageEvent::ports): The method should return a Vector, not a Vector*
as the array on _javascript_ side is not nullable.
* dom/MessageEvent.idl: Replace MessagePortArray by MessagePort[].

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (150579 => 150580)


--- trunk/Source/WebCore/ChangeLog	2013-05-23 10:32:51 UTC (rev 150579)
+++ trunk/Source/WebCore/ChangeLog	2013-05-23 12:22:23 UTC (rev 150580)
@@ -1,3 +1,38 @@
+2013-05-23  Christophe Dumez  <ch.du...@sisa.samsung.com>
+
+        Remove special case for MessagePortArray from bindings generator
+        https://bugs.webkit.org/show_bug.cgi?id=116653
+
+        Reviewed by Kentaro Hara.
+
+        Use MessagePort[] instead of MessagePortArray type in the IDL as MessagePortArray
+        is not defined on IDL side. This allows us to remove the special case for
+        MessagePortArray from the bindings generator.
+
+        No new tests, no behavior change.
+
+        * bindings/js/JSMessageEventCustom.cpp:
+        (WebCore::JSMessageEvent::data):
+        * bindings/scripts/CodeGeneratorJS.pm:
+        (NativeToJSValue): Remove special case for MessagePortArray.
+        * bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp:
+        * bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.h:
+        (WebDOMTestSerializedScriptValueInterface):
+        * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
+        (webkit_dom_test_serialized_script_value_interface_get_property):
+        (webkit_dom_test_serialized_script_value_interface_class_init):
+        * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h:
+        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
+        (WebCore::jsTestSerializedScriptValueInterfacePorts):
+        * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h:
+        * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm:
+        * bindings/scripts/test/TestSerializedScriptValueInterface.idl: Replace MessagePortArray
+        by MessagePort[].
+        * dom/MessageEvent.h:
+        (WebCore::MessageEvent::ports): The method should return a Vector, not a Vector*
+        as the array on _javascript_ side is not nullable.
+        * dom/MessageEvent.idl: Replace MessagePortArray by MessagePort[].
+
 2013-05-23  Michał Pakuła vel Rutka  <m.pak...@samsung.com>
 
         [EFL] Back, Forward and Stop should be hidden in context menu

Modified: trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp (150579 => 150580)


--- trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp	2013-05-23 10:32:51 UTC (rev 150579)
+++ trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp	2013-05-23 12:22:23 UTC (rev 150580)
@@ -63,8 +63,8 @@
 
     case MessageEvent::DataTypeSerializedScriptValue:
         if (RefPtr<SerializedScriptValue> serializedValue = event->dataAsSerializedScriptValue()) {
-            MessagePortArray* ports = static_cast<MessageEvent*>(impl())->ports();
-            result = serializedValue->deserialize(exec, globalObject(), ports, NonThrowing);
+            MessagePortArray ports = static_cast<MessageEvent*>(impl())->ports();
+            result = serializedValue->deserialize(exec, globalObject(), &ports, NonThrowing);
         }
         else
             result = jsNull();

Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (150579 => 150580)


--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2013-05-23 10:32:51 UTC (rev 150579)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm	2013-05-23 12:22:23 UTC (rev 150580)
@@ -3585,6 +3585,7 @@
             AddToImplIncludes("${arrayOrSequenceType}.h", $conditional);
         }
         AddToImplIncludes("<runtime/JSArray.h>", $conditional);
+
         return "jsArray(exec, $thisValue->globalObject(), $value)";
     }
 
@@ -3602,11 +3603,6 @@
     } elsif ($type eq "SerializedScriptValue" or $type eq "any") {
         AddToImplIncludes("SerializedScriptValue.h", $conditional);
         return "$value ? $value->deserialize(exec, castedThis->globalObject(), 0) : jsNull()";
-    } elsif ($type eq "MessagePortArray") {
-        AddToImplIncludes("MessagePort.h", $conditional);
-        AddToImplIncludes("JSMessagePort.h", $conditional);
-        AddToImplIncludes("<runtime/JSArray.h>", $conditional);
-        return "$value ? jsArray(exec, $globalObject, *$value) : constructEmptyArray(exec, 0, castedThis->globalObject())";
     } else {
         # Default, include header with same name.
         AddToImplIncludes("JS$type.h", $conditional);

Modified: trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp (150579 => 150580)


--- trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp	2013-05-23 10:32:51 UTC (rev 150579)
+++ trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp	2013-05-23 12:22:23 UTC (rev 150580)
@@ -24,10 +24,8 @@
 
 #include "WebDOMTestSerializedScriptValueInterface.h"
 
-#include "MessagePortArray.h"
 #include "SerializedScriptValue.h"
 #include "TestSerializedScriptValueInterface.h"
-#include "WebDOMMessagePortArray.h"
 #include "WebExceptionHandler.h"
 #include <wtf/GetPtr.h>
 #include <wtf/RefPtr.h>
@@ -117,14 +115,6 @@
     impl()->setCachedValue(WebCore::SerializedScriptValue::create(WTF::String(newCachedValue)));
 }
 
-WebDOMMessagePortArray WebDOMTestSerializedScriptValueInterface::ports() const
-{
-    if (!impl())
-        return WebDOMMessagePortArray();
-
-    return toWebKit(WTF::getPtr(impl()->ports()));
-}
-
 WebDOMString WebDOMTestSerializedScriptValueInterface::cachedReadonlyValue() const
 {
     if (!impl())

Modified: trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.h (150579 => 150580)


--- trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.h	2013-05-23 10:32:51 UTC (rev 150579)
+++ trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.h	2013-05-23 12:22:23 UTC (rev 150580)
@@ -32,7 +32,6 @@
 class TestSerializedScriptValueInterface;
 };
 
-class WebDOMMessagePortArray;
 class WebDOMString;
 
 class WebDOMTestSerializedScriptValueInterface : public WebDOMObject {
@@ -48,7 +47,6 @@
     WebDOMString readonlyValue() const;
     WebDOMString cachedValue() const;
     void setCachedValue(const WebDOMString&);
-    WebDOMMessagePortArray ports() const;
     WebDOMString cachedReadonlyValue() const;
 
     WebCore::TestSerializedScriptValueInterface* impl() const;

Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp (150579 => 150580)


--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp	2013-05-23 10:32:51 UTC (rev 150579)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp	2013-05-23 12:22:23 UTC (rev 150580)
@@ -25,7 +25,6 @@
 #include "DOMObjectCache.h"
 #include "ExceptionCode.h"
 #include "JSMainThreadExecState.h"
-#include "WebKitDOMMessagePortArrayPrivate.h"
 #include "WebKitDOMPrivate.h"
 #include "WebKitDOMSerializedScriptValuePrivate.h"
 #include "WebKitDOMTestSerializedScriptValueInterfacePrivate.h"
@@ -78,7 +77,6 @@
     PROP_VALUE,
     PROP_READONLY_VALUE,
     PROP_CACHED_VALUE,
-    PROP_PORTS,
     PROP_CACHED_READONLY_VALUE,
 };
 
@@ -130,16 +128,6 @@
 #endif /* ENABLE(Condition1) || ENABLE(Condition2) */
         break;
     }
-    case PROP_PORTS: {
-#if ENABLE(Condition1) || ENABLE(Condition2)
-        RefPtr<WebCore::MessagePortArray> ptr = coreSelf->ports();
-        g_value_set_object(value, WebKit::kit(ptr.get()));
-#else
-        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
-        WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")
-#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
-        break;
-    }
     case PROP_CACHED_READONLY_VALUE: {
 #if ENABLE(Condition1) || ENABLE(Condition2)
         RefPtr<WebCore::SerializedScriptValue> ptr = coreSelf->cachedReadonlyValue();
@@ -197,13 +185,6 @@
                                                            WEBKIT_TYPE_DOM_SERIALIZED_SCRIPT_VALUE, /* gobject type */
                                                            WEBKIT_PARAM_READWRITE));
     g_object_class_install_property(gobjectClass,
-                                    PROP_PORTS,
-                                    g_param_spec_object("ports", /* name */
-                                                           "test_serialized_script_value_interface_ports", /* short description */
-                                                           "read-only  WebKitDOMMessagePortArray* TestSerializedScriptValueInterface.ports", /* longer - could do with some extra doc stuff here */
-                                                           WEBKIT_TYPE_DOM_MESSAGE_PORT_ARRAY, /* gobject type */
-                                                           WEBKIT_PARAM_READABLE));
-    g_object_class_install_property(gobjectClass,
                                     PROP_CACHED_READONLY_VALUE,
                                     g_param_spec_object("cached-readonly-value", /* name */
                                                            "test_serialized_script_value_interface_cached-readonly-value", /* short description */
@@ -298,22 +279,6 @@
 #endif /* ENABLE(Condition1) || ENABLE(Condition2) */
 }
 
-WebKitDOMMessagePortArray*
-webkit_dom_test_serialized_script_value_interface_get_ports(WebKitDOMTestSerializedScriptValueInterface* self)
-{
-#if ENABLE(Condition1) || ENABLE(Condition2)
-    WebCore::JSMainThreadNullState state;
-    g_return_val_if_fail(WEBKIT_DOM_IS_TEST_SERIALIZED_SCRIPT_VALUE_INTERFACE(self), 0);
-    WebCore::TestSerializedScriptValueInterface* item = WebKit::core(self);
-    RefPtr<WebCore::MessagePortArray> gobjectResult = WTF::getPtr(item->ports());
-    return WebKit::kit(gobjectResult.get());
-#else
-    WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")
-    WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")
-    return 0;
-#endif /* ENABLE(Condition1) || ENABLE(Condition2) */
-}
-
 WebKitDOMSerializedScriptValue*
 webkit_dom_test_serialized_script_value_interface_get_cached_readonly_value(WebKitDOMTestSerializedScriptValueInterface* self)
 {

Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h (150579 => 150580)


--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h	2013-05-23 10:32:51 UTC (rev 150579)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h	2013-05-23 12:22:23 UTC (rev 150580)
@@ -102,16 +102,6 @@
 webkit_dom_test_serialized_script_value_interface_set_cached_value(WebKitDOMTestSerializedScriptValueInterface* self, WebKitDOMSerializedScriptValue* value);
 
 /**
- * webkit_dom_test_serialized_script_value_interface_get_ports:
- * @self: A #WebKitDOMTestSerializedScriptValueInterface
- *
- * Returns: (transfer none):
- *
-**/
-WEBKIT_API WebKitDOMMessagePortArray*
-webkit_dom_test_serialized_script_value_interface_get_ports(WebKitDOMTestSerializedScriptValueInterface* self);
-
-/**
  * webkit_dom_test_serialized_script_value_interface_get_cached_readonly_value:
  * @self: A #WebKitDOMTestSerializedScriptValueInterface
  *

Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp (150579 => 150580)


--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp	2013-05-23 10:32:51 UTC (rev 150579)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp	2013-05-23 12:22:23 UTC (rev 150580)
@@ -179,7 +179,7 @@
     JSTestSerializedScriptValueInterface* castedThis = jsCast<JSTestSerializedScriptValueInterface*>(asObject(slotBase));
     UNUSED_PARAM(exec);
     TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl());
-    JSValue result = impl->ports() ? jsArray(exec, castedThis->globalObject(), *impl->ports()) : constructEmptyArray(exec, 0, castedThis->globalObject());
+    JSValue result = jsArray(exec, castedThis->globalObject(), impl->ports());
     return result;
 }
 

Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h (150579 => 150580)


--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h	2013-05-23 10:32:51 UTC (rev 150579)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h	2013-05-23 12:22:23 UTC (rev 150580)
@@ -28,14 +28,12 @@
 
 #if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST
 
-@class DOMMessagePortArray;
 @class NSString;
 
 @interface DOMTestSerializedScriptValueInterface : DOMObject
 @property(retain) NSString *value;
 @property(readonly, retain) NSString *readonlyValue;
 @property(retain) NSString *cachedValue;
-@property(readonly, retain) DOMMessagePortArray *ports;
 @property(readonly, retain) NSString *cachedReadonlyValue;
 @end
 

Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm (150579 => 150580)


--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm	2013-05-23 10:32:51 UTC (rev 150579)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm	2013-05-23 12:22:23 UTC (rev 150580)
@@ -36,13 +36,11 @@
 #import "DOMCSSRuleInternal.h"
 #import "DOMCSSValueInternal.h"
 #import "DOMEventInternal.h"
-#import "DOMMessagePortArrayInternal.h"
 #import "DOMNodeInternal.h"
 #import "DOMStyleSheetInternal.h"
 #import "DOMTestSerializedScriptValueInterfaceInternal.h"
 #import "ExceptionHandlers.h"
 #import "JSMainThreadExecState.h"
-#import "MessagePortArray.h"
 #import "SerializedScriptValue.h"
 #import "TestSerializedScriptValueInterface.h"
 #import "ThreadCheck.h"
@@ -105,12 +103,6 @@
     IMPL->setCachedValue(WebCore::SerializedScriptValue::create(WTF::String(newCachedValue)));
 }
 
-- (DOMMessagePortArray *)ports
-{
-    WebCore::JSMainThreadNullState state;
-    return kit(WTF::getPtr(IMPL->ports()));
-}
-
 - (NSString *)cachedReadonlyValue
 {
     WebCore::JSMainThreadNullState state;

Modified: trunk/Source/WebCore/bindings/scripts/test/TestSerializedScriptValueInterface.idl (150579 => 150580)


--- trunk/Source/WebCore/bindings/scripts/test/TestSerializedScriptValueInterface.idl	2013-05-23 10:32:51 UTC (rev 150579)
+++ trunk/Source/WebCore/bindings/scripts/test/TestSerializedScriptValueInterface.idl	2013-05-23 12:22:23 UTC (rev 150580)
@@ -31,6 +31,6 @@
     attribute SerializedScriptValue value;
     readonly attribute SerializedScriptValue readonlyValue;
     [CachedAttribute] attribute SerializedScriptValue cachedValue;
-    readonly attribute MessagePortArray ports;
+    readonly attribute MessagePort[] ports;
     [CachedAttribute] readonly attribute SerializedScriptValue cachedReadonlyValue;
 };

Modified: trunk/Source/WebCore/dom/MessageEvent.h (150579 => 150580)


--- trunk/Source/WebCore/dom/MessageEvent.h	2013-05-23 10:32:51 UTC (rev 150579)
+++ trunk/Source/WebCore/dom/MessageEvent.h	2013-05-23 12:22:23 UTC (rev 150580)
@@ -88,7 +88,7 @@
     const String& origin() const { return m_origin; }
     const String& lastEventId() const { return m_lastEventId; }
     DOMWindow* source() const { return m_source.get(); }
-    MessagePortArray* ports() const { return m_ports.get(); }
+    MessagePortArray ports() const { return m_ports ? *m_ports : MessagePortArray(); }
 
     // FIXME: Remove this when we have custom ObjC binding support.
     SerializedScriptValue* data() const;

Modified: trunk/Source/WebCore/dom/MessageEvent.idl (150579 => 150580)


--- trunk/Source/WebCore/dom/MessageEvent.idl	2013-05-23 10:32:51 UTC (rev 150579)
+++ trunk/Source/WebCore/dom/MessageEvent.idl	2013-05-23 12:22:23 UTC (rev 150580)
@@ -34,7 +34,7 @@
     [InitializedByEventConstructor] readonly attribute DOMWindow source;
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
     [InitializedByEventConstructor, CachedAttribute, CustomGetter] readonly attribute any data;
-    [InitializedByEventConstructor] readonly attribute MessagePortArray ports;
+    [InitializedByEventConstructor] readonly attribute MessagePort[] ports;
 
     [Custom] void initMessageEvent([Default=Undefined] optional DOMString typeArg, 
                                    [Default=Undefined] optional boolean canBubbleArg, 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to