| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/files/file_path.h" | 14 #include "base/files/file_path.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
| 17 #include "content/browser/service_worker/service_worker_context_core.h" | 17 #include "content/browser/service_worker/service_worker_context_core.h" |
| 18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
| 19 #include "content/public/browser/service_worker_context.h" | 19 #include "content/public/browser/service_worker_context.h" |
| 20 | 20 |
| 21 namespace base { | 21 namespace base { |
| 22 class FilePath; | 22 class FilePath; |
| 23 class SingleThreadTaskRunner; | 23 class SingleThreadTaskRunner; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace blink { | |
| 27 enum class WebNavigationHintType; | |
| 28 } | |
| 29 | |
| 30 namespace storage { | 26 namespace storage { |
| 31 class QuotaManagerProxy; | 27 class QuotaManagerProxy; |
| 32 class SpecialStoragePolicy; | 28 class SpecialStoragePolicy; |
| 33 } | 29 } |
| 34 | 30 |
| 35 namespace content { | 31 namespace content { |
| 36 | 32 |
| 37 class BrowserContext; | 33 class BrowserContext; |
| 38 class ResourceContext; | 34 class ResourceContext; |
| 39 class ServiceWorkerContextCore; | 35 class ServiceWorkerContextCore; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 const ResultCallback& callback) override; | 98 const ResultCallback& callback) override; |
| 103 void CheckHasServiceWorker( | 99 void CheckHasServiceWorker( |
| 104 const GURL& url, | 100 const GURL& url, |
| 105 const GURL& other_url, | 101 const GURL& other_url, |
| 106 const CheckHasServiceWorkerCallback& callback) override; | 102 const CheckHasServiceWorkerCallback& callback) override; |
| 107 void CountExternalRequestsForTest( | 103 void CountExternalRequestsForTest( |
| 108 const GURL& url, | 104 const GURL& url, |
| 109 const CountExternalRequestsCallback& callback) override; | 105 const CountExternalRequestsCallback& callback) override; |
| 110 void StopAllServiceWorkersForOrigin(const GURL& origin) override; | 106 void StopAllServiceWorkersForOrigin(const GURL& origin) override; |
| 111 void ClearAllServiceWorkersForTest(const base::Closure& callback) override; | 107 void ClearAllServiceWorkersForTest(const base::Closure& callback) override; |
| 112 void StartServiceWorkerForNavigationHint( | |
| 113 const GURL& document_url, | |
| 114 blink::WebNavigationHintType type, | |
| 115 int render_process_id, | |
| 116 const ResultCallback& callback) override; | |
| 117 bool StartingExternalRequest(int64_t service_worker_version_id, | 108 bool StartingExternalRequest(int64_t service_worker_version_id, |
| 118 const std::string& request_uuid) override; | 109 const std::string& request_uuid) override; |
| 119 bool FinishedExternalRequest(int64_t service_worker_version_id, | 110 bool FinishedExternalRequest(int64_t service_worker_version_id, |
| 120 const std::string& request_uuid) override; | 111 const std::string& request_uuid) override; |
| 121 | 112 |
| 122 // These methods must only be called from the IO thread. | 113 // These methods must only be called from the IO thread. |
| 123 ServiceWorkerRegistration* GetLiveRegistration(int64_t registration_id); | 114 ServiceWorkerRegistration* GetLiveRegistration(int64_t registration_id); |
| 124 ServiceWorkerVersion* GetLiveVersion(int64_t version_id); | 115 ServiceWorkerVersion* GetLiveVersion(int64_t version_id); |
| 125 std::vector<ServiceWorkerRegistrationInfo> GetAllLiveRegistrationInfo(); | 116 std::vector<ServiceWorkerRegistrationInfo> GetAllLiveRegistrationInfo(); |
| 126 std::vector<ServiceWorkerVersionInfo> GetAllLiveVersionInfo(); | 117 std::vector<ServiceWorkerVersionInfo> GetAllLiveVersionInfo(); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 ServiceWorkerStatusCode status, | 257 ServiceWorkerStatusCode status, |
| 267 const std::vector<ServiceWorkerRegistrationInfo>& registrations); | 258 const std::vector<ServiceWorkerRegistrationInfo>& registrations); |
| 268 | 259 |
| 269 void DidCheckHasServiceWorker(const CheckHasServiceWorkerCallback& callback, | 260 void DidCheckHasServiceWorker(const CheckHasServiceWorkerCallback& callback, |
| 270 content::ServiceWorkerCapability status); | 261 content::ServiceWorkerCapability status); |
| 271 | 262 |
| 272 void DidFindRegistrationForUpdate( | 263 void DidFindRegistrationForUpdate( |
| 273 ServiceWorkerStatusCode status, | 264 ServiceWorkerStatusCode status, |
| 274 scoped_refptr<content::ServiceWorkerRegistration> registration); | 265 scoped_refptr<content::ServiceWorkerRegistration> registration); |
| 275 | 266 |
| 276 void DidCheckRenderProcessForNavigationHint(const GURL& document_url, | |
| 277 blink::WebNavigationHintType type, | |
| 278 int render_process_id, | |
| 279 const ResultCallback& callback); | |
| 280 | |
| 281 void DidFindRegistrationForNavigationHint( | |
| 282 blink::WebNavigationHintType type, | |
| 283 int render_process_id, | |
| 284 const ResultCallback& callback, | |
| 285 ServiceWorkerStatusCode status, | |
| 286 scoped_refptr<ServiceWorkerRegistration> registration); | |
| 287 | |
| 288 void DidStartServiceWorkerForNavigationHint(const GURL& pattern, | |
| 289 int render_process_id, | |
| 290 const ResultCallback& callback, | |
| 291 ServiceWorkerStatusCode code); | |
| 292 | |
| 293 // The core context is only for use on the IO thread. | 267 // The core context is only for use on the IO thread. |
| 294 // Can be null before/during init, during/after shutdown, and after | 268 // Can be null before/during init, during/after shutdown, and after |
| 295 // DeleteAndStartOver fails. | 269 // DeleteAndStartOver fails. |
| 296 ServiceWorkerContextCore* context(); | 270 ServiceWorkerContextCore* context(); |
| 297 | 271 |
| 298 const scoped_refptr<base::ObserverListThreadSafe< | 272 const scoped_refptr<base::ObserverListThreadSafe< |
| 299 ServiceWorkerContextObserver>> observer_list_; | 273 ServiceWorkerContextObserver>> observer_list_; |
| 300 const std::unique_ptr<ServiceWorkerProcessManager> process_manager_; | 274 const std::unique_ptr<ServiceWorkerProcessManager> process_manager_; |
| 301 // Cleared in ShutdownOnIO(): | 275 // Cleared in ShutdownOnIO(): |
| 302 std::unique_ptr<ServiceWorkerContextCore> context_core_; | 276 std::unique_ptr<ServiceWorkerContextCore> context_core_; |
| 303 | 277 |
| 304 // Initialized in Init(); true if the user data directory is empty. | 278 // Initialized in Init(); true if the user data directory is empty. |
| 305 bool is_incognito_; | 279 bool is_incognito_; |
| 306 | 280 |
| 307 // Raw pointer to the StoragePartitionImpl owning |this|. | 281 // Raw pointer to the StoragePartitionImpl owning |this|. |
| 308 StoragePartitionImpl* storage_partition_; | 282 StoragePartitionImpl* storage_partition_; |
| 309 | 283 |
| 310 // The ResourceContext associated with this context. | 284 // The ResourceContext associated with this context. |
| 311 ResourceContext* resource_context_; | 285 ResourceContext* resource_context_; |
| 312 | 286 |
| 313 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextWrapper); | 287 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextWrapper); |
| 314 }; | 288 }; |
| 315 | 289 |
| 316 } // namespace content | 290 } // namespace content |
| 317 | 291 |
| 318 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ | 292 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ |
| OLD | NEW |