| 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> |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 const CheckHasServiceWorkerCallback& callback) override; | 103 const CheckHasServiceWorkerCallback& callback) override; |
| 104 void CountExternalRequestsForTest( | 104 void CountExternalRequestsForTest( |
| 105 const GURL& url, | 105 const GURL& url, |
| 106 const CountExternalRequestsCallback& callback) override; | 106 const CountExternalRequestsCallback& callback) override; |
| 107 void StopAllServiceWorkersForOrigin(const GURL& origin) override; | 107 void StopAllServiceWorkersForOrigin(const GURL& origin) override; |
| 108 void ClearAllServiceWorkersForTest(const base::Closure& callback) override; | 108 void ClearAllServiceWorkersForTest(const base::Closure& callback) override; |
| 109 bool StartingExternalRequest(int64_t service_worker_version_id, | 109 bool StartingExternalRequest(int64_t service_worker_version_id, |
| 110 const std::string& request_uuid) override; | 110 const std::string& request_uuid) override; |
| 111 bool FinishedExternalRequest(int64_t service_worker_version_id, | 111 bool FinishedExternalRequest(int64_t service_worker_version_id, |
| 112 const std::string& request_uuid) override; | 112 const std::string& request_uuid) override; |
| 113 void StartServiceWorkerForNavigationPreconnect( |
| 114 const GURL& document_url, |
| 115 RenderProcessHost* host, |
| 116 const ResultCallback& callback) override; |
| 113 | 117 |
| 114 // These methods must only be called from the IO thread. | 118 // These methods must only be called from the IO thread. |
| 115 ServiceWorkerRegistration* GetLiveRegistration(int64_t registration_id); | 119 ServiceWorkerRegistration* GetLiveRegistration(int64_t registration_id); |
| 116 ServiceWorkerVersion* GetLiveVersion(int64_t version_id); | 120 ServiceWorkerVersion* GetLiveVersion(int64_t version_id); |
| 117 std::vector<ServiceWorkerRegistrationInfo> GetAllLiveRegistrationInfo(); | 121 std::vector<ServiceWorkerRegistrationInfo> GetAllLiveRegistrationInfo(); |
| 118 std::vector<ServiceWorkerVersionInfo> GetAllLiveVersionInfo(); | 122 std::vector<ServiceWorkerVersionInfo> GetAllLiveVersionInfo(); |
| 119 | 123 |
| 120 // Must be called from the IO thread. | 124 // Must be called from the IO thread. |
| 121 void HasMainFrameProviderHost(const GURL& origin, | 125 void HasMainFrameProviderHost(const GURL& origin, |
| 122 const BoolCallback& callback) const; | 126 const BoolCallback& callback) const; |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 ServiceWorkerStatusCode status, | 276 ServiceWorkerStatusCode status, |
| 273 const std::vector<ServiceWorkerRegistrationInfo>& registrations); | 277 const std::vector<ServiceWorkerRegistrationInfo>& registrations); |
| 274 | 278 |
| 275 void DidCheckHasServiceWorker(const CheckHasServiceWorkerCallback& callback, | 279 void DidCheckHasServiceWorker(const CheckHasServiceWorkerCallback& callback, |
| 276 content::ServiceWorkerCapability status); | 280 content::ServiceWorkerCapability status); |
| 277 | 281 |
| 278 void DidFindRegistrationForUpdate( | 282 void DidFindRegistrationForUpdate( |
| 279 ServiceWorkerStatusCode status, | 283 ServiceWorkerStatusCode status, |
| 280 scoped_refptr<content::ServiceWorkerRegistration> registration); | 284 scoped_refptr<content::ServiceWorkerRegistration> registration); |
| 281 | 285 |
| 286 void DidCheckRenderProcessForNavigationPreconnect( |
| 287 const GURL& document_url, |
| 288 int render_process_id, |
| 289 const ResultCallback& callback); |
| 290 |
| 291 void DidFindRegistrationForNavigationPreconnect( |
| 292 int render_process_id, |
| 293 const ResultCallback& callback, |
| 294 ServiceWorkerStatusCode status, |
| 295 scoped_refptr<ServiceWorkerRegistration> registration); |
| 296 |
| 297 void DidStartServiceWorkerForNavigationPreconnect( |
| 298 const GURL& pattern, |
| 299 int render_process_id, |
| 300 const ResultCallback& callback, |
| 301 ServiceWorkerStatusCode code); |
| 302 |
| 282 // The core context is only for use on the IO thread. | 303 // The core context is only for use on the IO thread. |
| 283 // Can be null before/during init, during/after shutdown, and after | 304 // Can be null before/during init, during/after shutdown, and after |
| 284 // DeleteAndStartOver fails. | 305 // DeleteAndStartOver fails. |
| 285 ServiceWorkerContextCore* context(); | 306 ServiceWorkerContextCore* context(); |
| 286 | 307 |
| 287 const scoped_refptr<base::ObserverListThreadSafe< | 308 const scoped_refptr<base::ObserverListThreadSafe< |
| 288 ServiceWorkerContextObserver>> observer_list_; | 309 ServiceWorkerContextObserver>> observer_list_; |
| 289 const std::unique_ptr<ServiceWorkerProcessManager> process_manager_; | 310 const std::unique_ptr<ServiceWorkerProcessManager> process_manager_; |
| 290 // Cleared in ShutdownOnIO(): | 311 // Cleared in ShutdownOnIO(): |
| 291 std::unique_ptr<ServiceWorkerContextCore> context_core_; | 312 std::unique_ptr<ServiceWorkerContextCore> context_core_; |
| 292 | 313 |
| 293 // Initialized in Init(); true if the user data directory is empty. | 314 // Initialized in Init(); true if the user data directory is empty. |
| 294 bool is_incognito_; | 315 bool is_incognito_; |
| 295 | 316 |
| 296 // Raw pointer to the StoragePartitionImpl owning |this|. | 317 // Raw pointer to the StoragePartitionImpl owning |this|. |
| 297 StoragePartitionImpl* storage_partition_; | 318 StoragePartitionImpl* storage_partition_; |
| 298 | 319 |
| 299 // The ResourceContext associated with this context. | 320 // The ResourceContext associated with this context. |
| 300 ResourceContext* resource_context_; | 321 ResourceContext* resource_context_; |
| 301 | 322 |
| 302 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextWrapper); | 323 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextWrapper); |
| 303 }; | 324 }; |
| 304 | 325 |
| 305 } // namespace content | 326 } // namespace content |
| 306 | 327 |
| 307 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ | 328 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ |
| OLD | NEW |