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

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: Reup 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..b6f0f5ca2089e40c811584890efadfeedda80e54 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,15 @@ class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter {
void OnSendMessageToBrowser(int embedded_worker_id,
int request_id,
const IPC::Message& message);
+ void OnPostMessage(int64 registration_id,
+ base::string16 message,
+ std::vector<int> sent_message_port_ids);
+
+ void PostMessageFoundRegistration(
+ base::string16 message,
+ std::vector<int> sent_message_port_ids,
+ ServiceWorkerStatusCode status,
+ const scoped_refptr<ServiceWorkerRegistration>& result);
// Callbacks from ServiceWorkerContextCore
void RegistrationComplete(int32 thread_id,
@@ -68,7 +81,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_;
michaeln 2014/03/11 23:17:34 is this really safe?
+
base::WeakPtr<ServiceWorkerContextCore> context_;
};

Powered by Google App Engine
This is Rietveld 408576698