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

Unified Diff: chrome/browser/worker_host/worker_process_host.cc

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 | « chrome/browser/worker_host/message_port_dispatcher.cc ('k') | chrome/common/webmessageportchannel_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/worker_host/worker_process_host.cc
===================================================================
--- chrome/browser/worker_host/worker_process_host.cc (revision 23787)
+++ chrome/browser/worker_host/worker_process_host.cc (working copy)
@@ -5,6 +5,7 @@
#include "chrome/browser/worker_host/worker_process_host.h"
#include <set>
+#include <vector>
#include "base/command_line.h"
#include "base/debug_util.h"
@@ -232,21 +233,22 @@
// We want to send the receiver a routing id for the new channel, so
// crack the message first.
string16 msg;
- int sent_message_port_id = MSG_ROUTING_NONE;
- int new_routing_id = MSG_ROUTING_NONE;
+ std::vector<int> sent_message_port_ids;
+ std::vector<int> new_routing_ids;
if (!WorkerMsg_PostMessage::Read(
- &message, &msg, &sent_message_port_id, &new_routing_id)) {
+ &message, &msg, &sent_message_port_ids, &new_routing_ids)) {
return;
}
+ DCHECK(sent_message_port_ids.size() == new_routing_ids.size());
- if (sent_message_port_id != MSG_ROUTING_NONE) {
- new_routing_id = next_route_id->Run();
+ for (size_t i = 0; i < sent_message_port_ids.size(); ++i) {
+ new_routing_ids[i] = next_route_id->Run();
MessagePortDispatcher::GetInstance()->UpdateMessagePort(
- sent_message_port_id, sender, new_routing_id, next_route_id);
+ sent_message_port_ids[i], sender, new_routing_ids[i], next_route_id);
}
new_message = new WorkerMsg_PostMessage(
- route_id, msg, sent_message_port_id, new_routing_id);
+ route_id, msg, sent_message_port_ids, new_routing_ids);
} else {
new_message = new IPC::Message(message);
new_message->set_routing_id(route_id);
« no previous file with comments | « chrome/browser/worker_host/message_port_dispatcher.cc ('k') | chrome/common/webmessageportchannel_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698