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

Unified Diff: content/browser/service_worker/service_worker_version.h

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/browser/message_port_service.cc ('k') | content/browser/service_worker/service_worker_version.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/service_worker/service_worker_version.h
diff --git a/content/browser/service_worker/service_worker_version.h b/content/browser/service_worker/service_worker_version.h
index af011e563665c7204a35ff22f653eb996a6407c3..eeaad0ac493aa37c0be487d9824d3c887d67cc98 100644
--- a/content/browser/service_worker/service_worker_version.h
+++ b/content/browser/service_worker/service_worker_version.h
@@ -71,6 +71,8 @@ class CONTENT_EXPORT ServiceWorkerVersion
typedef base::Callback<void(ServiceWorkerStatusCode,
bool /* accept_connction */)>
CrossOriginConnectCallback;
+ typedef base::Callback<void(ServiceWorkerStatusCode, const std::vector<int>&)>
+ SendStashedPortsCallback;
enum RunningStatus {
STOPPED = EmbeddedWorkerInstance::STOPPED,
@@ -259,6 +261,16 @@ class CONTENT_EXPORT ServiceWorkerVersion
const std::vector<TransferredMessagePort>& sent_message_ports,
const StatusCallback& callback);
+ // Transfers one or more stashed message ports to the associated embedded
+ // worker, and asynchronously calls |callback| with the new route ids for the
+ // transferred ports as soon as the ports are sent to the renderer.
+ // Once the ports are received by the renderer, the ports themselves will
+ // inform MessagePortService, which will enable actual messages to be sent.
+ void SendStashedMessagePorts(
+ const std::vector<TransferredMessagePort>& stashed_message_ports,
+ const std::vector<base::string16>& port_names,
+ const SendStashedPortsCallback& callback);
+
// Adds and removes |provider_host| as a controllee of this ServiceWorker.
// A potential controllee is a host having the version as its .installing
// or .waiting version.
@@ -429,6 +441,7 @@ class CONTENT_EXPORT ServiceWorkerVersion
void OnSkipWaiting(int request_id);
void OnClaimClients(int request_id);
void OnPongFromWorker();
+ void OnStashMessagePort(int message_port_id, const base::string16& name);
void OnFocusClientFinished(int request_id,
const std::string& client_uuid,
« no previous file with comments | « content/browser/message_port_service.cc ('k') | content/browser/service_worker/service_worker_version.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698