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

Unified Diff: content/child/webmessageportchannel_impl.cc

Issue 1110103003: Initial implementation of stashed message ports, content side (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nicer dchecks Created 5 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
« no previous file with comments | « content/child/webmessageportchannel_impl.h ('k') | content/common/service_worker/service_worker_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/webmessageportchannel_impl.cc
diff --git a/content/child/webmessageportchannel_impl.cc b/content/child/webmessageportchannel_impl.cc
index 332959f25b32771a5733a28e93f460c0097c631c..7db904dae990db5332640ca79d3ed49c41651928 100644
--- a/content/child/webmessageportchannel_impl.cc
+++ b/content/child/webmessageportchannel_impl.cc
@@ -29,6 +29,7 @@ WebMessagePortChannelImpl::WebMessagePortChannelImpl(
route_id_(MSG_ROUTING_NONE),
message_port_id_(MSG_ROUTING_NONE),
send_messages_as_values_(false),
+ is_stashed_(false),
main_thread_task_runner_(main_thread_task_runner) {
AddRef();
Init();
@@ -42,6 +43,7 @@ WebMessagePortChannelImpl::WebMessagePortChannelImpl(
route_id_(route_id),
message_port_id_(port.id),
send_messages_as_values_(port.send_messages_as_values),
+ is_stashed_(false),
main_thread_task_runner_(main_thread_task_runner) {
AddRef();
Init();
@@ -58,7 +60,9 @@ WebMessagePortChannelImpl::~WebMessagePortChannelImpl() {
message_queue_.pop();
}
- if (message_port_id_ != MSG_ROUTING_NONE)
+ // TODO(mek): Figure out if in case of a stashed port any messages remaining
+ // in the queue need to be send back to the browser process.
+ if (message_port_id_ != MSG_ROUTING_NONE && !is_stashed_)
Send(new MessagePortHostMsg_DestroyMessagePort(message_port_id_));
if (route_id_ != MSG_ROUTING_NONE)
« no previous file with comments | « content/child/webmessageportchannel_impl.h ('k') | content/common/service_worker/service_worker_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698