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

Side by Side Diff: content/browser/background_sync/background_sync_manager.h

Issue 1282013004: BackgroundSyncManager tracks client registrations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from PS10 Created 5 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ 5 #ifndef CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_
6 #define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ 6 #define CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/memory/weak_ptr.h" 15 #include "base/memory/weak_ptr.h"
16 #include "content/browser/background_sync/background_sync.pb.h" 16 #include "content/browser/background_sync/background_sync.pb.h"
17 #include "content/browser/background_sync/background_sync_registration.h" 17 #include "content/browser/background_sync/background_sync_registration.h"
18 #include "content/browser/background_sync/background_sync_status.h" 18 #include "content/browser/background_sync/background_sync_status.h"
19 #include "content/browser/cache_storage/cache_storage_scheduler.h" 19 #include "content/browser/cache_storage/cache_storage_scheduler.h"
20 #include "content/browser/service_worker/service_worker_context_observer.h" 20 #include "content/browser/service_worker/service_worker_context_observer.h"
21 #include "content/browser/service_worker/service_worker_storage.h" 21 #include "content/browser/service_worker/service_worker_storage.h"
22 #include "content/common/content_export.h" 22 #include "content/common/content_export.h"
23 #include "content/common/service_worker/service_worker_status_code.h" 23 #include "content/common/service_worker/service_worker_status_code.h"
24 #include "url/gurl.h" 24 #include "url/gurl.h"
25 25
26 namespace content { 26 namespace content {
27 27
28 class BackgroundSyncNetworkObserver; 28 class BackgroundSyncNetworkObserver;
29 class BackgroundSyncPowerObserver; 29 class BackgroundSyncPowerObserver;
30 class ClientBackgroundSyncRegistration;
30 class ServiceWorkerContextWrapper; 31 class ServiceWorkerContextWrapper;
31 32
32 // BackgroundSyncManager manages and stores the set of background sync 33 // BackgroundSyncManager manages and stores the set of background sync
33 // registrations across all registered service workers for a profile. 34 // registrations across all registered service workers for a profile.
34 // Registrations are stored along with their associated Service Worker 35 // Registrations are stored along with their associated Service Worker
35 // registration in ServiceWorkerStorage. If the ServiceWorker is unregistered, 36 // registration in ServiceWorkerStorage. If the ServiceWorker is unregistered,
36 // the sync registrations are removed. This class expects to be run on the IO 37 // the sync registrations are removed. This class expects to be run on the IO
37 // thread. The asynchronous methods are executed sequentially. 38 // thread. The asynchronous methods are executed sequentially.
38 39
39 // TODO(jkarlin): Check permissions when registering, scheduling, and firing 40 // TODO(jkarlin): Check permissions when registering, scheduling, and firing
40 // background sync. In the meantime, --enable-service-worker-sync is required to 41 // background sync. In the meantime, --enable-service-worker-sync is required to
41 // fire a sync event. 42 // fire a sync event.
42 // TODO(jkarlin): Unregister syncs when permission is revoked. 43 // TODO(jkarlin): Unregister syncs when permission is revoked.
43 // TODO(jkarlin): Create a background sync scheduler to actually run the 44 // TODO(jkarlin): Create a background sync scheduler to actually run the
44 // registered events. 45 // registered events.
45 // TODO(jkarlin): Keep the browser alive if "Let Google Chrome Run in the 46 // TODO(jkarlin): Keep the browser alive if "Let Google Chrome Run in the
46 // Background" is true and a sync is registered. 47 // Background" is true and a sync is registered.
47 class CONTENT_EXPORT BackgroundSyncManager 48 class CONTENT_EXPORT BackgroundSyncManager
48 : NON_EXPORTED_BASE(public ServiceWorkerContextObserver) { 49 : NON_EXPORTED_BASE(public ServiceWorkerContextObserver) {
49 public: 50 public:
50 using StatusCallback = base::Callback<void(BackgroundSyncStatus)>; 51 using StatusCallback = base::Callback<void(BackgroundSyncStatus)>;
51 using StatusAndRegistrationCallback = 52 using StatusAndRegistrationCallback =
52 base::Callback<void(BackgroundSyncStatus, 53 base::Callback<void(BackgroundSyncStatus,
53 const BackgroundSyncRegistration&)>; 54 scoped_ptr<ClientBackgroundSyncRegistration>)>;
54 using StatusAndRegistrationsCallback = 55 using StatusAndRegistrationsCallback = base::Callback<void(
55 base::Callback<void(BackgroundSyncStatus, 56 BackgroundSyncStatus,
56 const std::vector<BackgroundSyncRegistration>&)>; 57 scoped_ptr<ScopedVector<ClientBackgroundSyncRegistration>>)>;
57 58
58 static scoped_ptr<BackgroundSyncManager> Create( 59 static scoped_ptr<BackgroundSyncManager> Create(
59 const scoped_refptr<ServiceWorkerContextWrapper>& service_worker_context); 60 const scoped_refptr<ServiceWorkerContextWrapper>& service_worker_context);
60 ~BackgroundSyncManager() override; 61 ~BackgroundSyncManager() override;
61 62
62 // Stores the given background sync registration and adds it to the scheduling 63 // Stores the given background sync registration and adds it to the scheduling
63 // queue. It will overwrite an existing registration with the same tag and 64 // queue. It will overwrite an existing registration with the same tag and
64 // periodicity unless they're identical (save for the id). Calls |callback| 65 // periodicity unless they're identical (save for the id). Calls |callback|
65 // with BACKGROUND_SYNC_STATUS_OK and the accepted registration on success. 66 // with BACKGROUND_SYNC_STATUS_OK and the accepted registration on success.
66 // The accepted registration will have a unique id. It may also have altered 67 // The accepted registration will have a unique id. It may also have altered
67 // parameters if the user or UA chose different parameters than those 68 // parameters if the user or UA chose different parameters than those
68 // supplied. 69 // supplied.
69 void Register(int64 sw_registration_id, 70 void Register(int64 sw_registration_id,
70 const BackgroundSyncRegistrationOptions& options, 71 const BackgroundSyncRegistrationOptions& options,
71 const StatusAndRegistrationCallback& callback); 72 const StatusAndRegistrationCallback& callback);
72 73
73 // Removes the background sync with tag |sync_registration_tag|, periodicity
74 // |periodicity|, and id |sync_registration_id|. Calls |callback| with
75 // BACKGROUND_SYNC_STATUS_NOT_FOUND if no match is found. Calls |callback|
76 // with BACKGROUND_SYNC_STATUS_OK on success.
77 void Unregister(
78 int64 sw_registration_id,
79 const std::string& sync_registration_tag,
80 SyncPeriodicity periodicity,
81 BackgroundSyncRegistration::RegistrationId sync_registration_id,
82 const StatusCallback& callback);
83
84 // Finds the background sync registration associated with 74 // Finds the background sync registration associated with
85 // |sw_registration_id| with periodicity |periodicity|. Calls 75 // |sw_registration_id| with periodicity |periodicity|. Calls
86 // |callback| with BACKGROUND_SYNC_STATUS_NOT_FOUND if it doesn't exist. Calls 76 // |callback| with BACKGROUND_SYNC_STATUS_NOT_FOUND if it doesn't exist. Calls
87 // |callback| with BACKGROUND_SYNC_STATUS_OK on success. 77 // |callback| with BACKGROUND_SYNC_STATUS_OK on success.
88 void GetRegistration(int64 sw_registration_id, 78 void GetRegistration(int64 sw_registration_id,
89 const std::string& sync_registration_tag, 79 const std::string& sync_registration_tag,
90 SyncPeriodicity periodicity, 80 SyncPeriodicity periodicity,
91 const StatusAndRegistrationCallback& callback); 81 const StatusAndRegistrationCallback& callback);
92 82
93 void GetRegistrations(int64 sw_registration_id, 83 void GetRegistrations(int64 sw_registration_id,
94 SyncPeriodicity periodicity, 84 SyncPeriodicity periodicity,
95 const StatusAndRegistrationsCallback& callback); 85 const StatusAndRegistrationsCallback& callback);
96 86
97 // ServiceWorkerContextObserver overrides. 87 // ServiceWorkerContextObserver overrides.
98 void OnRegistrationDeleted(int64 registration_id, 88 void OnRegistrationDeleted(int64 registration_id,
99 const GURL& pattern) override; 89 const GURL& pattern) override;
100 void OnStorageWiped() override; 90 void OnStorageWiped() override;
101 91
102 protected: 92 protected:
93 // A registration might be referenced by the client longer than
94 // the BackgroundSyncManager needs to keep track of it (e.g., the event has
95 // finished firing). The BackgroundSyncManager reference counts its
96 // registrations internally and every ClientBackgroundSyncRegistration has a
97 // unique registration id which maps to a locally maintained (in
98 // client_registration_ids_) scoped_refptr.
99 class RefCountedRegistration
100 : public base::RefCounted<RefCountedRegistration> {
101 public:
102 BackgroundSyncRegistration* value() { return &registration_; }
103 const BackgroundSyncRegistration* value() const { return &registration_; }
104
105 private:
106 friend class base::RefCounted<RefCountedRegistration>;
107 virtual ~RefCountedRegistration() {}
108
109 BackgroundSyncRegistration registration_;
110 };
111
103 explicit BackgroundSyncManager( 112 explicit BackgroundSyncManager(
104 const scoped_refptr<ServiceWorkerContextWrapper>& context); 113 const scoped_refptr<ServiceWorkerContextWrapper>& context);
105 114
106 // Init must be called before any public member function. Only call it once. 115 // Init must be called before any public member function. Only call it once.
107 void Init(); 116 void Init();
108 117
109 // The following methods are virtual for testing. 118 // The following methods are virtual for testing.
110 virtual void StoreDataInBackend( 119 virtual void StoreDataInBackend(
111 int64 sw_registration_id, 120 int64 sw_registration_id,
112 const GURL& origin, 121 const GURL& origin,
113 const std::string& backend_key, 122 const std::string& backend_key,
114 const std::string& data, 123 const std::string& data,
115 const ServiceWorkerStorage::StatusCallback& callback); 124 const ServiceWorkerStorage::StatusCallback& callback);
116 virtual void GetDataFromBackend( 125 virtual void GetDataFromBackend(
117 const std::string& backend_key, 126 const std::string& backend_key,
118 const ServiceWorkerStorage::GetUserDataForAllRegistrationsCallback& 127 const ServiceWorkerStorage::GetUserDataForAllRegistrationsCallback&
119 callback); 128 callback);
120 virtual void FireOneShotSync( 129 virtual void FireOneShotSync(
121 const BackgroundSyncRegistration& registration, 130 const RefCountedRegistration& registration,
122 const scoped_refptr<ServiceWorkerVersion>& active_version, 131 const scoped_refptr<ServiceWorkerVersion>& active_version,
123 const ServiceWorkerVersion::StatusCallback& callback); 132 const ServiceWorkerVersion::StatusCallback& callback);
124 133
125 private: 134 private:
135 friend class ClientBackgroundSyncRegistration;
136
126 class RegistrationKey { 137 class RegistrationKey {
127 public: 138 public:
128 explicit RegistrationKey(const BackgroundSyncRegistration& registration); 139 explicit RegistrationKey(const BackgroundSyncRegistration& registration);
129 explicit RegistrationKey(const BackgroundSyncRegistrationOptions& options); 140 explicit RegistrationKey(const BackgroundSyncRegistrationOptions& options);
130 RegistrationKey(const std::string& tag, SyncPeriodicity periodicity); 141 RegistrationKey(const std::string& tag, SyncPeriodicity periodicity);
131 RegistrationKey(const RegistrationKey& other) = default; 142 RegistrationKey(const RegistrationKey& other) = default;
132 RegistrationKey& operator=(const RegistrationKey& other) = default; 143 RegistrationKey& operator=(const RegistrationKey& other) = default;
133 144
134 bool operator<(const RegistrationKey& rhs) const { 145 bool operator<(const RegistrationKey& rhs) const {
135 return value_ < rhs.value_; 146 return value_ < rhs.value_;
136 } 147 }
137 148
138 private: 149 private:
139 std::string value_; 150 std::string value_;
140 }; 151 };
141 152
142 struct BackgroundSyncRegistrations { 153 struct BackgroundSyncRegistrations {
143 using RegistrationMap = 154 using RegistrationMap =
144 std::map<RegistrationKey, BackgroundSyncRegistration>; 155 std::map<RegistrationKey, scoped_refptr<RefCountedRegistration>>;
145 156
146 BackgroundSyncRegistrations(); 157 BackgroundSyncRegistrations();
147 ~BackgroundSyncRegistrations(); 158 ~BackgroundSyncRegistrations();
148 159
149 RegistrationMap registration_map; 160 RegistrationMap registration_map;
150 BackgroundSyncRegistration::RegistrationId next_id; 161 BackgroundSyncRegistration::RegistrationId next_id;
151 GURL origin; 162 GURL origin;
152 }; 163 };
153 164
154 using PermissionStatusCallback = base::Callback<void(bool)>; 165 using PermissionStatusCallback = base::Callback<void(bool)>;
155 using SWIdToRegistrationsMap = std::map<int64, BackgroundSyncRegistrations>; 166 using SWIdToRegistrationsMap = std::map<int64, BackgroundSyncRegistrations>;
156 167
168 // Returns true if the BackgrounjdSyncManager is tracking a client
169 // registration
170 // with id |sync_id|.
iclelland 2015/08/17 19:22:02 Random line break
jkarlin 2015/08/18 15:12:38 Done.
171 bool HasClientRegistration(
172 BackgroundSyncRegistration::RegistrationId sync_id) const;
173
174 // The BackgroundSyncManager holds references to registrations that have
175 // active ClientBackgroundSyncRegistrations. ClientBackgroundSyncRegistrations
176 // call this function on deletion so that the manager can free up old
177 // registrations.
178 void ReleaseClientRegistration(
179 BackgroundSyncRegistration::RegistrationId sync_id);
180
157 // Disable the manager. Already queued operations will abort once they start 181 // Disable the manager. Already queued operations will abort once they start
158 // to run (in their impl methods). Future operations will not queue. Any 182 // to run (in their impl methods). Future operations will not queue. Any
159 // registrations are cleared from memory and the backend (if it's still 183 // registrations are cleared from memory and the backend (if it's still
160 // functioning). The manager will reenable itself once it receives the 184 // functioning). The manager will reenable itself once it receives the
161 // OnStorageWiped message or on browser restart. 185 // OnStorageWiped message or on browser restart.
162 void DisableAndClearManager(const base::Closure& callback); 186 void DisableAndClearManager(const base::Closure& callback);
163 void DisableAndClearDidGetRegistrations( 187 void DisableAndClearDidGetRegistrations(
164 const base::Closure& callback, 188 const base::Closure& callback,
165 const std::vector<std::pair<int64, std::string>>& user_data, 189 const std::vector<std::pair<int64, std::string>>& user_data,
166 ServiceWorkerStatusCode status); 190 ServiceWorkerStatusCode status);
167 void DisableAndClearManagerClearedOne(const base::Closure& barrier_closure, 191 void DisableAndClearManagerClearedOne(const base::Closure& barrier_closure,
168 ServiceWorkerStatusCode status); 192 ServiceWorkerStatusCode status);
169 193
170 // Returns the existing registration in |existing_registration| if it is not 194 // Returns the existing registration in |existing_registration| if it is not
171 // null. 195 // null.
172 BackgroundSyncRegistration* LookupRegistration( 196 RefCountedRegistration* LookupRegistration(
173 int64 sw_registration_id, 197 int64 sw_registration_id,
174 const RegistrationKey& registration_key); 198 const RegistrationKey& registration_key);
175 199
176 // Store all registrations for a given |sw_registration_id|. 200 // Store all registrations for a given |sw_registration_id|.
177 void StoreRegistrations(int64 sw_registration_id, 201 void StoreRegistrations(int64 sw_registration_id,
178 const ServiceWorkerStorage::StatusCallback& callback); 202 const ServiceWorkerStorage::StatusCallback& callback);
179 203
180 // Removes the registration if it is in the map. 204 // Removes the registration if it is in the map.
181 void RemoveRegistrationFromMap(int64 sw_registration_id, 205 void RemoveRegistrationFromMap(int64 sw_registration_id,
182 const RegistrationKey& registration_key); 206 const RegistrationKey& registration_key);
183 207
184 void AddRegistrationToMap( 208 void AddRegistrationToMap(
185 int64 sw_registration_id, 209 int64 sw_registration_id,
186 const GURL& origin, 210 const GURL& origin,
187 const BackgroundSyncRegistration& sync_registration); 211 const scoped_refptr<RefCountedRegistration>& sync_registration);
188 212
189 void InitImpl(const base::Closure& callback); 213 void InitImpl(const base::Closure& callback);
190 void InitDidGetDataFromBackend( 214 void InitDidGetDataFromBackend(
191 const base::Closure& callback, 215 const base::Closure& callback,
192 const std::vector<std::pair<int64, std::string>>& user_data, 216 const std::vector<std::pair<int64, std::string>>& user_data,
193 ServiceWorkerStatusCode status); 217 ServiceWorkerStatusCode status);
194 218
195 // Register callbacks 219 // Register callbacks
196 void RegisterImpl(int64 sw_registration_id, 220 void RegisterImpl(int64 sw_registration_id,
197 const BackgroundSyncRegistrationOptions& options, 221 const BackgroundSyncRegistrationOptions& options,
198 const StatusAndRegistrationCallback& callback); 222 const StatusAndRegistrationCallback& callback);
199 void RegisterDidStore(int64 sw_registration_id, 223 void RegisterDidStore(
200 const BackgroundSyncRegistration& sync_registration, 224 int64 sw_registration_id,
201 const StatusAndRegistrationCallback& callback, 225 const scoped_refptr<RefCountedRegistration>& new_registration_ref,
202 ServiceWorkerStatusCode status); 226 const StatusAndRegistrationCallback& callback,
227 ServiceWorkerStatusCode status);
203 228
204 // Unregister callbacks 229 // Removes the background sync with periodicity |periodicity| and id
230 // |sync_registration_id|. Calls |callback| with
231 // BACKGROUND_SYNC_STATUS_NOT_FOUND if no match is found. Calls |callback|
232 // with BACKGROUND_SYNC_STATUS_OK on success.
233 void Unregister(
234 int64 sw_registration_id,
235 SyncPeriodicity periodicity,
236 BackgroundSyncRegistration::RegistrationId sync_registration_id,
237 const StatusCallback& callback);
205 void UnregisterImpl( 238 void UnregisterImpl(
206 int64 sw_registration_id, 239 int64 sw_registration_id,
207 const RegistrationKey& registration_key, 240 SyncPeriodicity periodicity,
208 BackgroundSyncRegistration::RegistrationId sync_registration_id, 241 BackgroundSyncRegistration::RegistrationId sync_registration_id,
209 SyncPeriodicity periodicity,
210 const StatusCallback& callback); 242 const StatusCallback& callback);
211 void UnregisterDidStore(int64 sw_registration_id, 243 void UnregisterDidStore(int64 sw_registration_id,
212 SyncPeriodicity periodicity, 244 SyncPeriodicity periodicity,
213 const StatusCallback& callback, 245 const StatusCallback& callback,
214 ServiceWorkerStatusCode status); 246 ServiceWorkerStatusCode status);
215 247
216 // GetRegistration callbacks 248 // GetRegistration callbacks
217 void GetRegistrationImpl(int64 sw_registration_id, 249 void GetRegistrationImpl(int64 sw_registration_id,
218 const RegistrationKey& registration_key, 250 const RegistrationKey& registration_key,
219 const StatusAndRegistrationCallback& callback); 251 const StatusAndRegistrationCallback& callback);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 static void OnAllSyncEventsCompleted(const base::TimeTicks& start_time, 300 static void OnAllSyncEventsCompleted(const base::TimeTicks& start_time,
269 int number_of_batched_sync_events); 301 int number_of_batched_sync_events);
270 302
271 // OnRegistrationDeleted callbacks 303 // OnRegistrationDeleted callbacks
272 void OnRegistrationDeletedImpl(int64 registration_id, 304 void OnRegistrationDeletedImpl(int64 registration_id,
273 const base::Closure& callback); 305 const base::Closure& callback);
274 306
275 // OnStorageWiped callbacks 307 // OnStorageWiped callbacks
276 void OnStorageWipedImpl(const base::Closure& callback); 308 void OnStorageWipedImpl(const base::Closure& callback);
277 309
310 scoped_ptr<ClientBackgroundSyncRegistration> CreateClientRegistration(
311 const RefCountedRegistration& registration);
312
278 void OnNetworkChanged(); 313 void OnNetworkChanged();
279 void OnPowerChanged(); 314 void OnPowerChanged();
280 315
281 // Operation Scheduling callback and convenience functions. 316 // Operation Scheduling callback and convenience functions.
282 template <typename CallbackT, typename... Params> 317 template <typename CallbackT, typename... Params>
283 void CompleteOperationCallback(const CallbackT& callback, 318 void CompleteOperationCallback(const CallbackT& callback,
284 Params... parameters); 319 Params... parameters);
320 void CompleteStatusAndRegistrationCallback(
321 StatusAndRegistrationCallback callback,
322 BackgroundSyncStatus status,
323 scoped_ptr<ClientBackgroundSyncRegistration> result);
324 void CompleteStatusAndRegistrationsCallback(
325 StatusAndRegistrationsCallback callback,
326 BackgroundSyncStatus status,
327 scoped_ptr<ScopedVector<ClientBackgroundSyncRegistration>> results);
285 base::Closure MakeEmptyCompletion(); 328 base::Closure MakeEmptyCompletion();
286 base::Closure MakeClosureCompletion(const base::Closure& callback); 329 base::Closure MakeClosureCompletion(const base::Closure& callback);
287 StatusAndRegistrationCallback MakeStatusAndRegistrationCompletion( 330 StatusAndRegistrationCallback MakeStatusAndRegistrationCompletion(
288 const StatusAndRegistrationCallback& callback); 331 const StatusAndRegistrationCallback& callback);
289 StatusAndRegistrationsCallback MakeStatusAndRegistrationsCompletion( 332 StatusAndRegistrationsCallback MakeStatusAndRegistrationsCompletion(
290 const StatusAndRegistrationsCallback& callback); 333 const StatusAndRegistrationsCallback& callback);
291 BackgroundSyncManager::StatusCallback MakeStatusCompletion( 334 BackgroundSyncManager::StatusCallback MakeStatusCompletion(
292 const StatusCallback& callback); 335 const StatusCallback& callback);
293 336
294 SWIdToRegistrationsMap sw_to_registrations_map_; 337 SWIdToRegistrationsMap sw_to_registrations_map_;
295 CacheStorageScheduler op_scheduler_; 338 CacheStorageScheduler op_scheduler_;
296 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_; 339 scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
297 bool disabled_; 340 bool disabled_;
298 341
299 scoped_ptr<BackgroundSyncNetworkObserver> network_observer_; 342 scoped_ptr<BackgroundSyncNetworkObserver> network_observer_;
300 scoped_ptr<BackgroundSyncPowerObserver> power_observer_; 343 scoped_ptr<BackgroundSyncPowerObserver> power_observer_;
301 344
345 // The registrations that clients might still reference.
346 IDMap<scoped_refptr<const RefCountedRegistration>, IDMapOwnPointer>
347 client_registration_ids_;
348
302 base::WeakPtrFactory<BackgroundSyncManager> weak_ptr_factory_; 349 base::WeakPtrFactory<BackgroundSyncManager> weak_ptr_factory_;
303 350
304 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncManager); 351 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncManager);
305 }; 352 };
306 353
307 } // namespace content 354 } // namespace content
308 355
309 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ 356 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698