OLD | NEW |
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 <list> | 8 #include <list> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // null. | 166 // null. |
167 bool LookupRegistration(int64 sw_registration_id, | 167 bool LookupRegistration(int64 sw_registration_id, |
168 const std::string& sync_registration_name, | 168 const std::string& sync_registration_name, |
169 BackgroundSyncRegistration* existing_registration); | 169 BackgroundSyncRegistration* existing_registration); |
170 | 170 |
171 // Store all registrations for a given |sw_registration_id|. | 171 // Store all registrations for a given |sw_registration_id|. |
172 void StoreRegistrations(const GURL& origin, | 172 void StoreRegistrations(const GURL& origin, |
173 int64 sw_registration_id, | 173 int64 sw_registration_id, |
174 const ServiceWorkerStorage::StatusCallback& callback); | 174 const ServiceWorkerStorage::StatusCallback& callback); |
175 | 175 |
176 // If the registration is in the map, removes it and returns the removed | 176 // Removes the registration if it is in the map. |
177 // registration in |old_registration|. |old_registration| may be null. | |
178 void RemoveRegistrationFromMap(int64 sw_registration_id, | 177 void RemoveRegistrationFromMap(int64 sw_registration_id, |
179 const std::string& sync_registration_name, | 178 const std::string& sync_registration_name); |
180 BackgroundSyncRegistration* old_registration); | |
181 | 179 |
182 void AddRegistrationToMap( | 180 void AddRegistrationToMap( |
183 int64 sw_registration_id, | 181 int64 sw_registration_id, |
184 const BackgroundSyncRegistration& sync_registration); | 182 const BackgroundSyncRegistration& sync_registration); |
185 | 183 |
186 void InitImpl(const base::Closure& callback); | 184 void InitImpl(const base::Closure& callback); |
187 void InitDidGetDataFromBackend( | 185 void InitDidGetDataFromBackend( |
188 const base::Closure& callback, | 186 const base::Closure& callback, |
189 const std::vector<std::pair<int64, std::string>>& user_data, | 187 const std::vector<std::pair<int64, std::string>>& user_data, |
190 ServiceWorkerStatusCode status); | 188 ServiceWorkerStatusCode status); |
(...skipping 10 matching lines...) Expand all Loading... |
201 | 199 |
202 // Unregister callbacks | 200 // Unregister callbacks |
203 void UnregisterImpl( | 201 void UnregisterImpl( |
204 const GURL& origin, | 202 const GURL& origin, |
205 int64 sw_registration_id, | 203 int64 sw_registration_id, |
206 const std::string& sync_registration_name, | 204 const std::string& sync_registration_name, |
207 BackgroundSyncRegistration::RegistrationId sync_registration_id, | 205 BackgroundSyncRegistration::RegistrationId sync_registration_id, |
208 const StatusCallback& callback); | 206 const StatusCallback& callback); |
209 void UnregisterDidStore( | 207 void UnregisterDidStore( |
210 int64 sw_registration_id, | 208 int64 sw_registration_id, |
211 const BackgroundSyncRegistration& old_sync_registration, | |
212 const StatusCallback& callback, | 209 const StatusCallback& callback, |
213 ServiceWorkerStatusCode status); | 210 ServiceWorkerStatusCode status); |
214 | 211 |
215 // GetRegistration callbacks | 212 // GetRegistration callbacks |
216 void GetRegistrationImpl(const GURL& origin, | 213 void GetRegistrationImpl(const GURL& origin, |
217 int64 sw_registration_id, | 214 int64 sw_registration_id, |
218 const std::string sync_registration_name, | 215 const std::string sync_registration_name, |
219 const StatusAndRegistrationCallback& callback); | 216 const StatusAndRegistrationCallback& callback); |
220 | 217 |
221 // OnRegistrationDeleted callbacks | 218 // OnRegistrationDeleted callbacks |
(...skipping 23 matching lines...) Expand all Loading... |
245 bool disabled_; | 242 bool disabled_; |
246 | 243 |
247 base::WeakPtrFactory<BackgroundSyncManager> weak_ptr_factory_; | 244 base::WeakPtrFactory<BackgroundSyncManager> weak_ptr_factory_; |
248 | 245 |
249 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncManager); | 246 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncManager); |
250 }; | 247 }; |
251 | 248 |
252 } // namespace content | 249 } // namespace content |
253 | 250 |
254 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ | 251 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ |
OLD | NEW |