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

Unified Diff: webkit/api/src/PlatformMessagePortChannel.cpp

Issue 173193: Updating Worker.postMessage(), DOMWindow.postMessage(), and... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 4 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 | « webkit/api/public/WebWorkerClient.h ('k') | webkit/glue/webworker_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/api/src/PlatformMessagePortChannel.cpp
===================================================================
--- webkit/api/src/PlatformMessagePortChannel.cpp (revision 23787)
+++ webkit/api/src/PlatformMessagePortChannel.cpp (working copy)
@@ -179,14 +179,17 @@
return;
WebString messageString = message->message();
- OwnPtr<WebCore::MessagePortChannel> channel = message->channel();
- WebMessagePortChannel* webChannel = NULL;
- if (channel.get()) {
- WebCore::PlatformMessagePortChannel* platformChannel = channel->channel();
- webChannel = platformChannel->webChannelRelease();
- webChannel->setClient(0);
+ OwnPtr<WebCore::MessagePortChannelArray> channels = message->channels();
+ WebMessagePortChannelArray* webChannels = NULL;
+ if (channels.get() && channels->size()) {
+ webChannels = new WebMessagePortChannelArray(channels->size());
+ for (size_t i = 0; i < channels->size(); ++i) {
+ WebCore::PlatformMessagePortChannel* platformChannel = (*channels)[i]->channel();
+ (*webChannels)[i] = platformChannel->webChannelRelease();
+ (*webChannels)[i]->setClient(0);
+ }
}
- m_webChannel->postMessage(messageString, webChannel);
+ m_webChannel->postMessage(messageString, webChannels);
}
bool PlatformMessagePortChannel::tryGetMessageFromRemote(OwnPtr<MessagePortChannel::EventData>& result)
@@ -195,16 +198,19 @@
return false;
WebString message;
- WebMessagePortChannel* webChannel = NULL;
- bool rv = m_webChannel->tryGetMessage(&message, &webChannel);
+ WebMessagePortChannelArray webChannels;
+ bool rv = m_webChannel->tryGetMessage(&message, webChannels);
if (rv) {
- OwnPtr<MessagePortChannel> channel;
- if (webChannel) {
- RefPtr<PlatformMessagePortChannel> platformChannel = create(webChannel);
- webChannel->setClient(platformChannel.get());
- channel = MessagePortChannel::create(platformChannel);
+ OwnPtr<MessagePortChannelArray> channels;
+ if (webChannels.size()) {
+ channels = new MessagePortChannelArray(webChannels.size());
+ for (size_t i = 0; i < webChannels.size(); ++i) {
+ RefPtr<PlatformMessagePortChannel> platformChannel = create(webChannels[i]);
+ webChannels[i]->setClient(platformChannel.get());
+ (*channels)[i] = MessagePortChannel::create(platformChannel);
+ }
}
- result = MessagePortChannel::EventData::create(message, channel.release());
+ result = MessagePortChannel::EventData::create(message, channels.release());
}
return rv;
« no previous file with comments | « webkit/api/public/WebWorkerClient.h ('k') | webkit/glue/webworker_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698