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 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 const std::vector<int>& sent_message_port_ids); | 111 const std::vector<int>& sent_message_port_ids); |
112 void OnIncrementServiceWorkerRefCount(int handle_id); | 112 void OnIncrementServiceWorkerRefCount(int handle_id); |
113 void OnDecrementServiceWorkerRefCount(int handle_id); | 113 void OnDecrementServiceWorkerRefCount(int handle_id); |
114 void OnIncrementRegistrationRefCount(int registration_handle_id); | 114 void OnIncrementRegistrationRefCount(int registration_handle_id); |
115 void OnDecrementRegistrationRefCount(int registration_handle_id); | 115 void OnDecrementRegistrationRefCount(int registration_handle_id); |
116 void OnPostMessageToWorker(int handle_id, | 116 void OnPostMessageToWorker(int handle_id, |
117 const base::string16& message, | 117 const base::string16& message, |
118 const std::vector<int>& sent_message_port_ids); | 118 const std::vector<int>& sent_message_port_ids); |
119 void OnServiceWorkerObjectDestroyed(int handle_id); | 119 void OnServiceWorkerObjectDestroyed(int handle_id); |
120 void OnTerminateWorker(int handle_id); | 120 void OnTerminateWorker(int handle_id); |
| 121 void OnNavigatorConnect(int thread_id, |
| 122 int request_id, |
| 123 const GURL& target_url, |
| 124 int message_port_id); |
121 | 125 |
122 ServiceWorkerRegistrationHandle* FindRegistrationHandle( | 126 ServiceWorkerRegistrationHandle* FindRegistrationHandle( |
123 int provider_id, | 127 int provider_id, |
124 int64 registration_id); | 128 int64 registration_id); |
125 | 129 |
126 void GetRegistrationObjectInfoAndVersionAttributes( | 130 void GetRegistrationObjectInfoAndVersionAttributes( |
127 int provider_id, | 131 int provider_id, |
128 ServiceWorkerRegistration* registration, | 132 ServiceWorkerRegistration* registration, |
129 ServiceWorkerRegistrationObjectInfo* info, | 133 ServiceWorkerRegistrationObjectInfo* info, |
130 ServiceWorkerVersionAttributes* attrs); | 134 ServiceWorkerVersionAttributes* attrs); |
(...skipping 23 matching lines...) Expand all Loading... |
154 void SendUnregistrationError(int thread_id, | 158 void SendUnregistrationError(int thread_id, |
155 int request_id, | 159 int request_id, |
156 ServiceWorkerStatusCode status); | 160 ServiceWorkerStatusCode status); |
157 | 161 |
158 void SendGetRegistrationError(int thread_id, | 162 void SendGetRegistrationError(int thread_id, |
159 int request_id, | 163 int request_id, |
160 ServiceWorkerStatusCode status); | 164 ServiceWorkerStatusCode status); |
161 | 165 |
162 ServiceWorkerContextCore* GetContext(); | 166 ServiceWorkerContextCore* GetContext(); |
163 | 167 |
| 168 struct NavigatorConnectParams { |
| 169 NavigatorConnectParams(int thread_id, int request_id, int message_port_id) |
| 170 : thread_id(thread_id), |
| 171 request_id(request_id), |
| 172 message_port_id(message_port_id) {} |
| 173 int thread_id; |
| 174 int request_id; |
| 175 int message_port_id; |
| 176 }; |
| 177 |
| 178 void NavigatorConnectGotRegistration( |
| 179 const NavigatorConnectParams& params, |
| 180 const GURL& target_url, |
| 181 ServiceWorkerStatusCode status, |
| 182 const scoped_refptr<ServiceWorkerRegistration>& registration); |
| 183 void NavigatorConnectResult( |
| 184 const NavigatorConnectParams& params, |
| 185 const scoped_refptr<ServiceWorkerRegistration>& registration, |
| 186 ServiceWorkerStatusCode status, |
| 187 bool allow_connect); |
| 188 |
164 int render_process_id_; | 189 int render_process_id_; |
165 MessagePortMessageFilter* const message_port_message_filter_; | 190 MessagePortMessageFilter* const message_port_message_filter_; |
166 ResourceContext* resource_context_; | 191 ResourceContext* resource_context_; |
167 scoped_refptr<ServiceWorkerContextWrapper> context_wrapper_; | 192 scoped_refptr<ServiceWorkerContextWrapper> context_wrapper_; |
168 | 193 |
169 IDMap<ServiceWorkerHandle, IDMapOwnPointer> handles_; | 194 IDMap<ServiceWorkerHandle, IDMapOwnPointer> handles_; |
170 IDMap<ServiceWorkerRegistrationHandle, IDMapOwnPointer> registration_handles_; | 195 IDMap<ServiceWorkerRegistrationHandle, IDMapOwnPointer> registration_handles_; |
171 | 196 |
172 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. | 197 bool channel_ready_; // True after BrowserMessageFilter::sender_ != NULL. |
173 ScopedVector<IPC::Message> pending_messages_; | 198 ScopedVector<IPC::Message> pending_messages_; |
174 | 199 |
175 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); | 200 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcherHost); |
176 }; | 201 }; |
177 | 202 |
178 } // namespace content | 203 } // namespace content |
179 | 204 |
180 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ | 205 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_HOST_H_ |
OLD | NEW |