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

Side by Side Diff: content/browser/service_worker/service_worker_dispatcher_host.h

Issue 246023007: Chromium-side plumbing for ServiceWorker -> Document postMessage (2/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: message port threading fix Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_
7 7
8 #include "base/id_map.h" 8 #include "base/id_map.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 29 matching lines...) Expand all
40 // IPC::Sender implementation 40 // IPC::Sender implementation
41 41
42 // Send() queues the message until the underlying channel is ready. This 42 // Send() queues the message until the underlying channel is ready. This
43 // class assumes that Send() can only fail after that when the renderer 43 // class assumes that Send() can only fail after that when the renderer
44 // process has terminated, at which point the whole instance will eventually 44 // process has terminated, at which point the whole instance will eventually
45 // be destroyed. 45 // be destroyed.
46 virtual bool Send(IPC::Message* message) OVERRIDE; 46 virtual bool Send(IPC::Message* message) OVERRIDE;
47 47
48 void RegisterServiceWorkerHandle(scoped_ptr<ServiceWorkerHandle> handle); 48 void RegisterServiceWorkerHandle(scoped_ptr<ServiceWorkerHandle> handle);
49 49
50 MessagePortMessageFilter* message_port_message_filter() {
51 return message_port_message_filter_;
52 }
53
50 protected: 54 protected:
51 virtual ~ServiceWorkerDispatcherHost(); 55 virtual ~ServiceWorkerDispatcherHost();
52 56
53 private: 57 private:
54 friend class BrowserThread; 58 friend class BrowserThread;
55 friend class base::DeleteHelper<ServiceWorkerDispatcherHost>; 59 friend class base::DeleteHelper<ServiceWorkerDispatcherHost>;
56 friend class TestingServiceWorkerDispatcherHost; 60 friend class TestingServiceWorkerDispatcherHost;
57 61
58 // IPC Message handlers 62 // IPC Message handlers
59 void OnRegisterServiceWorker(int thread_id, 63 void OnRegisterServiceWorker(int thread_id,
(...skipping 19 matching lines...) Expand all
79 int column_number, 83 int column_number,
80 const GURL& source_url); 84 const GURL& source_url);
81 void OnReportConsoleMessage( 85 void OnReportConsoleMessage(
82 int embedded_worker_id, 86 int embedded_worker_id,
83 const EmbeddedWorkerHostMsg_ReportConsoleMessage_Params& params); 87 const EmbeddedWorkerHostMsg_ReportConsoleMessage_Params& params);
84 void OnPostMessage(int handle_id, 88 void OnPostMessage(int handle_id,
85 const base::string16& message, 89 const base::string16& message,
86 const std::vector<int>& sent_message_port_ids); 90 const std::vector<int>& sent_message_port_ids);
87 void OnIncrementServiceWorkerRefCount(int handle_id); 91 void OnIncrementServiceWorkerRefCount(int handle_id);
88 void OnDecrementServiceWorkerRefCount(int handle_id); 92 void OnDecrementServiceWorkerRefCount(int handle_id);
93 void OnPostMessageToWorker(int handle_id,
94 const base::string16& message,
95 const std::vector<int>& sent_message_port_ids);
96 void OnServiceWorkerObjectDestroyed(int handle_id);
89 97
90 // Callbacks from ServiceWorkerContextCore 98 // Callbacks from ServiceWorkerContextCore
91 void RegistrationComplete(int thread_id, 99 void RegistrationComplete(int thread_id,
92 int request_id, 100 int request_id,
93 ServiceWorkerStatusCode status, 101 ServiceWorkerStatusCode status,
94 int64 registration_id, 102 int64 registration_id,
95 int64 version_id); 103 int64 version_id);
96 104
97 void UnregistrationComplete(int thread_id, 105 void UnregistrationComplete(int thread_id,
98 int request_id, 106 int request_id,
(...skipping 11 matching lines...) Expand all
110 118
111 bool channel_ready_; // True after BrowserMessageFilter::channel_ != NULL. 119 bool channel_ready_; // True after BrowserMessageFilter::channel_ != NULL.
112 ScopedVector<IPC::Message> pending_messages_; 120 ScopedVector<IPC::Message> pending_messages_;
113 121
114 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); 122 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost);
115 }; 123 };
116 124
117 } // namespace content 125 } // namespace content
118 126
119 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ 127 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698