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

Side by Side Diff: content/child/service_worker/service_worker_provider_context.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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_PROVIDER_CONTEXT_H_ 5 #ifndef CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_CONTEXT_H_
6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_CONTEXT_H_ 6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_CONTEXT_H_
7 7
8 #include <set> 8 #include <set>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // ControlleeDelegate and ControllerDelegate. 42 // ControlleeDelegate and ControllerDelegate.
43 class CONTENT_EXPORT ServiceWorkerProviderContext 43 class CONTENT_EXPORT ServiceWorkerProviderContext
44 : public base::RefCountedThreadSafe<ServiceWorkerProviderContext, 44 : public base::RefCountedThreadSafe<ServiceWorkerProviderContext,
45 ServiceWorkerProviderContextDeleter> { 45 ServiceWorkerProviderContextDeleter> {
46 public: 46 public:
47 ServiceWorkerProviderContext(int provider_id, 47 ServiceWorkerProviderContext(int provider_id,
48 ServiceWorkerProviderType provider_type, 48 ServiceWorkerProviderType provider_type,
49 ThreadSafeSender* thread_safe_sender); 49 ThreadSafeSender* thread_safe_sender);
50 50
51 // Called from ServiceWorkerDispatcher. 51 // Called from ServiceWorkerDispatcher.
52 void OnAssociateRegistration(const ServiceWorkerRegistrationObjectInfo& info, 52 void OnAssociateRegistration(
53 const ServiceWorkerVersionAttributes& attrs); 53 scoped_ptr<ServiceWorkerRegistrationHandleReference> registration,
54 scoped_ptr<ServiceWorkerHandleReference> installing,
55 scoped_ptr<ServiceWorkerHandleReference> waiting,
56 scoped_ptr<ServiceWorkerHandleReference> active);
54 void OnDisassociateRegistration(); 57 void OnDisassociateRegistration();
55 void OnSetControllerServiceWorker( 58 void OnSetControllerServiceWorker(
56 scoped_ptr<ServiceWorkerHandleReference> controller); 59 scoped_ptr<ServiceWorkerHandleReference> controller);
57 60
58 // Called on the worker thread. Used for initializing 61 // Called on the worker thread. Used for initializing
59 // ServiceWorkerGlobalScope. 62 // ServiceWorkerGlobalScope.
60 void GetAssociatedRegistration(ServiceWorkerRegistrationObjectInfo* info, 63 void GetAssociatedRegistration(ServiceWorkerRegistrationObjectInfo* info,
61 ServiceWorkerVersionAttributes* attrs); 64 ServiceWorkerVersionAttributes* attrs);
62 65
63 int provider_id() const { return provider_id_; } 66 int provider_id() const { return provider_id_; }
(...skipping 24 matching lines...) Expand all
88 91
89 struct ServiceWorkerProviderContextDeleter { 92 struct ServiceWorkerProviderContextDeleter {
90 static void Destruct(const ServiceWorkerProviderContext* context) { 93 static void Destruct(const ServiceWorkerProviderContext* context) {
91 context->DestructOnMainThread(); 94 context->DestructOnMainThread();
92 } 95 }
93 }; 96 };
94 97
95 } // namespace content 98 } // namespace content
96 99
97 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_CONTEXT_H_ 100 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698