Remove webkitPostMessage
authorabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Jan 2013 22:14:28 +0000 (22:14 +0000)
committerabarth@webkit.org <abarth@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Jan 2013 22:14:28 +0000 (22:14 +0000)
https://bugs.webkit.org/show_bug.cgi?id=105910

Reviewed by Kentaro Hara.

The vendor-prefixed version of postMessage was never widely used.
We've been compiling it out of the Chromium port for a while now and
haven't received any reports of compatibility problems. I've done a
number of web searches for uses of the API and personally contacted a
handful of authors I found using the API, all of whom have now moved to
the identical unprefixed API. We've publicied the prefix removal in a
blog post:

http://blog.chromium.org/2012/11/a-web-developers-guide-to-latest-chrome.html

and discussed it on webkit-dev:

http://lists.macosforge.org/pipermail/webkit-dev/2012-September/022189.html

We've done our diligence, and now we should remove the API from the
remainder of the ports.

* bindings/js/JSDOMWindowCustom.cpp:
* bindings/js/JSDedicatedWorkerContextCustom.cpp:
* bindings/js/JSMessagePortCustom.cpp:
* bindings/js/JSWorkerCustom.cpp:
* bindings/v8/custom/V8DOMWindowCustom.cpp:
(WebCore::V8DOMWindow::postMessageCallback):
* bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp:
(WebCore::V8DedicatedWorkerContext::postMessageCallback):
* bindings/v8/custom/V8MessagePortCustom.cpp:
(WebCore::V8MessagePort::postMessageCallback):
* bindings/v8/custom/V8WorkerCustom.cpp:
(WebCore::V8Worker::postMessageCallback):
* dom/MessagePort.idl:
* page/DOMWindow.idl:
* workers/DedicatedWorkerContext.idl:
* workers/Worker.idl:

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

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
Source/WebCore/bindings/js/JSDedicatedWorkerContextCustom.cpp
Source/WebCore/bindings/js/JSMessagePortCustom.cpp
Source/WebCore/bindings/js/JSWorkerCustom.cpp
Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp
Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp
Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp
Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp
Source/WebCore/dom/MessagePort.idl
Source/WebCore/page/DOMWindow.idl
Source/WebCore/workers/DedicatedWorkerContext.idl
Source/WebCore/workers/Worker.idl

index 29a32e3..409c665 100644 (file)
@@ -1,3 +1,44 @@
+2013-01-02  Adam Barth  <abarth@webkit.org>
+
+        Remove webkitPostMessage
+        https://bugs.webkit.org/show_bug.cgi?id=105910
+
+        Reviewed by Kentaro Hara.
+
+        The vendor-prefixed version of postMessage was never widely used.
+        We've been compiling it out of the Chromium port for a while now and
+        haven't received any reports of compatibility problems. I've done a
+        number of web searches for uses of the API and personally contacted a
+        handful of authors I found using the API, all of whom have now moved to
+        the identical unprefixed API. We've publicied the prefix removal in a
+        blog post:
+
+        http://blog.chromium.org/2012/11/a-web-developers-guide-to-latest-chrome.html
+
+        and discussed it on webkit-dev:
+
+        http://lists.macosforge.org/pipermail/webkit-dev/2012-September/022189.html
+
+        We've done our diligence, and now we should remove the API from the
+        remainder of the ports.
+
+        * bindings/js/JSDOMWindowCustom.cpp:
+        * bindings/js/JSDedicatedWorkerContextCustom.cpp:
+        * bindings/js/JSMessagePortCustom.cpp:
+        * bindings/js/JSWorkerCustom.cpp:
+        * bindings/v8/custom/V8DOMWindowCustom.cpp:
+        (WebCore::V8DOMWindow::postMessageCallback):
+        * bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp:
+        (WebCore::V8DedicatedWorkerContext::postMessageCallback):
+        * bindings/v8/custom/V8MessagePortCustom.cpp:
+        (WebCore::V8MessagePort::postMessageCallback):
+        * bindings/v8/custom/V8WorkerCustom.cpp:
+        (WebCore::V8Worker::postMessageCallback):
+        * dom/MessagePort.idl:
+        * page/DOMWindow.idl:
+        * workers/DedicatedWorkerContext.idl:
+        * workers/Worker.idl:
+
 2013-01-02  Benjamin Poulain  <benjamin@webkit.org>
 
         Optimize TransformationMatrix::multiply() for x86_64
index 1378801..25b5339 100644 (file)
@@ -693,13 +693,6 @@ JSValue JSDOMWindow::postMessage(ExecState* exec)
     return handlePostMessage(impl(), exec);
 }
 
