| 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 "content/browser/background_sync/background_sync.pb.h" | 23 #include "content/browser/background_sync/background_sync.pb.h" |
| 24 #include "content/browser/background_sync/background_sync_registration.h" | 24 #include "content/browser/background_sync/background_sync_registration.h" |
| 25 #include "content/browser/background_sync/background_sync_status.h" | 25 #include "content/browser/background_sync/background_sync_status.h" |
| 26 #include "content/browser/cache_storage/cache_storage_scheduler.h" | 26 #include "content/browser/cache_storage/cache_storage_scheduler.h" |
| 27 #include "content/browser/service_worker/service_worker_context_observer.h" | 27 #include "content/browser/service_worker/service_worker_context_observer.h" |
| 28 #include "content/browser/service_worker/service_worker_storage.h" | 28 #include "content/browser/service_worker/service_worker_storage.h" |
| 29 #include "content/common/background_sync_service.mojom.h" | |
| 30 #include "content/common/content_export.h" | 29 #include "content/common/content_export.h" |
| 31 #include "content/common/service_worker/service_worker_status_code.h" | 30 #include "content/common/service_worker/service_worker_status_code.h" |
| 32 #include "content/public/browser/background_sync_parameters.h" | 31 #include "content/public/browser/background_sync_parameters.h" |
| 33 #include "content/public/browser/browser_thread.h" | 32 #include "content/public/browser/browser_thread.h" |
| 33 #include "third_party/WebKit/public/platform/modules/background_sync/background_
sync.mojom.h" |
| 34 #include "third_party/WebKit/public/platform/modules/permissions/permission_stat
us.mojom.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 blink { | 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 { |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 const std::string& backend_key, | 116 const std::string& backend_key, |
| 117 const std::string& data, | 117 const std::string& data, |
| 118 const ServiceWorkerStorage::StatusCallback& callback); | 118 const ServiceWorkerStorage::StatusCallback& callback); |
| 119 virtual void GetDataFromBackend( | 119 virtual void GetDataFromBackend( |
| 120 const std::string& backend_key, | 120 const std::string& backend_key, |
| 121 const ServiceWorkerStorage::GetUserDataForAllRegistrationsCallback& | 121 const ServiceWorkerStorage::GetUserDataForAllRegistrationsCallback& |
| 122 callback); | 122 callback); |
| 123 virtual void DispatchSyncEvent( | 123 virtual void DispatchSyncEvent( |
| 124 const std::string& tag, | 124 const std::string& tag, |
| 125 const scoped_refptr<ServiceWorkerVersion>& active_version, | 125 const scoped_refptr<ServiceWorkerVersion>& active_version, |
| 126 mojom::BackgroundSyncEventLastChance last_chance, | 126 blink::mojom::BackgroundSyncEventLastChance last_chance, |
| 127 const ServiceWorkerVersion::StatusCallback& callback); | 127 const ServiceWorkerVersion::StatusCallback& callback); |
| 128 virtual void ScheduleDelayedTask(const base::Closure& callback, | 128 virtual void ScheduleDelayedTask(const base::Closure& callback, |
| 129 base::TimeDelta delay); | 129 base::TimeDelta delay); |
| 130 virtual void HasMainFrameProviderHost(const GURL& origin, | 130 virtual void HasMainFrameProviderHost(const GURL& origin, |
| 131 const BoolCallback& callback); | 131 const BoolCallback& callback); |
| 132 | 132 |
| 133 private: | 133 private: |
| 134 friend class TestBackgroundSyncManager; | 134 friend class TestBackgroundSyncManager; |
| 135 friend class BackgroundSyncManagerTest; | 135 friend class BackgroundSyncManagerTest; |
| 136 | 136 |
| (...skipping 181 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 |