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, |