OLD | NEW |
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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/id_map.h" | 10 #include "base/id_map.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 class ServiceWorkerContextCore; | 24 class ServiceWorkerContextCore; |
25 class ServiceWorkerContextWrapper; | 25 class ServiceWorkerContextWrapper; |
26 class ServiceWorkerHandle; | 26 class ServiceWorkerHandle; |
27 class ServiceWorkerProviderHost; | 27 class ServiceWorkerProviderHost; |
28 class ServiceWorkerRegistration; | 28 class ServiceWorkerRegistration; |
29 class ServiceWorkerRegistrationHandle; | 29 class ServiceWorkerRegistrationHandle; |
30 class ServiceWorkerVersion; | 30 class ServiceWorkerVersion; |
31 struct ServiceWorkerObjectInfo; | 31 struct ServiceWorkerObjectInfo; |
32 struct ServiceWorkerRegistrationObjectInfo; | 32 struct ServiceWorkerRegistrationObjectInfo; |
33 struct ServiceWorkerVersionAttributes; | 33 struct ServiceWorkerVersionAttributes; |
| 34 struct TransferredMessagePort; |
34 | 35 |
35 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { | 36 class CONTENT_EXPORT ServiceWorkerDispatcherHost : public BrowserMessageFilter { |
36 public: | 37 public: |
37 ServiceWorkerDispatcherHost( | 38 ServiceWorkerDispatcherHost( |
38 int render_process_id, | 39 int render_process_id, |
39 MessagePortMessageFilter* message_port_message_filter, | 40 MessagePortMessageFilter* message_port_message_filter, |
40 ResourceContext* resource_context); | 41 ResourceContext* resource_context); |
41 | 42 |
42 void Init(ServiceWorkerContextWrapper* context_wrapper); | 43 void Init(ServiceWorkerContextWrapper* context_wrapper); |
43 | 44 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 void OnWorkerStopped(int embedded_worker_id); | 107 void OnWorkerStopped(int embedded_worker_id); |
107 void OnPausedAfterDownload(int embedded_worker_id); | 108 void OnPausedAfterDownload(int embedded_worker_id); |
108 void OnReportException(int embedded_worker_id, | 109 void OnReportException(int embedded_worker_id, |
109 const base::string16& error_message, | 110 const base::string16& error_message, |
110 int line_number, | 111 int line_number, |
111 int column_number, | 112 int column_number, |
112 const GURL& source_url); | 113 const GURL& source_url); |
113 void OnReportConsoleMessage( | 114 void OnReportConsoleMessage( |
114 int embedded_worker_id, | 115 int embedded_worker_id, |
115 const EmbeddedWorkerHostMsg_ReportConsoleMessage_Params& params); | 116 const EmbeddedWorkerHostMsg_ReportConsoleMessage_Params& params); |
116 void OnPostMessage(int handle_id, | |
117 const base::string16& message, | |
118 const std::vector<int>& sent_message_port_ids); | |
119 void OnIncrementServiceWorkerRefCount(int handle_id); | 117 void OnIncrementServiceWorkerRefCount(int handle_id); |
120 void OnDecrementServiceWorkerRefCount(int handle_id); | 118 void OnDecrementServiceWorkerRefCount(int handle_id); |
121 void OnIncrementRegistrationRefCount(int registration_handle_id); | 119 void OnIncrementRegistrationRefCount(int registration_handle_id); |
122 void OnDecrementRegistrationRefCount(int registration_handle_id); | 120 void OnDecrementRegistrationRefCount(int registration_handle_id); |
123 void OnPostMessageToWorker(int handle_id, | 121 void OnPostMessageToWorker( |
124 const base::string16& message, | 122 int handle_id, |
125 const std::vector<int>& sent_message_port_ids); | 123 const base::string16& message, |
| 124 const std::vector<TransferredMessagePort>& sent_message_ports); |
126 void OnServiceWorkerObjectDestroyed(int handle_id); | 125 void OnServiceWorkerObjectDestroyed(int handle_id); |
127 void OnTerminateWorker(int handle_id); | 126 void OnTerminateWorker(int handle_id); |
128 | 127 |
129 ServiceWorkerRegistrationHandle* FindRegistrationHandle( | 128 ServiceWorkerRegistrationHandle* FindRegistrationHandle( |
130 int provider_id, | 129 int provider_id, |
131 int64 registration_id); | 130 int64 registration_id); |
132 | 131 |
133 void GetRegistrationObjectInfoAndVersionAttributes( | 132 void GetRegistrationObjectInfoAndVersionAttributes( |
134 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 133 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
135 ServiceWorkerRegistration* registration, | 134 ServiceWorkerRegistration* registration, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 179 |
181 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. | 180 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. |
182 ScopedVector<IPC::Message> pending_messages_; | 181 ScopedVector<IPC::Message> pending_messages_; |
183 | 182 |
184 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); | 183 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); |
185 }; | 184 }; |
186 | 185 |
187 } // namespace content | 186 } // namespace content |
188 | 187 |
189 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 188 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
OLD | NEW |