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

Unified Diff: Source/web/WebDOMMessageEvent.cpp

Issue 185643009: Implement ServiceWorker::postMessage() [Blink] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Pass raw pointer -> PassOwnPtr Created 6 years, 9 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/web/ServiceWorkerGlobalScopeProxy.cpp ('k') | public/platform/WebMessagePortChannel.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 53c928c53b99c2843e313a28f68111d9ec191698..ad76f7f0b5379341bc60a5d5d4e99dfb7eb91fc4 100644
--- a/Source/web/WebDOMMessageEvent.cpp
+++ b/Source/web/WebDOMMessageEvent.cpp
@@ -53,12 +53,8 @@ void WebDOMMessageEvent::initMessageEvent(const WebString& type, bool canBubble,
if (sourceFrame)
window = toWebFrameImpl(sourceFrame)->frame()->domWindow();
OwnPtr<MessagePortArray> ports;
- if (!webChannels.isEmpty() && sourceFrame) {
- OwnPtr<MessagePortChannelArray> channels = adoptPtr(new MessagePortChannelArray(webChannels.size()));
- for (size_t i = 0; i < webChannels.size(); ++i)
- (*channels)[i] = adoptPtr(webChannels[i]);
- ports = MessagePort::entanglePorts(*window->document(), channels.release());
- }
+ if (sourceFrame)
+ ports = MessagePort::toMessagePortArray(window->document(), webChannels);
unwrap<MessageEvent>()->initMessageEvent(type, canBubble, cancelable, messageData, origin, lastEventId, window, ports.release());
}
« no previous file with comments | « Source/web/ServiceWorkerGlobalScopeProxy.cpp ('k') | public/platform/WebMessagePortChannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698