-#if ENABLE(LEGACY_VENDOR_PREFIXES)
-JSValue JSDOMWindow::webkitPostMessage(ExecState* exec)
-{
-    return handlePostMessage(impl(), exec);
-}
-#endif
-
 JSValue JSDOMWindow::setTimeout(ExecState* exec)
 {
     ContentSecurityPolicy* contentSecurityPolicy = impl()->document() ? impl()->document()->contentSecurityPolicy() : 0;
index 791e6a5..a2571e0 100644 (file)
@@ -47,13 +47,6 @@ JSC::JSValue JSDedicatedWorkerContext::postMessage(JSC::ExecState* exec)
     return handlePostMessage(exec, impl());
 }
 
-#if ENABLE(LEGACY_VENDOR_PREFIXES)
-JSC::JSValue JSDedicatedWorkerContext::webkitPostMessage(JSC::ExecState* exec)
-{
-    return handlePostMessage(exec, impl());
-}
-#endif
-
 } // namespace WebCore
 
 #endif // ENABLE(WORKERS)
index 5b17632..cf546bf 100644 (file)
@@ -63,13 +63,6 @@ JSC::JSValue JSMessagePort::postMessage(JSC::ExecState* exec)
     return handlePostMessage(exec, impl());
 }
 
-#if ENABLE(LEGACY_VENDOR_PREFIXES)
-JSC::JSValue JSMessagePort::webkitPostMessage(JSC::ExecState* exec)
-{
-    return handlePostMessage(exec, impl());
-}
-#endif
-
 void fillMessagePortArray(JSC::ExecState* exec, JSC::JSValue value, MessagePortArray& portArray, ArrayBufferArray& arrayBuffers)
 {
     // Convert from the passed-in JS array-like object to a MessagePortArray.
index 944c009..0dcc67d 100644 (file)
@@ -45,13 +45,6 @@ JSC::JSValue JSWorker::postMessage(JSC::ExecState* exec)
     return handlePostMessage(exec, impl());
 }
 
-#if ENABLE(LEGACY_VENDOR_PREFIXES)
-JSC::JSValue JSWorker::webkitPostMessage(JSC::ExecState* exec)
-{
-    return handlePostMessage(exec, impl());
-}
-#endif
-
 EncodedJSValue JSC_HOST_CALL JSWorkerConstructor::constructJSWorker(ExecState* exec)
 {
     JSWorkerConstructor* jsConstructor = jsCast<JSWorkerConstructor*>(exec->callee());
index 829fa62..a33564c 100644 (file)
@@ -295,8 +295,10 @@ static bool isLegacyTargetOriginDesignation(v8::Handle<v8::Value> value)
 }
 
 
-static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args)
+v8::Handle<v8::Value> V8DOMWindow::postMessageCallback(const v8::Arguments& args)
 {
+    INC_STATS("DOM.DOMWindow.postMessage()");
+
     // None of these need to be RefPtr because args and context are guaranteed
     // to hold on to them.
     DOMWindow* window = V8DOMWindow::toNative(args.Holder());
@@ -341,20 +343,6 @@ static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args
     return setDOMException(ec, args.GetIsolate());
 }
 
-v8::Handle<v8::Value> V8DOMWindow::postMessageCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.DOMWindow.postMessage()");
-    return handlePostMessageCallback(args);
-}
-
-#if ENABLE(LEGACY_VENDOR_PREFIXES)
-v8::Handle<v8::Value> V8DOMWindow::webkitPostMessageCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.DOMWindow.webkitPostMessage()");
-    return handlePostMessageCallback(args);
-}
-#endif
-
 // FIXME(fqian): returning string is cheating, and we should
 // fix this by calling toString function on the receiver.
 // However, V8 implements toString in JavaScript, which requires
index 7d18a44..a605ef2 100644 (file)
 
 namespace WebCore {
 
-static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args)
+v8::Handle<v8::Value> V8DedicatedWorkerContext::postMessageCallback(const v8::Arguments& args)
 {
+    INC_STATS("DOM.DedicatedWorkerContext.postMessage");
+
     DedicatedWorkerContext* workerContext = V8DedicatedWorkerContext::toNative(args.Holder());
     MessagePortArray ports;
     ArrayBufferArray arrayBuffers;
@@ -64,20 +66,6 @@ static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args
     return setDOMException(ec, args.GetIsolate());
 }
 
-v8::Handle<v8::Value> V8DedicatedWorkerContext::postMessageCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.DedicatedWorkerContext.postMessage");
-    return handlePostMessageCallback(args);
-}
-
-#if ENABLE(LEGACY_VENDOR_PREFIXES)
-v8::Handle<v8::Value> V8DedicatedWorkerContext::webkitPostMessageCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.DedicatedWorkerContext.postMessage");
-    return handlePostMessageCallback(args);
-}
-#endif
-
 } // namespace WebCore
 
 #endif // ENABLE(WORKERS)
index c35c998..c594856 100644 (file)
 
 namespace WebCore {
 
-static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args)
+v8::Handle<v8::Value> V8MessagePort::postMessageCallback(const v8::Arguments& args)
 {
+    INC_STATS("DOM.MessagePort.postMessage");
+
     MessagePort* messagePort = V8MessagePort::toNative(args.Holder());
     MessagePortArray portArray;
     ArrayBufferArray arrayBufferArray;
@@ -63,18 +65,4 @@ static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args
     return setDOMException(ec, args.GetIsolate());
 }
 
