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

Unified Diff: content/browser/message_port_service.h

Issue 737833002: Properly queue messages sent to message ports that are transferred to a service worker. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cross_process_messaging_with_terminate
Patch Set: format and comment Created 6 years, 1 month 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 | « content/browser/message_port_message_filter.cc ('k') | content/browser/message_port_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/message_port_service.h
diff --git a/content/browser/message_port_service.h b/content/browser/message_port_service.h
index 668959167f724e79ebfd914042438fb0128b5060..12ba53820c376996a53defa4b0d79be9bf32455c 100644
--- a/content/browser/message_port_service.h
+++ b/content/browser/message_port_service.h
@@ -37,6 +37,7 @@ class MessagePortService {
void QueueMessages(int message_port_id);
void SendQueuedMessages(int message_port_id,
const QueuedMessages& queued_messages);
+ void ReleaseMessages(int message_port_id);
// Updates the information needed to reach a message port when it's sent to a
// (possibly different) process.
@@ -45,6 +46,20 @@ class MessagePortService {
MessagePortMessageFilter* filter,
int routing_id);
+ // The message port is being transferred to a new renderer process, but the
+ // code doing that isn't able to immediately update the message port with a
+ // new filter and routing_id. This queues up all messages sent to this port
+ // until later ReleaseMessages is called for this port (this will happen
+ // automatically as soon as a WebMessagePortChannelImpl instance is created
+ // for this port in the renderer. The browser side code is still responsible
+ // for updating the port with a new filter before that happens. If ultimately
+ // transfering the port to a new process fails, ClosePort should be called to
+ // clean up the port.
+ void HoldMessages(int message_port_id);
+
+ // Closes and cleans up the message port.
+ void ClosePort(int message_port_id);
+
void OnMessagePortMessageFilterClosing(MessagePortMessageFilter* filter);
// Attempts to send the queued messages for a message port.
« no previous file with comments | « content/browser/message_port_message_filter.cc ('k') | content/browser/message_port_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698