Changeset 95362 in webkit


Ignore:
Timestamp:
Sep 16, 2011 9:01:31 PM (13 years ago)
Author:
dslomov@google.com
Message:

Source/WebCore: https://bugs.webkit.org/show_bug.cgi?id=66714
Add webkitPostMessage to allow for adding transferable support.
This adds webkitPostMessage, currently identical to postMessage, which
would later be a vehicle for adding transferable support for messaging.

Based on patch by Luke Zarko.

Reviewed by David Levin.

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::webkitPostMessage):

  • bindings/js/JSDedicatedWorkerContextCustom.cpp:

(WebCore::JSDedicatedWorkerContext::webkitPostMessage):

  • bindings/js/JSMessageEventCustom.cpp:

(WebCore::JSMessageEvent::webkitInitMessageEvent):

  • bindings/js/JSMessagePortCustom.cpp:

(WebCore::JSMessagePort::webkitPostMessage):

  • bindings/js/JSWorkerCustom.cpp:

(WebCore::JSWorker::postMessage):
(WebCore::JSWorker::webkitPostMessage):

  • bindings/v8/custom/V8DOMWindowCustom.cpp:

(WebCore::handlePostMessageCallback):
(WebCore::V8DOMWindow::postMessageCallback):
(WebCore::V8DOMWindow::webkitPostMessageCallback):

  • bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp:

(WebCore::handlePostMessageCallback):
(WebCore::V8DedicatedWorkerContext::postMessageCallback):
(WebCore::V8DedicatedWorkerContext::webkitPostMessageCallback):

  • bindings/v8/custom/V8MessageEventCustom.cpp:

(WebCore::V8MessageEvent::initMessageEventCallback):
(WebCore::V8MessageEvent::webkitInitMessageEventCallback):

  • bindings/v8/custom/V8MessagePortCustom.cpp:

(WebCore::handlePostMessageCallback):
(WebCore::V8MessagePort::postMessageCallback):
(WebCore::V8MessagePort::webkitPostMessageCallback):

  • bindings/v8/custom/V8WorkerCustom.cpp:

(WebCore::handlePostMessageCallback):
(WebCore::V8Worker::postMessageCallback):
(WebCore::V8Worker::webkitPostMessageCallback):

  • dom/MessageEvent.idl:
  • dom/MessagePort.idl:
  • page/DOMWindow.idl:
  • workers/DedicatedWorkerContext.idl:
  • workers/Worker.idl:

LayoutTests: https://bugs.webkit.org/show_bug.cgi?id=66714
Add webkitPostMessage to allow for adding transferable support.
This adds webkitPostMessage, currently identical to postMessage, which
would later be a vehicle for adding transferable support for messaging.
The tests ensure that webkitPostMessage and postMessage behave identically.

Based on patch by Luke Zarko.

Reviewed by David Levin.

  • fast/dom/Window/window-postmessage-args-expected.txt:
  • fast/dom/Window/window-postmessage-args.html:
  • fast/dom/Window/window-property-descriptors-expected.txt:
  • fast/events/message-port-expected.txt:
  • fast/events/message-port.html:
  • fast/workers/resources/worker-call.js:
  • fast/workers/worker-call-expected.txt:
  • platform/chromium/fast/dom/Window/window-postmessage-args-expected.txt:
