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

Unified Diff: content/browser/service_worker/service_worker_dispatcher_host.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/browser/service_worker/service_worker_dispatcher_host.h
diff --git a/content/browser/service_worker/service_worker_dispatcher_host.h b/content/browser/service_worker/service_worker_dispatcher_host.h
index cb3a2b716752638e9ec9d2faa64fb263054b19f6..7b992555fa18bd249ce3b5da65b200afe8b1fca9 100644
--- a/content/browser/service_worker/service_worker_dispatcher_host.h
+++ b/content/browser/service_worker/service_worker_dispatcher_host.h
@@ -13,13 +13,17 @@ class GURL;
namespace content {
+class MessagePortMessageFilter;
class ServiceWorkerContextCore;
class ServiceWorkerContextWrapper;
class ServiceWorkerProviderHost;
+class ServiceWorkerRegistration;
class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter {
public:
- explicit ServiceWorkerDispatcherHost(int render_process_id);
+ ServiceWorkerDispatcherHost(
+ int render_process_id,
+ MessagePortMessageFilter* message_port_message_filter);
void Init(ServiceWorkerContextWrapper* context_wrapper);
@@ -54,6 +58,16 @@ class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter {
void OnSendMessageToBrowser(int embedded_worker_id,
int request_id,
const IPC::Message& message);
+ void OnPostMessage(int64 registration_id,
+ const base::string16& message,
+ const std::vector<int>& sent_message_port_ids);
+
+ static void PostMessageFoundRegistration(
+ const base::string16& message,
+ const std::vector<int>& sent_message_port_ids,
+ const std::vector<int>& new_routing_ids,
+ ServiceWorkerStatusCode status,
+ const scoped_refptr<ServiceWorkerRegistration>& result);
// Callbacks from ServiceWorkerContextCore
void RegistrationComplete(int32 thread_id,
@@ -68,7 +82,10 @@ class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter {
void SendRegistrationError(int32 thread_id,
int32 request_id,
ServiceWorkerStatusCode status);
+
int render_process_id_;
+ MessagePortMessageFilter* const message_port_message_filter_;
+
base::WeakPtr<ServiceWorkerContextCore> context_;
};

Powered by Google App Engine
This is Rietveld 408576698