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

Side by Side Diff: content/child/service_worker/service_worker_dispatcher.h

Issue 1454963003: ServiceWorker: Ensure that ServiceWorkerDispatcher always adopts passed handle references (1) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 5 years, 1 month 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
« no previous file with comments | « no previous file | content/child/service_worker/service_worker_dispatcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ 5 #ifndef CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_
6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ 6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/id_map.h" 11 #include "base/id_map.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/strings/string16.h" 13 #include "base/strings/string16.h"
14 #include "content/public/child/worker_thread.h" 14 #include "content/public/child/worker_thread.h"
15 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerError.h" 15 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerError.h"
16 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerProvider.h" 16 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerProvider.h"
17 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerRegistration.h" 17 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerRegistration.h"
18 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerState.h" 18 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor kerState.h"
19 19
20 class GURL; 20 class GURL;
21 21
22 namespace base { 22 namespace base {
23 class SingleThreadTaskRunner; 23 class SingleThreadTaskRunner;
24 } 24 }
25 25
26 namespace blink {
27 class WebURL;
28 }
29
30 namespace IPC { 26 namespace IPC {
31 class Message; 27 class Message;
32 } 28 }
33 29
34 struct ServiceWorkerMsg_MessageToDocument_Params; 30 struct ServiceWorkerMsg_MessageToDocument_Params;
35 31
36 namespace content { 32 namespace content {
37 33
34 class ServiceWorkerHandleReference;
38 class ServiceWorkerMessageFilter; 35 class ServiceWorkerMessageFilter;
39 class ServiceWorkerProviderContext; 36 class ServiceWorkerProviderContext;
40 class ServiceWorkerRegistrationHandleReference; 37 class ServiceWorkerRegistrationHandleReference;
41 class ThreadSafeSender; 38 class ThreadSafeSender;
42 class WebServiceWorkerImpl; 39 class WebServiceWorkerImpl;
43 class WebServiceWorkerRegistrationImpl; 40 class WebServiceWorkerRegistrationImpl;
44 struct ServiceWorkerObjectInfo; 41 struct ServiceWorkerObjectInfo;
45 struct ServiceWorkerRegistrationObjectInfo; 42 struct ServiceWorkerRegistrationObjectInfo;
46 struct ServiceWorkerVersionAttributes; 43 struct ServiceWorkerVersionAttributes;
47 44
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 void AddServiceWorker(int handle_id, WebServiceWorkerImpl* worker); 254 void AddServiceWorker(int handle_id, WebServiceWorkerImpl* worker);
258 void RemoveServiceWorker(int handle_id); 255 void RemoveServiceWorker(int handle_id);
259 256
260 // Keeps map from registration_handle_id to ServiceWorkerRegistration object. 257 // Keeps map from registration_handle_id to ServiceWorkerRegistration object.
261 void AddServiceWorkerRegistration( 258 void AddServiceWorkerRegistration(
262 int registration_handle_id, 259 int registration_handle_id,
263 WebServiceWorkerRegistrationImpl* registration); 260 WebServiceWorkerRegistrationImpl* registration);
264 void RemoveServiceWorkerRegistration( 261 void RemoveServiceWorkerRegistration(
265 int registration_handle_id); 262 int registration_handle_id);
266 263
264 // Assumes that the given object information retains an interprocess handle
265 // reference passed from the browser process, and adopts it.
266 scoped_ptr<ServiceWorkerRegistrationHandleReference> Adopt(
267 const ServiceWorkerRegistrationObjectInfo& info);
268 scoped_ptr<ServiceWorkerHandleReference> Adopt(
269 const ServiceWorkerObjectInfo& info);
270
267 RegistrationCallbackMap pending_registration_callbacks_; 271 RegistrationCallbackMap pending_registration_callbacks_;
268 UpdateCallbackMap pending_update_callbacks_; 272 UpdateCallbackMap pending_update_callbacks_;
269 UnregistrationCallbackMap pending_unregistration_callbacks_; 273 UnregistrationCallbackMap pending_unregistration_callbacks_;
270 GetRegistrationCallbackMap pending_get_registration_callbacks_; 274 GetRegistrationCallbackMap pending_get_registration_callbacks_;
271 GetRegistrationsCallbackMap pending_get_registrations_callbacks_; 275 GetRegistrationsCallbackMap pending_get_registrations_callbacks_;
272 GetRegistrationForReadyCallbackMap get_for_ready_callbacks_; 276 GetRegistrationForReadyCallbackMap get_for_ready_callbacks_;
273 277
274 ProviderClientMap provider_clients_; 278 ProviderClientMap provider_clients_;
275 ProviderContextMap provider_contexts_; 279 ProviderContextMap provider_contexts_;
276 280
277 WorkerObjectMap service_workers_; 281 WorkerObjectMap service_workers_;
278 RegistrationObjectMap registrations_; 282 RegistrationObjectMap registrations_;
279 283
280 scoped_refptr<ThreadSafeSender> thread_safe_sender_; 284 scoped_refptr<ThreadSafeSender> thread_safe_sender_;
281 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_; 285 scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
282 286
283 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher); 287 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerDispatcher);
284 }; 288 };
285 289
286 } // namespace content 290 } // namespace content
287 291
288 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_ 292 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_DISPATCHER_H_
OLDNEW
« no previous file with comments | « no previous file | content/child/service_worker/service_worker_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698