Give embedders a chance to handle postMessage calls
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Jan 2012 04:38:42 +0000 (04:38 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Jan 2012 04:38:42 +0000 (04:38 +0000)
commit485d8c9acd4acac2c6d994b87f05963c893ad394
tree2c289cdbd377b5bb224f10ca22d6c92eb4ec8fa3
parent8a0ab5ba2b078a1ace7a4e30d16163f788fa1576
Give embedders a chance to handle postMessage calls
https://bugs.webkit.org/show_bug.cgi?id=73883

Source/WebCore:

To support cross-process postMessage calls in Chromium (bug 73337), we need to intercept
postMessage calls to proxy windows. Originally we were just going to add a native event
listener on the Chromium side, but that required more changes to WebKit and was a bit of
a hack. See bug 73359 for a discuss about moving to this approach.

Patch by Karl Koscher <supersat@chromium.org> on 2012-01-03
Reviewed by Adam Barth.

Test: platform/chromium/fast/events/intercept-postmessage.html

* loader/FrameLoaderClient.h:
(WebCore::FrameLoaderClient::willCheckAndDispatchPostMessage): new method to allow the
    embedder to intercept postMessage calls
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessageTimerFired): add a call to
    FrameLoaderClient::willCheckAndDispatchPostMessage

Source/WebKit/chromium:

Patch by Karl Koscher <supersat@chromium.org> on 2012-01-03
Reviewed by Adam Barth.

* public/WebFrameClient.h:
(WebKit::WebFrameClient::willCheckAndDispatchMessageEvent):
    interface to give the embedder a chance to handle this postMessage call
* src/FrameLoaderClientImpl.cpp:
(WebKit::FrameLoaderClientImpl::willCheckAndDispatchMessageEvent): Call
    willCheckAndDispatchMessageEvent on WebFrameClient
* src/FrameLoaderClientImpl.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@104005 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
LayoutTests/platform/chromium/fast/events/intercept-postmessage-expected.txt [new file with mode: 0644]
LayoutTests/platform/chromium/fast/events/intercept-postmessage.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/loader/FrameLoaderClient.h
Source/WebCore/page/DOMWindow.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebDOMMessageEvent.h
Source/WebKit/chromium/public/WebFrameClient.h
Source/WebKit/chromium/src/FrameLoaderClientImpl.cpp
Source/WebKit/chromium/src/FrameLoaderClientImpl.h
Tools/DumpRenderTree/chromium/LayoutTestController.cpp
Tools/DumpRenderTree/chromium/LayoutTestController.h
Tools/DumpRenderTree/chromium/WebViewHost.cpp
Tools/DumpRenderTree/chromium/WebViewHost.h