Changeset 150580 in webkit
- Timestamp:
- May 23, 2013 5:22:23 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r150575 r150580 1 2013-05-23 Christophe Dumez <ch.dumez@sisa.samsung.com> 2 3 Remove special case for MessagePortArray from bindings generator 4 https://bugs.webkit.org/show_bug.cgi?id=116653 5 6 Reviewed by Kentaro Hara. 7 8 Use MessagePort[] instead of MessagePortArray type in the IDL as MessagePortArray 9 is not defined on IDL side. This allows us to remove the special case for 10 MessagePortArray from the bindings generator. 11 12 No new tests, no behavior change. 13 14 * bindings/js/JSMessageEventCustom.cpp: 15 (WebCore::JSMessageEvent::data): 16 * bindings/scripts/CodeGeneratorJS.pm: 17 (NativeToJSValue): Remove special case for MessagePortArray. 18 * bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp: 19 * bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.h: 20 (WebDOMTestSerializedScriptValueInterface): 21 * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp: 22 (webkit_dom_test_serialized_script_value_interface_get_property): 23 (webkit_dom_test_serialized_script_value_interface_class_init): 24 * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h: 25 * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: 26 (WebCore::jsTestSerializedScriptValueInterfacePorts): 27 * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h: 28 * bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm: 29 * bindings/scripts/test/TestSerializedScriptValueInterface.idl: Replace MessagePortArray 30 by MessagePort[]. 31 * dom/MessageEvent.h: 32 (WebCore::MessageEvent::ports): The method should return a Vector, not a Vector* 33 as the array on JavaScript side is not nullable. 34 * dom/MessageEvent.idl: Replace MessagePortArray by MessagePort[]. 35 1 36 2013-05-23 Michał Pakuła vel Rutka <m.pakula@samsung.com> 2 37 -
trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp
r150249 r150580 64 64 case MessageEvent::DataTypeSerializedScriptValue: 65 65 if (RefPtr<SerializedScriptValue> serializedValue = event->dataAsSerializedScriptValue()) { 66 MessagePortArray *ports = static_cast<MessageEvent*>(impl())->ports();67 result = serializedValue->deserialize(exec, globalObject(), ports, NonThrowing);66 MessagePortArray ports = static_cast<MessageEvent*>(impl())->ports(); 67 result = serializedValue->deserialize(exec, globalObject(), &ports, NonThrowing); 68 68 } 69 69 else -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm
r150292 r150580 3586 3586 } 3587 3587 AddToImplIncludes("<runtime/JSArray.h>", $conditional); 3588 3588 3589 return "jsArray(exec, $thisValue->globalObject(), $value)"; 3589 3590 } … … 3603 3604 AddToImplIncludes("SerializedScriptValue.h", $conditional); 3604 3605 return "$value ? $value->deserialize(exec, castedThis->globalObject(), 0) : jsNull()"; 3605 } elsif ($type eq "MessagePortArray") {3606 AddToImplIncludes("MessagePort.h", $conditional);3607 AddToImplIncludes("JSMessagePort.h", $conditional);3608 AddToImplIncludes("<runtime/JSArray.h>", $conditional);3609 return "$value ? jsArray(exec, $globalObject, *$value) : constructEmptyArray(exec, 0, castedThis->globalObject())";3610 3606 } else { 3611 3607 # Default, include header with same name. -
trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.cpp
r149935 r150580 25 25 #include "WebDOMTestSerializedScriptValueInterface.h" 26 26 27 #include "MessagePortArray.h"28 27 #include "SerializedScriptValue.h" 29 28 #include "TestSerializedScriptValueInterface.h" 30 #include "WebDOMMessagePortArray.h"31 29 #include "WebExceptionHandler.h" 32 30 #include <wtf/GetPtr.h> … … 118 116 } 119 117 120 WebDOMMessagePortArray WebDOMTestSerializedScriptValueInterface::ports() const121 {122 if (!impl())123 return WebDOMMessagePortArray();124 125 return toWebKit(WTF::getPtr(impl()->ports()));126 }127 128 118 WebDOMString WebDOMTestSerializedScriptValueInterface::cachedReadonlyValue() const 129 119 { -
trunk/Source/WebCore/bindings/scripts/test/CPP/WebDOMTestSerializedScriptValueInterface.h
r149729 r150580 33 33 }; 34 34 35 class WebDOMMessagePortArray;36 35 class WebDOMString; 37 36 … … 49 48 WebDOMString cachedValue() const; 50 49 void setCachedValue(const WebDOMString&); 51 WebDOMMessagePortArray ports() const;52 50 WebDOMString cachedReadonlyValue() const; 53 51 -
trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp
r149729 r150580 26 26 #include "ExceptionCode.h" 27 27 #include "JSMainThreadExecState.h" 28 #include "WebKitDOMMessagePortArrayPrivate.h"29 28 #include "WebKitDOMPrivate.h" 30 29 #include "WebKitDOMSerializedScriptValuePrivate.h" … … 79 78 PROP_READONLY_VALUE, 80 79 PROP_CACHED_VALUE, 81 PROP_PORTS,82 80 PROP_CACHED_READONLY_VALUE, 83 81 }; … … 124 122 #if ENABLE(Condition1) || ENABLE(Condition2) 125 123 RefPtr<WebCore::SerializedScriptValue> ptr = coreSelf->cachedValue(); 126 g_value_set_object(value, WebKit::kit(ptr.get()));127 #else128 WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")129 WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")130 #endif /* ENABLE(Condition1) || ENABLE(Condition2) */131 break;132 }133 case PROP_PORTS: {134 #if ENABLE(Condition1) || ENABLE(Condition2)135 RefPtr<WebCore::MessagePortArray> ptr = coreSelf->ports();136 124 g_value_set_object(value, WebKit::kit(ptr.get())); 137 125 #else … … 198 186 WEBKIT_PARAM_READWRITE)); 199 187 g_object_class_install_property(gobjectClass, 200 PROP_PORTS,201 g_param_spec_object("ports", /* name */202 "test_serialized_script_value_interface_ports", /* short description */203 "read-only WebKitDOMMessagePortArray* TestSerializedScriptValueInterface.ports", /* longer - could do with some extra doc stuff here */204 WEBKIT_TYPE_DOM_MESSAGE_PORT_ARRAY, /* gobject type */205 WEBKIT_PARAM_READABLE));206 g_object_class_install_property(gobjectClass,207 188 PROP_CACHED_READONLY_VALUE, 208 189 g_param_spec_object("cached-readonly-value", /* name */ … … 299 280 } 300 281 301 WebKitDOMMessagePortArray*302 webkit_dom_test_serialized_script_value_interface_get_ports(WebKitDOMTestSerializedScriptValueInterface* self)303 {304 #if ENABLE(Condition1) || ENABLE(Condition2)305 WebCore::JSMainThreadNullState state;306 g_return_val_if_fail(WEBKIT_DOM_IS_TEST_SERIALIZED_SCRIPT_VALUE_INTERFACE(self), 0);307 WebCore::TestSerializedScriptValueInterface* item = WebKit::core(self);308 RefPtr<WebCore::MessagePortArray> gobjectResult = WTF::getPtr(item->ports());309 return WebKit::kit(gobjectResult.get());310 #else311 WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition1")312 WEBKIT_WARN_FEATURE_NOT_PRESENT("Condition2")313 return 0;314 #endif /* ENABLE(Condition1) || ENABLE(Condition2) */315 }316 317 282 WebKitDOMSerializedScriptValue* 318 283 webkit_dom_test_serialized_script_value_interface_get_cached_readonly_value(WebKitDOMTestSerializedScriptValueInterface* self) -
trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.h
r149729 r150580 103 103 104 104 /** 105 * webkit_dom_test_serialized_script_value_interface_get_ports:106 * @self: A #WebKitDOMTestSerializedScriptValueInterface107 *108 * Returns: (transfer none):109 *110 **/111 WEBKIT_API WebKitDOMMessagePortArray*112 webkit_dom_test_serialized_script_value_interface_get_ports(WebKitDOMTestSerializedScriptValueInterface* self);113 114 /**115 105 * webkit_dom_test_serialized_script_value_interface_get_cached_readonly_value: 116 106 * @self: A #WebKitDOMTestSerializedScriptValueInterface -
trunk/Source/WebCore/bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp
r150249 r150580 180 180 UNUSED_PARAM(exec); 181 181 TestSerializedScriptValueInterface* impl = static_cast<TestSerializedScriptValueInterface*>(castedThis->impl()); 182 JSValue result = impl->ports() ? jsArray(exec, castedThis->globalObject(), *impl->ports()) : constructEmptyArray(exec, 0, castedThis->globalObject());182 JSValue result = jsArray(exec, castedThis->globalObject(), impl->ports()); 183 183 return result; 184 184 } -
trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.h
r149729 r150580 29 29 #if WEBKIT_VERSION_MAX_ALLOWED >= WEBKIT_VERSION_LATEST 30 30 31 @class DOMMessagePortArray;32 31 @class NSString; 33 32 … … 36 35 @property(readonly, retain) NSString *readonlyValue; 37 36 @property(retain) NSString *cachedValue; 38 @property(readonly, retain) DOMMessagePortArray *ports;39 37 @property(readonly, retain) NSString *cachedReadonlyValue; 40 38 @end -
trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestSerializedScriptValueInterface.mm
r149729 r150580 37 37 #import "DOMCSSValueInternal.h" 38 38 #import "DOMEventInternal.h" 39 #import "DOMMessagePortArrayInternal.h"40 39 #import "DOMNodeInternal.h" 41 40 #import "DOMStyleSheetInternal.h" … … 43 42 #import "ExceptionHandlers.h" 44 43 #import "JSMainThreadExecState.h" 45 #import "MessagePortArray.h"46 44 #import "SerializedScriptValue.h" 47 45 #import "TestSerializedScriptValueInterface.h" … … 106 104 } 107 105 108 - (DOMMessagePortArray *)ports109 {110 WebCore::JSMainThreadNullState state;111 return kit(WTF::getPtr(IMPL->ports()));112 }113 114 106 - (NSString *)cachedReadonlyValue 115 107 { -
trunk/Source/WebCore/bindings/scripts/test/TestSerializedScriptValueInterface.idl
r149729 r150580 32 32 readonly attribute SerializedScriptValue readonlyValue; 33 33 [CachedAttribute] attribute SerializedScriptValue cachedValue; 34 readonly attribute MessagePort Arrayports;34 readonly attribute MessagePort[] ports; 35 35 [CachedAttribute] readonly attribute SerializedScriptValue cachedReadonlyValue; 36 36 }; -
trunk/Source/WebCore/dom/MessageEvent.h
r145930 r150580 89 89 const String& lastEventId() const { return m_lastEventId; } 90 90 DOMWindow* source() const { return m_source.get(); } 91 MessagePortArray * ports() const { return m_ports.get(); }91 MessagePortArray ports() const { return m_ports ? *m_ports : MessagePortArray(); } 92 92 93 93 // FIXME: Remove this when we have custom ObjC binding support. -
trunk/Source/WebCore/dom/MessageEvent.idl
r150249 r150580 35 35 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT 36 36 [InitializedByEventConstructor, CachedAttribute, CustomGetter] readonly attribute any data; 37 [InitializedByEventConstructor] readonly attribute MessagePort Arrayports;37 [InitializedByEventConstructor] readonly attribute MessagePort[] ports; 38 38 39 39 [Custom] void initMessageEvent([Default=Undefined] optional DOMString typeArg,
Note: See TracChangeset
for help on using the changeset viewer.