Location:
trunk
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r95361 r95362  
     12011-09-16  Dmitry Lomov  <dslomov@google.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=66714
     4        Add webkitPostMessage to allow for adding transferable support.
     5        This adds webkitPostMessage, currently identical to postMessage, which
     6        would later be a vehicle for adding transferable support for messaging.
     7        The tests ensure that webkitPostMessage and postMessage behave identically.
     8
     9        Based on patch by Luke Zarko.
     10
     11        Reviewed by David Levin.
     12
     13        * fast/dom/Window/window-postmessage-args-expected.txt:
     14        * fast/dom/Window/window-postmessage-args.html:
     15        * fast/dom/Window/window-property-descriptors-expected.txt:
     16        * fast/events/message-port-expected.txt:
     17        * fast/events/message-port.html:
     18        * fast/workers/resources/worker-call.js:
     19        * fast/workers/worker-call-expected.txt:
     20        * platform/chromium/fast/dom/Window/window-postmessage-args-expected.txt:
     21
    1222011-09-16  Alexei Svitkine  <asvitkine@chromium.org>
    223
  • trunk/LayoutTests/fast/dom/Window/window-postmessage-args-expected.txt

    r93709 r95362  
    22
    33PASS: Posting message ('1', 1): threw exception TypeError: Type error
     4PASS: Posting message ('1', 1): threw exception TypeError: Type error
     5PASS: Posting message ('2', ): threw exception TypeError: Type error
    46PASS: Posting message ('2', ): threw exception TypeError: Type error
    57PASS: Posting message ('3', [object Object]): threw exception TypeError: Type error
     8PASS: Posting message ('3', [object Object]): threw exception TypeError: Type error
     9PASS: Posting message ('4', [object DOMWindow]) did not throw an exception
    610PASS: Posting message ('4', [object DOMWindow]) did not throw an exception
    711PASS: Posting message ('5', null) did not throw an exception
     12PASS: Posting message ('5', null) did not throw an exception
     13PASS: Posting message ('6', undefined) did not throw an exception
    814PASS: Posting message ('6', undefined) did not throw an exception
    915PASS: Posting message ('7', [object MessagePort],[object MessagePort]) did not throw an exception
     16PASS: Posting message ('7', [object MessagePort],[object MessagePort]) did not throw an exception
     17PASS: Posting message ('2147483648', null) did not throw an exception
    1018PASS: Posting message ('2147483648', null) did not throw an exception
    1119PASS: Posting message ('done', *) did not throw an exception
    1220Received message '4' with 0 ports.
     21Received message '4' with 0 ports.
     22Received message '5' with 0 ports.
    1323Received message '5' with 0 ports.
    1424Received message '6' with 0 ports.
     25Received message '6' with 0 ports.
    1526Received message '7' with 2 ports.
     27Received message '7' with 2 ports.
     28Received message '2147483648' with 0 ports.
    1629Received message '2147483648' with 0 ports.
    1730Received message 'done' with 0 ports.
  • trunk/LayoutTests/fast/dom/Window/window-postmessage-args.html

    r74372 r95362  
    2424window.addEventListener('message', onmessage, false);
    2525
    26 function tryPostMessage(first, second, third, shouldFail) {
    27     try {
     26function tryPostMessageFunction(postMessageFunction, first, second, third, shouldFail) {
     27   try {
    2828        if (!third)
    29             window.postMessage(first, second);
     29            postMessageFunction(first, second);
    3030        else
    31             window.postMessage(first, second, third);
     31            postMessageFunction(first, second, third);
    3232        console.innerHTML += (shouldFail ? "FAIL" : "PASS") + ": Posting message ('" + first + "', " + second + ") did not throw an exception<br>";
    3333   } catch (e) {
     
    3636}
    3737
     38function tryPostMessage(first, second, third, shouldFail) {
     39    tryPostMessageFunction(window.postMessage, first, second, third, shouldFail);
     40    tryPostMessageFunction(window.webkitPostMessage, first, second, third, shouldFail);
     41}
     42
    3843document.getElementById("description").innerHTML = "Test that the second argument of window.postMessage is ignored or triggers an error if it is not a message port. You should see PASS message '1' through '7', followed by 'done', with messages 4-7 received below.<br><br>";
    3944
    40 var channel = new MessageChannel;
    4145tryPostMessage('1', 1, '*', true);
    4246tryPostMessage('2', "", '*', true);
     
    4549tryPostMessage('5', null, '*');
    4650tryPostMessage('6', void 0, '*');
    47 tryPostMessage('7', [channel.port1, channel.port2], '*');
     51var channel1 = new MessageChannel;
     52tryPostMessageFunction(window.postMessage, '7', [channel1.port1, channel1.port2], '*');
     53var channel2 = new MessageChannel;
     54tryPostMessageFunction(window.webkitPostMessage, '7', [channel2.port1, channel2.port2], '*');
    4855tryPostMessage(2147483648, null, '*');
    49 tryPostMessage('done', '*');
     56tryPostMessageFunction(window.postMessage, 'done', '*');
    5057</script>
    5158</body>
  • trunk/LayoutTests/fast/dom/Window/window-property-descriptors-expected.txt

    r94415 r95362  
    544544PASS Object.getOwnPropertyDescriptor(window, 'webkitConvertPointFromNodeToPage') is undefined.
    545545PASS Object.getOwnPropertyDescriptor(window, 'webkitConvertPointFromPageToNode') is undefined.
     546PASS Object.getOwnPropertyDescriptor(window, 'webkitPostMessage') is undefined.
    546547PASS successfullyParsed is true
    547548
  • trunk/LayoutTests/fast/events/message-port-expected.txt

    r48395 r95362  
    44
    55Simple exchange: SUCCESS
     6Simple exchange: SUCCESS
     7Posted port: SUCCESS
    68Posted port: SUCCESS
    79Event Listener: SUCCESS
     10Event Listener: SUCCESS
    811Closed port: SUCCESS
     12Closed port: SUCCESS
     13MessageEvent.cancelable defaults to false: PASS
    914MessageEvent.cancelable defaults to false: PASS
    1015DONE
  • trunk/LayoutTests/fast/events/message-port.html

    r48395 r95362  
    1616var mainPort;
    1717
    18 function test()
     18var allTests;
     19var currentTest = 0;
     20
     21function nextTest()
     22{
     23    var fun = currentTest % 2 == 0 ? "postMessage" : "webkitPostMessage";
     24    var testFunNo = Math.floor(currentTest / 2);
     25    if (testFunNo < allTests.length)
     26    {
     27        var test = allTests[testFunNo];
     28        currentTest++;
     29        test(fun);
     30    }
     31    else
     32    {
     33        done();
     34    }
     35}
     36
     37function test(postMessageFun)
    1938{
    2039    var channel = new MessageChannel;
    21     window.frames[0].postMessage("msg", [channel.port2], "*");
     40
     41    window.frames[0][postMessageFun]("msg", [channel.port2], "*");
    2242    mainPort = channel.port1;
    23     mainPort.postMessage("ping");
     43    mainPort[postMessageFun]("ping");
    2444    mainPort.onmessage = function(evt) {
    2545        if (evt.data == "pong" && evt.origin == "")
     
    2747        else
    2848            log("Simple exchange: FAIL. Got message '" + evt.data + "' from '" + evt.origin + "'.");
    29         test2();
     49        nextTest();
    3050    };
    3151}
    3252
    33 function test2()
     53function test2(postMessageFun)
    3454{
    3555    var channel = new MessageChannel;
    36     mainPort.postMessage("newPort", [channel.port2]);
     56    mainPort[postMessageFun]("newPort", [channel.port2]);
    3757    channel.port1.onmessage = function(evt) {
    3858        if (evt.data == "yo" && evt.origin == "")
     
    4060        else
    4161            log("Posted port: FAIL. Got message '" + evt.data + "' from '" + evt.origin + "'.");
    42         test3();
     62        nextTest();
    4363    };
    4464}
    4565
    46 function test3()
     66function test3(postMessageFun)
    4767{
    4868    var channel = new MessageChannel;
    49     channel.port1.postMessage("1");
     69    channel.port1[postMessageFun]("1");
    5070    var started = false;
    5171    channel.port2.addEventListener("message", function(evt) {
    5272        if (started) {
    5373            log("Event Listener: SUCCESS");
    54             test4();
     74            nextTest();
    5575        } else
    5676            log("Event Listener: FAIL. Event listener called before start()");
     
    6383}
    6484
    65 function test4()
     85function test4(postMessageFun)
    6686{
    6787    var channel = new MessageChannel;
    68     channel.port1.postMessage("1");
     88    channel.port1[postMessageFun]("1");
    6989    channel.port1.close();
    70     channel.port1.postMessage("2");
     90    channel.port1[postMessageFun]("2");
    7191    channel.port2.onmessage = function(evt) {
    7292        if (evt.data == "1") {
    7393            log("Closed port: SUCCESS");
    74             test5();
     94            nextTest();
    7595        } else
    7696            log("Closed port: FAIL. Got message: " + evt.data + " after close");
     
    7898}
    7999
    80 function test5()
     100function test5(postMessageFun)
    81101{
    82102    // Create a channel and put some messages in it which will go undelivered and should not leak
    83103    var channel = new MessageChannel;
    84     channel.port1.postMessage("abcde");
    85     test6();
     104    channel.port1[postMessageFun]("abcde");
     105    nextTest();
    86106}
    87107
    88 function test6()
     108function test6(postMessageFun)
    89109{
    90110    var channel = new MessageChannel;
    91     channel.port1.postMessage("howdy");
     111    channel.port1[postMessageFun]("howdy");
    92112    channel.port2.onmessage = function(event) {
    93113        log("MessageEvent.cancelable defaults to " + event.cancelable + ": " + (event.cancelable ? "FAIL" : "PASS"));
    94         done();
     114        nextTest();
    95115    }
    96116}
     
    105125}
    106126
     127allTests = [ test, test2, test3, test4, test5, test6 ]
     128
    107129</script>
    108 <iframe src="resources/message-port-iframe.html" onload="test()"></iframe>
     130<iframe src="resources/message-port-iframe.html" onload="nextTest()"></iframe>
    109131</body>
  • trunk/LayoutTests/fast/workers/resources/worker-call.js

    r46371 r95362  
    11postMessage("SUCCESS: postMessage() called directly");
     2webkitPostMessage("SUCCESS: webkitPostMessage() called directly");
    23postMessage.call(null, "SUCCESS: postMessage() invoked via postMessage.call()");
     4webkitPostMessage.call(null, "SUCCESS: webkitPostMessage() invoked via webkitPostMessage.call()");
    35var saved = postMessage;
    46saved("SUCCESS: postMessage() called via intermediate variable");
     7var saved1 = webkitPostMessage;
     8saved1("SUCCESS: webkitPostMessage() called via intermediate variable");
    59postMessage("DONE");
  • trunk/LayoutTests/fast/workers/worker-call-expected.txt

    r46371 r95362  
    22
    33SUCCESS: postMessage() called directly
     4SUCCESS: webkitPostMessage() called directly
    45SUCCESS: postMessage() invoked via postMessage.call()
     6SUCCESS: webkitPostMessage() invoked via webkitPostMessage.call()
    57SUCCESS: postMessage() called via intermediate variable
     8SUCCESS: webkitPostMessage() called via intermediate variable
    69DONE
    710
  • trunk/LayoutTests/platform/chromium/fast/dom/Window/window-postmessage-args-expected.txt

    r93709 r95362  
    22
    33PASS: Posting message ('1', 1): threw exception TypeError: MessagePortArray argument must be an object
     4PASS: Posting message ('1', 1): threw exception TypeError: MessagePortArray argument must be an object
     5PASS: Posting message ('2', ): threw exception TypeError: MessagePortArray argument must be an object
    46PASS: Posting message ('2', ): threw exception TypeError: MessagePortArray argument must be an object
    57PASS: Posting message ('3', [object Object]): threw exception TypeError: MessagePortArray argument has no length attribute
     8PASS: Posting message ('3', [object Object]): threw exception TypeError: MessagePortArray argument has no length attribute
     9PASS: Posting message ('4', [object DOMWindow]) did not throw an exception
    610PASS: Posting message ('4', [object DOMWindow]) did not throw an exception
    711PASS: Posting message ('5', null) did not throw an exception
     12PASS: Posting message ('5', null) did not throw an exception
     13PASS: Posting message ('6', undefined) did not throw an exception
    814PASS: Posting message ('6', undefined) did not throw an exception
    915PASS: Posting message ('7', [object MessagePort],[object MessagePort]) did not throw an exception
     16PASS: Posting message ('7', [object MessagePort],[object MessagePort]) did not throw an exception
     17PASS: Posting message ('2147483648', null) did not throw an exception
    1018PASS: Posting message ('2147483648', null) did not throw an exception
    1119PASS: Posting message ('done', *) did not throw an exception
    1220Received message '4' with 0 ports.
     21Received message '4' with 0 ports.
     22Received message '5' with 0 ports.
    1323Received message '5' with 0 ports.
    1424Received message '6' with 0 ports.
     25Received message '6' with 0 ports.
    1526Received message '7' with 2 ports.
     27Received message '7' with 2 ports.
     28Received message '2147483648' with 0 ports.
    1629Received message '2147483648' with 0 ports.
    1730Received message 'done' with 0 ports.
  • trunk/LayoutTests/platform/chromium/fast/dom/prototype-inheritance-expected.txt

    r94385 r95362  
    4646FAIL inner.webkitIndexedDB.isInner should be true. Was false.
    4747FAIL inner.webkitIndexedDB.constructor.isInner should be true. Was false.
     48FAIL inner.webkitPostMessage.isInner should be true. Was false.
     49FAIL inner.webkitPostMessage.constructor.isInner should be true. Was false.
    4850PASS successfullyParsed is true
    4951
  • trunk/Source/WebCore/ChangeLog

    r95361 r95362  
     12011-09-16  Dmitry Lomov  <dslomov@google.com>
     2
     3        https://bugs.webkit.org/show_bug.cgi?id=66714
     4        Add webkitPostMessage to allow for adding transferable support.
     5        This adds webkitPostMessage, currently identical to postMessage, which
     6        would later be a vehicle for adding transferable support for messaging.
     7       
     8        Based on patch by Luke Zarko.
     9
     10        Reviewed by David Levin.
     11
     12        * bindings/js/JSDOMWindowCustom.cpp:
     13        (WebCore::JSDOMWindow::webkitPostMessage):
     14        * bindings/js/JSDedicatedWorkerContextCustom.cpp:
     15        (WebCore::JSDedicatedWorkerContext::webkitPostMessage):
     16        * bindings/js/JSMessageEventCustom.cpp:
     17        (WebCore::JSMessageEvent::webkitInitMessageEvent):
     18        * bindings/js/JSMessagePortCustom.cpp:
     19        (WebCore::JSMessagePort::webkitPostMessage):
     20        * bindings/js/JSWorkerCustom.cpp:
     21        (WebCore::JSWorker::postMessage):
     22        (WebCore::JSWorker::webkitPostMessage):
     23        * bindings/v8/custom/V8DOMWindowCustom.cpp:
     24        (WebCore::handlePostMessageCallback):
     25        (WebCore::V8DOMWindow::postMessageCallback):
     26        (WebCore::V8DOMWindow::webkitPostMessageCallback):
     27        * bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp:
     28        (WebCore::handlePostMessageCallback):
     29        (WebCore::V8DedicatedWorkerContext::postMessageCallback):
     30        (WebCore::V8DedicatedWorkerContext::webkitPostMessageCallback):
     31        * bindings/v8/custom/V8MessageEventCustom.cpp:
     32        (WebCore::V8MessageEvent::initMessageEventCallback):
     33        (WebCore::V8MessageEvent::webkitInitMessageEventCallback):
     34        * bindings/v8/custom/V8MessagePortCustom.cpp:
     35        (WebCore::handlePostMessageCallback):
     36        (WebCore::V8MessagePort::postMessageCallback):
     37        (WebCore::V8MessagePort::webkitPostMessageCallback):
     38        * bindings/v8/custom/V8WorkerCustom.cpp:
     39        (WebCore::handlePostMessageCallback):
     40        (WebCore::V8Worker::postMessageCallback):
     41        (WebCore::V8Worker::webkitPostMessageCallback):
     42        * dom/MessageEvent.idl:
     43        * dom/MessagePort.idl:
     44        * page/DOMWindow.idl:
     45        * workers/DedicatedWorkerContext.idl:
     46        * workers/Worker.idl:
     47
    1482011-09-16  Alexei Svitkine  <asvitkine@chromium.org>
    249
  • trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp

    r93567 r95362  
    11/*
    22 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
     3 * Copyright (C) 2011 Google Inc. All rights reserved.
    34 *
    45 * This library is free software; you can redistribute it and/or
     
    725726}
    726727
     728JSValue JSDOMWindow::webkitPostMessage(ExecState* exec)
     729{
     730    return postMessage(exec);
     731}
     732
    727733JSValue JSDOMWindow::setTimeout(ExecState* exec)
    728734{
  • trunk/Source/WebCore/bindings/js/JSDedicatedWorkerContextCustom.cpp

    r60392 r95362  
    11/*
    2  * Copyright (C) 2009 Google Inc. All rights reserved.
    32 * Copyright (C) 2009 Apple, Inc. All rights reserved.
     3 * Copyright (C) 2009, 2011 Google Inc. All rights reserved.
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    4848}
    4949
     50JSC::JSValue JSDedicatedWorkerContext::webkitPostMessage(JSC::ExecState* exec)
     51{
     52    return handlePostMessage(exec, impl());
     53}
     54
    5055} // namespace WebCore
    5156
  • trunk/Source/WebCore/bindings/js/JSMessageEventCustom.cpp

    r94929 r95362  
    120120}
    121121
     122JSC::JSValue JSMessageEvent::webkitInitMessageEvent(JSC::ExecState* exec)
     123{
     124    return initMessageEvent(exec);
     125}
     126
    122127} // namespace WebCore
  • trunk/Source/WebCore/bindings/js/JSMessagePortCustom.cpp

    r93986 r95362  
    11/*
    22 * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved.
     3 * Copyright (C) 2011 Google Inc. All Rights Reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    6162}
    6263
     64JSC::JSValue JSMessagePort::webkitPostMessage(JSC::ExecState* exec)
     65{
     66    return handlePostMessage(exec, impl());
     67}
     68
    6369void fillMessagePortArray(JSC::ExecState* exec, JSC::JSValue value, MessagePortArray& portArray)
    6470{
  • trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp

    r93336 r95362  
    11/*
    22 * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved.
     3 * Copyright (C) 2011 Google Inc. All Rights Reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    4546}
    4647
     48JSC::JSValue JSWorker::webkitPostMessage(JSC::ExecState* exec)
     49{
     50    return handlePostMessage(exec, impl());
     51}
     52
    4753EncodedJSValue JSC_HOST_CALL JSWorkerConstructor::constructJSWorker(ExecState* exec)
    4854{
  • trunk/Source/WebCore/bindings/v8/custom/V8DOMWindowCustom.cpp

    r86067 r95362  
    11/*
    2  * Copyright (C) 2009 Google Inc. All rights reserved.
     2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    314314}
    315315
    316 v8::Handle<v8::Value> V8DOMWindow::postMessageCallback(const v8::Arguments& args)
    317 {
    318     INC_STATS("DOM.DOMWindow.postMessage()");
     316static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args)
     317{
    319318    DOMWindow* window = V8DOMWindow::toNative(args.Holder());
    320319
     
    351350}
    352351
     352v8::Handle<v8::Value> V8DOMWindow::postMessageCallback(const v8::Arguments& args)
     353{
     354    INC_STATS("DOM.DOMWindow.postMessage()");
     355    return handlePostMessageCallback(args);
     356}
     357
     358v8::Handle<v8::Value> V8DOMWindow::webkitPostMessageCallback(const v8::Arguments& args)
     359{
     360    INC_STATS("DOM.DOMWindow.webkitPostMessage()");
     361    return handlePostMessageCallback(args);
     362}
     363
    353364// FIXME(fqian): returning string is cheating, and we should
    354365// fix this by calling toString function on the receiver.
  • trunk/Source/WebCore/bindings/v8/custom/V8DedicatedWorkerContextCustom.cpp

    r57207 r95362  
    11/*
    2  * Copyright (C) 2009 Google Inc. All rights reserved.
     2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4343namespace WebCore {
    4444
    45 v8::Handle<v8::Value> V8DedicatedWorkerContext::postMessageCallback(const v8::Arguments& args)
     45static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args)
    4646{
    47     INC_STATS(L"DOM.DedicatedWorkerContext.postMessage");
    4847    DedicatedWorkerContext* workerContext = V8DedicatedWorkerContext::toNative(args.Holder());
    4948    bool didThrow = false;
     
    6160}
    6261
     62v8::Handle<v8::Value> V8DedicatedWorkerContext::postMessageCallback(const v8::Arguments& args)
     63{
     64    INC_STATS(L"DOM.DedicatedWorkerContext.postMessage");
     65    return handlePostMessageCallback(args);
     66}
     67
     68v8::Handle<v8::Value> V8DedicatedWorkerContext::webkitPostMessageCallback(const v8::Arguments& args)
     69{
     70    INC_STATS(L"DOM.DedicatedWorkerContext.postMessage");
     71    return handlePostMessageCallback(args);
     72}
     73
    6374} // namespace WebCore
    6475
  • trunk/Source/WebCore/bindings/v8/custom/V8MessageEventCustom.cpp

    r94161 r95362  
    126126    SerializedScriptValue::deserializeAndSetProperty(args.Holder(), "data", dataAttr, event->dataAsSerializedScriptValue());
    127127    return v8::Undefined();
    128   }
     128}
     129
     130v8::Handle<v8::Value> V8MessageEvent::webkitInitMessageEventCallback(const v8::Arguments& args)
     131{
     132    INC_STATS("DOM.MessageEvent.webkitInitMessageEvent");
     133    return initMessageEventCallback(args);
     134}
     135
    129136
    130137} // namespace WebCore
  • trunk/Source/WebCore/bindings/v8/custom/V8MessagePortCustom.cpp

    r93986 r95362  
    11/*
    2  * Copyright (C) 2009 Google Inc. All rights reserved.
     2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4343namespace WebCore {
    4444
    45 v8::Handle<v8::Value> V8MessagePort::postMessageCallback(const v8::Arguments& args)
     45static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args)
    4646{
    47     INC_STATS("DOM.MessagePort.postMessage");
    4847    MessagePort* messagePort = V8MessagePort::toNative(args.Holder());
    4948    bool didThrow = false;
     
    5958    messagePort->postMessage(message.release(), &portArray, ec);
    6059    return throwError(ec);
     60}
     61
     62v8::Handle<v8::Value> V8MessagePort::postMessageCallback(const v8::Arguments& args)
     63{
     64    INC_STATS("DOM.MessagePort.postMessage");
     65    return handlePostMessageCallback(args);
     66}
     67
     68v8::Handle<v8::Value> V8MessagePort::webkitPostMessageCallback(const v8::Arguments& args)
     69{
     70    INC_STATS("DOM.MessagePort.webkitPostMessage");
     71    return handlePostMessageCallback(args);
    6172}
    6273
  • trunk/Source/WebCore/bindings/v8/custom/V8WorkerCustom.cpp

    r94381 r95362  
    4848namespace WebCore {
    4949
    50 v8::Handle<v8::Value> V8Worker::postMessageCallback(const v8::Arguments& args)
     50static v8::Handle<v8::Value> handlePostMessageCallback(const v8::Arguments& args)
    5151{
    5252    INC_STATS("DOM.Worker.postMessage");
     
    6666}
    6767
     68v8::Handle<v8::Value> V8Worker::postMessageCallback(const v8::Arguments& args)
     69{
     70    INC_STATS("DOM.Worker.postMessage");
     71    return handlePostMessageCallback(args);
     72}
     73
     74v8::Handle<v8::Value> V8Worker::webkitPostMessageCallback(const v8::Arguments& args)
     75{
     76    INC_STATS("DOM.Worker.webkitPostMessage");
     77    return handlePostMessageCallback(args);
     78}
     79
     80
    6881} // namespace WebCore
    6982
  • trunk/Source/WebCore/dom/MessageEvent.idl

    r93766 r95362  
    11/*
    22 * Copyright (C) 2007 Henry Mason <hmason@mac.com>
     3 * Copyright (C) 2011 Google Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    4546                                       in [Optional=CallWithDefaultValue] DOMWindow sourceArg,
    4647                                       in [Optional=CallWithDefaultValue] Array messagePorts);
     48
     49        [Custom] void webkitInitMessageEvent(in [Optional=CallWithDefaultValue] DOMString typeArg,
     50                                             in [Optional=CallWithDefaultValue] boolean canBubbleArg,
     51                                             in [Optional=CallWithDefaultValue] boolean cancelableArg,
     52                                             in [Optional=CallWithDefaultValue] SerializedScriptValue dataArg,
     53                                             in [Optional=CallWithDefaultValue] DOMString originArg,
     54                                             in [Optional=CallWithDefaultValue] DOMString lastEventIdArg,
     55                                             in [Optional=CallWithDefaultValue] DOMWindow sourceArg,
     56                                             in [Optional=CallWithDefaultValue] Array transferables);
    4757#else
    4858        // Code generator for ObjC bindings does not support custom bindings, thus there is no good way to
  • trunk/Source/WebCore/dom/MessagePort.idl

    r92433 r95362  
    11/*
    22 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
     3 * Copyright (C) 2011 Google Inc. All Rights Reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    3940        [Custom] void postMessage(in DOMString message, in [Optional] Array messagePorts)
    4041            raises(DOMException);
     42        [Custom] void webkitPostMessage(in DOMString message, in [Optional] Array transfer)
     43            raises(DOMException);
    4144        void start();
    4245        void close();
  • trunk/Source/WebCore/page/DOMWindow.idl

    r95271 r95362  
    11/*
    22 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
     3 * Copyright (C) 2011 Google Inc. All rights reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    215216#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
    216217        [DoNotCheckDomainSecurity, Custom] void postMessage(in SerializedScriptValue message, in [Optional] Array messagePorts, in DOMString targetOrigin)
     218            raises(DOMException);
     219        [DoNotCheckDomainSecurity, Custom] void webkitPostMessage(in SerializedScriptValue message, in [Optional] Array transferList, in DOMString targetOrigin)
    217220            raises(DOMException);
    218221#else
  • trunk/Source/WebCore/workers/DedicatedWorkerContext.idl

    r92458 r95362  
    11/*
    2  * Copyright (C) 2009 Google Inc. All rights reserved.
     2 * Copyright (C) 2009, 2011 Google Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    4444        [Custom] void postMessage(in any message, in [Optional] Array messagePorts)
    4545            raises(DOMException);
     46        [Custom] void webkitPostMessage(in any message, in [Optional] Array transferList)
     47            raises(DOMException);
    4648#else
    4749        // There's no good way to expose an array via the ObjC bindings, so for now just allow passing in a single port.
  • trunk/Source/WebCore/workers/Worker.idl

    r94381 r95362  
    11/*
    22 * Copyright (C) 2008, 2010 Apple Inc. All Rights Reserved.
     3 * Copyright (C) 2011 Google Inc. All Rights Reserved.
    34 *
    45 * Redistribution and use in source and binary forms, with or without
     
    4647        [Custom] void postMessage(in SerialisedScriptValue message, in [Optional] Array messagePorts)
    4748            raises(DOMException);
     49        [Custom] void webkitPostMessage(in SerialisedScriptValue message, in [Optional] Array messagePorts)
     50            raises(DOMException);
    4851#else
    4952        // There's no good way to expose an array via the ObjC bindings, so for now just allow passing in a single port.
Note: See TracChangeset for help on using the changeset viewer.