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

Unified Diff: content/renderer/service_worker/service_worker_script_context.h

Issue 189253002: Implement ServiceWorker::postMessage() [Chromium] (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename message handler per review feedback Created 6 years, 9 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/renderer/service_worker/service_worker_script_context.h
diff --git a/content/renderer/service_worker/service_worker_script_context.h b/content/renderer/service_worker/service_worker_script_context.h
index eafe16f10e6b2e8fb671c228378061bb51482e66..7bea6bfbf16d1687435d9ecdd514ff741a38f508 100644
--- a/content/renderer/service_worker/service_worker_script_context.h
+++ b/content/renderer/service_worker/service_worker_script_context.h
@@ -5,7 +5,10 @@
#ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_
#define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_
+#include <vector>
+
#include "base/basictypes.h"
+#include "base/strings/string16.h"
#include "content/common/service_worker/service_worker_types.h"
@@ -45,6 +48,9 @@ class ServiceWorkerScriptContext {
void OnInstallEvent(int active_version_embedded_worker_id);
void OnFetchEvent(const ServiceWorkerFetchRequest& request);
+ void OnPostMessage(const base::string16& message,
+ const std::vector<int>& sent_message_port_ids,
+ const std::vector<int>& new_routing_ids);
// Not owned; embedded_context_ owns this.
EmbeddedWorkerContextClient* embedded_context_;
@@ -52,7 +58,9 @@ class ServiceWorkerScriptContext {
// Not owned; this object is destroyed when proxy_ becomes invalid.
blink::WebServiceWorkerContextProxy* proxy_;
- // Used by message handlers.
+ // Used for incoming messages from the browser for which an outgoing response
+ // back to the browser is expected, the id must be sent back with the
+ // response.
int current_request_id_;
DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext);

Powered by Google App Engine
This is Rietveld 408576698