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

Unified Diff: content/browser/message_port_message_filter.cc

Issue 246023007: Chromium-side plumbing for ServiceWorker -> Document postMessage (2/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: message port threading fix Created 6 years, 7 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
Index: content/browser/message_port_message_filter.cc
diff --git a/content/browser/message_port_message_filter.cc b/content/browser/message_port_message_filter.cc
index 4fd80453b84cf179dfa7353dea2e201ddf20b540..6de26bd45efe6ae7200b76b432294ca5d21dc420 100644
--- a/content/browser/message_port_message_filter.cc
+++ b/content/browser/message_port_message_filter.cc
@@ -57,6 +57,22 @@ int MessagePortMessageFilter::GetNextRoutingID() {
return next_routing_id_.Run();
}
+void MessagePortMessageFilter::UpdateMessagePortsWithNewRoutes(
+ const std::vector<int>& message_port_ids,
+ std::vector<int>* new_routing_ids) {
+ DCHECK(new_routing_ids);
+ new_routing_ids->clear();
+ new_routing_ids->resize(message_port_ids.size());
+
+ for (size_t i = 0; i < message_port_ids.size(); ++i) {
+ (*new_routing_ids)[i] = GetNextRoutingID();
+ MessagePortService::GetInstance()->UpdateMessagePort(
+ message_port_ids[i],
+ this,
+ (*new_routing_ids)[i]);
+ }
+}
+
void MessagePortMessageFilter::OnCreateMessagePort(int *route_id,
int* message_port_id) {
*route_id = next_routing_id_.Run();

Powered by Google App Engine
This is Rietveld 408576698