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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <map> | 11 #include <map> |
12 #include <memory> | 12 #include <memory> |
13 #include <string> | 13 #include <string> |
14 #include <utility> | 14 #include <utility> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/callback_forward.h" | 17 #include "base/callback_forward.h" |
18 #include "base/cancelable_callback.h" | 18 #include "base/cancelable_callback.h" |
19 #include "base/macros.h" | 19 #include "base/macros.h" |
20 #include "base/memory/scoped_vector.h" | 20 #include "base/memory/scoped_vector.h" |
21 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
22 #include "base/time/clock.h" | 22 #include "base/time/clock.h" |
23 #include "components/permissions/permission_status.mojom.h" | |
24 #include "content/browser/background_sync/background_sync.pb.h" | 23 #include "content/browser/background_sync/background_sync.pb.h" |
25 #include "content/browser/background_sync/background_sync_registration.h" | 24 #include "content/browser/background_sync/background_sync_registration.h" |
26 #include "content/browser/background_sync/background_sync_status.h" | 25 #include "content/browser/background_sync/background_sync_status.h" |
27 #include "content/browser/cache_storage/cache_storage_scheduler.h" | 26 #include "content/browser/cache_storage/cache_storage_scheduler.h" |
28 #include "content/browser/service_worker/service_worker_context_observer.h" | 27 #include "content/browser/service_worker/service_worker_context_observer.h" |
29 #include "content/browser/service_worker/service_worker_storage.h" | 28 #include "content/browser/service_worker/service_worker_storage.h" |
30 #include "content/common/background_sync_service.mojom.h" | 29 #include "content/common/background_sync_service.mojom.h" |
31 #include "content/common/content_export.h" | 30 #include "content/common/content_export.h" |
32 #include "content/common/service_worker/service_worker_status_code.h" | 31 #include "content/common/service_worker/service_worker_status_code.h" |
33 #include "content/public/browser/background_sync_parameters.h" | 32 #include "content/public/browser/background_sync_parameters.h" |
34 #include "content/public/browser/browser_thread.h" | 33 #include "content/public/browser/browser_thread.h" |
| 34 #include "third_party/WebKit/public/platform/modules/permissions/permission_stat
us.mojom.h" |
35 #include "url/gurl.h" | 35 #include "url/gurl.h" |
36 | 36 |
37 namespace permissions { | 37 namespace blink { |
38 namespace mojom { | 38 namespace mojom { |
39 enum class PermissionStatus; | 39 enum class PermissionStatus; |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
43 namespace content { | 43 namespace content { |
44 | 44 |
45 class BackgroundSyncNetworkObserver; | 45 class BackgroundSyncNetworkObserver; |
46 class ServiceWorkerContextWrapper; | 46 class ServiceWorkerContextWrapper; |
47 | 47 |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 const BackgroundSyncRegistrationOptions& options, | 202 const BackgroundSyncRegistrationOptions& options, |
203 const StatusAndRegistrationCallback& callback, | 203 const StatusAndRegistrationCallback& callback, |
204 bool has_main_frame_client); | 204 bool has_main_frame_client); |
205 void RegisterImpl(int64_t sw_registration_id, | 205 void RegisterImpl(int64_t sw_registration_id, |
206 const BackgroundSyncRegistrationOptions& options, | 206 const BackgroundSyncRegistrationOptions& options, |
207 const StatusAndRegistrationCallback& callback); | 207 const StatusAndRegistrationCallback& callback); |
208 void RegisterDidAskForPermission( | 208 void RegisterDidAskForPermission( |
209 int64_t sw_registration_id, | 209 int64_t sw_registration_id, |
210 const BackgroundSyncRegistrationOptions& options, | 210 const BackgroundSyncRegistrationOptions& options, |
211 const StatusAndRegistrationCallback& callback, | 211 const StatusAndRegistrationCallback& callback, |
212 permissions::mojom::PermissionStatus permission_status); | 212 blink::mojom::PermissionStatus permission_status); |
213 void RegisterDidStore(int64_t sw_registration_id, | 213 void RegisterDidStore(int64_t sw_registration_id, |
214 const BackgroundSyncRegistration& new_registration, | 214 const BackgroundSyncRegistration& new_registration, |
215 const StatusAndRegistrationCallback& callback, | 215 const StatusAndRegistrationCallback& callback, |
216 ServiceWorkerStatusCode status); | 216 ServiceWorkerStatusCode status); |
217 | 217 |
218 // GetRegistrations callbacks | 218 // GetRegistrations callbacks |
219 void GetRegistrationsImpl(int64_t sw_registration_id, | 219 void GetRegistrationsImpl(int64_t sw_registration_id, |
220 const StatusAndRegistrationsCallback& callback); | 220 const StatusAndRegistrationsCallback& callback); |
221 | 221 |
222 bool AreOptionConditionsMet(const BackgroundSyncRegistrationOptions& options); | 222 bool AreOptionConditionsMet(const BackgroundSyncRegistrationOptions& options); |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 std::unique_ptr<base::Clock> clock_; | 318 std::unique_ptr<base::Clock> clock_; |
319 | 319 |
320 base::WeakPtrFactory<BackgroundSyncManager> weak_ptr_factory_; | 320 base::WeakPtrFactory<BackgroundSyncManager> weak_ptr_factory_; |
321 | 321 |
322 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncManager); | 322 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncManager); |
323 }; | 323 }; |
324 | 324 |
325 } // namespace content | 325 } // namespace content |
326 | 326 |
327 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ | 327 #endif // CONTENT_BROWSER_BACKGROUND_SYNC_BACKGROUND_SYNC_MANAGER_H_ |
OLD | NEW |