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

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

Issue 885443006: ServiceWorker: Get registration info and its version attributes in one lock operation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address review comments Created 5 years, 11 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
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 30 matching lines...) Expand all
41 void OnAssociateRegistration(const ServiceWorkerRegistrationObjectInfo& info, 41 void OnAssociateRegistration(const ServiceWorkerRegistrationObjectInfo& info,
42 const ServiceWorkerVersionAttributes& attrs); 42 const ServiceWorkerVersionAttributes& attrs);
43 void OnDisassociateRegistration(); 43 void OnDisassociateRegistration();
44 void OnServiceWorkerStateChanged(int handle_id, 44 void OnServiceWorkerStateChanged(int handle_id,
45 blink::WebServiceWorkerState state); 45 blink::WebServiceWorkerState state);
46 void OnSetControllerServiceWorker(const ServiceWorkerObjectInfo& info); 46 void OnSetControllerServiceWorker(const ServiceWorkerObjectInfo& info);
47 47
48 int provider_id() const { return provider_id_; } 48 int provider_id() const { return provider_id_; }
49 49
50 ServiceWorkerHandleReference* controller(); 50 ServiceWorkerHandleReference* controller();
51 ServiceWorkerRegistrationHandleReference* registration();
52 51
53 ServiceWorkerVersionAttributes GetVersionAttributes(); 52 bool GetRegistrationInfoAndVersionAttributes(
53 ServiceWorkerRegistrationObjectInfo* info,
54 ServiceWorkerVersionAttributes* attrs);
54 void SetVersionAttributes(ChangedVersionAttributesMask mask, 55 void SetVersionAttributes(ChangedVersionAttributesMask mask,
55 const ServiceWorkerVersionAttributes& attrs); 56 const ServiceWorkerVersionAttributes& attrs);
56 57
57 // Gets the handle ID of the installing Service Worker, or 58 // Gets the handle ID of the installing Service Worker, or
58 // kInvalidServiceWorkerHandleId if the provider does not have a 59 // kInvalidServiceWorkerHandleId if the provider does not have a
59 // installing Service Worker. 60 // installing Service Worker.
60 int installing_handle_id() const; 61 int installing_handle_id() const;
61 62
62 // Gets the handle ID of the waiting Service Worker, or 63 // Gets the handle ID of the waiting Service Worker, or
63 // kInvalidServiceWorkerHandleId if the provider does not have a 64 // kInvalidServiceWorkerHandleId if the provider does not have a
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 110
110 struct ServiceWorkerProviderContextDeleter { 111 struct ServiceWorkerProviderContextDeleter {
111 static void Destruct(const ServiceWorkerProviderContext* context) { 112 static void Destruct(const ServiceWorkerProviderContext* context) {
112 context->DestructOnMainThread(); 113 context->DestructOnMainThread();
113 } 114 }
114 }; 115 };
115 116
116 } // namespace content 117 } // namespace content
117 118
118 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_CONTEXT_H_ 119 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_PROVIDER_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698