Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1974)

Unified Diff: Source/web/WebDOMMessageEvent.cpp

Issue 24739002: Enable sending MessagePorts to a different renderer (Blink side) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: The Real Fix (no proof of concept any more) Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/frame/DOMWindow.cpp ('k') | public/web/WebDOMMessageEvent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebDOMMessageEvent.cpp
diff --git a/Source/web/WebDOMMessageEvent.cpp b/Source/web/WebDOMMessageEvent.cpp
index 452f70e5a1667948809dc47361ef52f5ca142863..bbb9554976848582f73294c15c64c37567dc4d08 100644
--- a/Source/web/WebDOMMessageEvent.cpp
+++ b/Source/web/WebDOMMessageEvent.cpp
@@ -45,7 +45,7 @@ using namespace WebCore;
namespace WebKit {
-void WebDOMMessageEvent::initMessageEvent(const WebString& type, bool canBubble, bool cancelable, const WebSerializedScriptValue& messageData, const WebString& origin, const WebFrame* sourceFrame, const WebString& lastEventId)
+void WebDOMMessageEvent::initMessageEvent(const WebString& type, bool canBubble, bool cancelable, const WebSerializedScriptValue& messageData, const WebString& origin, const WebFrame* sourceFrame, const WebString& lastEventId, const WebMessagePortChannelArray& webChannels)
{
ASSERT(m_private.get());
ASSERT(isMessageEvent());
@@ -53,6 +53,12 @@ void WebDOMMessageEvent::initMessageEvent(const WebString& type, bool canBubble,
if (sourceFrame)
window = toWebFrameImpl(sourceFrame)->frame()->domWindow();
OwnPtr<MessagePortArray> ports;
+ if (webChannels.size() > 0 && sourceFrame) {
jochen (gone - plz use gerrit) 2013/10/16 00:03:20 nit. !webChannels.isEmpty()
marja 2013/10/16 08:19:04 Done.
+ OwnPtr<MessagePortChannelArray> channels = adoptPtr(new MessagePortChannelArray(webChannels.size()));
+ for (size_t i = 0; i < webChannels.size(); ++i)
+ (*channels)[i] = MessagePortChannel::create(webChannels[i]);
+ ports = MessagePort::entanglePorts(*window->document(), channels.release());
+ }
unwrap<MessageEvent>()->initMessageEvent(type, canBubble, cancelable, messageData, origin, lastEventId, window, ports.release());
}
@@ -66,4 +72,13 @@ WebString WebDOMMessageEvent::origin() const
return WebString(constUnwrap<MessageEvent>()->origin());
}
+WebMessagePortChannelArray WebDOMMessageEvent::releaseChannels()
+{
+ MessagePortChannelArray channels = constUnwrap<MessageEvent>()->channels();
+ WebMessagePortChannelArray webChannels(channels.size());
+ for (size_t i = 0; i < channels.size(); ++i)
+ webChannels[i] = channels[i]->webChannelRelease();
+ return webChannels;
+}
+
} // namespace WebKit
« no previous file with comments | « Source/core/frame/DOMWindow.cpp ('k') | public/web/WebDOMMessageEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698