-v8::Handle<v8::Value> V8MessagePort::postMessageCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.MessagePort.postMessage");
-    return handlePostMessageCallback(args);
-}
-
-#if ENABLE(LEGACY_VENDOR_PREFIXES)
-v8::Handle<v8::Value> V8MessagePort::webkitPostMessageCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.MessagePort.webkitPostMessage");
-    return handlePostMessageCallback(args);
-}
-#endif
-
 } // namespace WebCore
index e455819..4a28a42 100644 (file)
 
 namespace WebCore {
 
-static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args)
+v8::Handle<v8::Value> V8Worker::postMessageCallback(const v8::Arguments& args)
 {
     INC_STATS("DOM.Worker.postMessage");
+
     Worker* worker = V8Worker::toNative(args.Holder());
     MessagePortArray ports;
     ArrayBufferArray arrayBuffers;
@@ -69,20 +70,6 @@ static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args
     return setDOMException(ec, args.GetIsolate());
 }
 
-v8::Handle<v8::Value> V8Worker::postMessageCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.Worker.postMessage");
-    return handlePostMessageCallback(args);
-}
-
-#if ENABLE(LEGACY_VENDOR_PREFIXES)
-v8::Handle<v8::Value> V8Worker::webkitPostMessageCallback(const v8::Arguments& args)
-{
-    INC_STATS("DOM.Worker.webkitPostMessage");
-    return handlePostMessageCallback(args);
-}
-#endif
-
 } // namespace WebCore
 
 #endif // ENABLE(WORKERS)
index ebb0dd6..bbd48c0 100644 (file)
     [Custom] void postMessage(in any message, in [Optional] Array messagePorts)
         raises(DOMException);
 
-#if defined(ENABLE_LEGACY_VENDOR_PREFIXES) && ENABLE_LEGACY_VENDOR_PREFIXES
-    [Custom] void webkitPostMessage(in any message, in [Optional] Array transfer)
-        raises(DOMException);
-#endif // defined(ENABLE_LEGACY_VENDOR_PREFIXES) && ENABLE_LEGACY_VENDOR_PREFIXES
-
     void start();
     void close();
 
index 0b4bdea..05b3ee7 100644 (file)
         raises(DOMException);
     [DoNotCheckSecurity, Custom] void postMessage(in SerializedScriptValue message, in DOMString targetOrigin, in Array messagePorts)
         raises(DOMException);
-
-#if defined(ENABLE_LEGACY_VENDOR_PREFIXES) && ENABLE_LEGACY_VENDOR_PREFIXES
-    [DoNotCheckSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in DOMString targetOrigin)
-        raises(DOMException);
-    [DoNotCheckSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in DOMString targetOrigin, in Array transferList)
-        raises(DOMException);
-#endif // defined(ENABLE_LEGACY_VENDOR_PREFIXES) && ENABLE_LEGACY_VENDOR_PREFIXES
-
 #else
     // There's no good way to expose an array via the ObjC bindings, so for now just allow passing in a single port.
     [DoNotCheckSecurity, Custom] void postMessage(in SerializedScriptValue message, in [Optional] MessagePort messagePort, in DOMString targetOrigin)
index 9b6494e..72bcc03 100644 (file)
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
     [Custom] void postMessage(in any message, in [Optional] Array messagePorts)
         raises(DOMException);
-
-#if defined(ENABLE_LEGACY_VENDOR_PREFIXES) && ENABLE_LEGACY_VENDOR_PREFIXES
-    [Custom] void webkitPostMessage(in any message, in [Optional] Array transferList)
-        raises(DOMException);
-#endif // defined(ENABLE_LEGACY_VENDOR_PREFIXES) && ENABLE_LEGACY_VENDOR_PREFIXES
-
 #else
     // There's no good way to expose an array via the ObjC bindings, so for now just allow passing in a single port.
     void postMessage(in DOMString message, in [Optional] MessagePort messagePort)
index af7fcf8..f70750d 100644 (file)
 #if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
     [Custom] void postMessage(in SerializedScriptValue message, in [Optional] Array messagePorts)
         raises(DOMException);
-
-#if defined(ENABLE_LEGACY_VENDOR_PREFIXES) && ENABLE_LEGACY_VENDOR_PREFIXES
-    [Custom] void webkitPostMessage(in SerializedScriptValue message, in [Optional] Array messagePorts)
-        raises(DOMException);
-#endif // defined(ENABLE_LEGACY_VENDOR_PREFIXES) && ENABLE_LEGACY_VENDOR_PREFIXES
-
 #else
     // There's no good way to expose an array via the ObjC bindings, so for now just allow passing in a single port.
     void postMessage(in SerializedScriptValue message, in [Optional] MessagePort messagePort)