| 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_CORE_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CORE_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CORE_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CORE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 } | 35 } |
| 36 | 36 |
| 37 namespace storage { | 37 namespace storage { |
| 38 class QuotaManagerProxy; | 38 class QuotaManagerProxy; |
| 39 class SpecialStoragePolicy; | 39 class SpecialStoragePolicy; |
| 40 } | 40 } |
| 41 | 41 |
| 42 namespace content { | 42 namespace content { |
| 43 | 43 |
| 44 class EmbeddedWorkerRegistry; | 44 class EmbeddedWorkerRegistry; |
| 45 class ServiceWorkerContextObserver; | 45 class ServiceWorkerContextCoreObserver; |
| 46 class ServiceWorkerContextWrapper; | 46 class ServiceWorkerContextWrapper; |
| 47 class ServiceWorkerDatabaseTaskManager; | 47 class ServiceWorkerDatabaseTaskManager; |
| 48 class ServiceWorkerDispatcherHost; | 48 class ServiceWorkerDispatcherHost; |
| 49 class ServiceWorkerJobCoordinator; | 49 class ServiceWorkerJobCoordinator; |
| 50 class ServiceWorkerNavigationHandleCore; | 50 class ServiceWorkerNavigationHandleCore; |
| 51 class ServiceWorkerProviderHost; | 51 class ServiceWorkerProviderHost; |
| 52 class ServiceWorkerRegistration; | 52 class ServiceWorkerRegistration; |
| 53 class ServiceWorkerStorage; | 53 class ServiceWorkerStorage; |
| 54 | 54 |
| 55 // This class manages data associated with service workers. | 55 // This class manages data associated with service workers. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 std::unique_ptr<ProcessToProviderMap::iterator> process_iterator_; | 102 std::unique_ptr<ProcessToProviderMap::iterator> process_iterator_; |
| 103 std::unique_ptr<ProviderMap::iterator> provider_host_iterator_; | 103 std::unique_ptr<ProviderMap::iterator> provider_host_iterator_; |
| 104 | 104 |
| 105 DISALLOW_COPY_AND_ASSIGN(ProviderHostIterator); | 105 DISALLOW_COPY_AND_ASSIGN(ProviderHostIterator); |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 // This is owned by the StoragePartition, which will supply it with | 108 // This is owned by the StoragePartition, which will supply it with |
| 109 // the local path on disk. Given an empty |user_data_directory|, | 109 // the local path on disk. Given an empty |user_data_directory|, |
| 110 // nothing will be stored on disk. |observer_list| is created in | 110 // nothing will be stored on disk. |observer_list| is created in |
| 111 // ServiceWorkerContextWrapper. When Notify() of |observer_list| is called in | 111 // ServiceWorkerContextWrapper. When Notify() of |observer_list| is called in |
| 112 // ServiceWorkerContextCore, the methods of ServiceWorkerContextObserver will | 112 // ServiceWorkerContextCore, the methods of ServiceWorkerContextCoreObserver |
| 113 // be called on the thread which called AddObserver() of |observer_list|. | 113 // will be called on the thread which called AddObserver() of |observer_list|. |
| 114 ServiceWorkerContextCore( | 114 ServiceWorkerContextCore( |
| 115 const base::FilePath& user_data_directory, | 115 const base::FilePath& user_data_directory, |
| 116 std::unique_ptr<ServiceWorkerDatabaseTaskManager> | 116 std::unique_ptr<ServiceWorkerDatabaseTaskManager> |
| 117 database_task_runner_manager, | 117 database_task_runner_manager, |
| 118 const scoped_refptr<base::SingleThreadTaskRunner>& disk_cache_thread, | 118 const scoped_refptr<base::SingleThreadTaskRunner>& disk_cache_thread, |
| 119 storage::QuotaManagerProxy* quota_manager_proxy, | 119 storage::QuotaManagerProxy* quota_manager_proxy, |
| 120 storage::SpecialStoragePolicy* special_storage_policy, | 120 storage::SpecialStoragePolicy* special_storage_policy, |
| 121 base::ObserverListThreadSafe<ServiceWorkerContextObserver>* observer_list, | 121 base::ObserverListThreadSafe<ServiceWorkerContextCoreObserver>* |
| 122 observer_list, |
| 122 ServiceWorkerContextWrapper* wrapper); | 123 ServiceWorkerContextWrapper* wrapper); |
| 123 ServiceWorkerContextCore( | 124 ServiceWorkerContextCore( |
| 124 ServiceWorkerContextCore* old_context, | 125 ServiceWorkerContextCore* old_context, |
| 125 ServiceWorkerContextWrapper* wrapper); | 126 ServiceWorkerContextWrapper* wrapper); |
| 126 ~ServiceWorkerContextCore() override; | 127 ~ServiceWorkerContextCore() override; |
| 127 | 128 |
| 128 // ServiceWorkerVersion::Listener overrides. | 129 // ServiceWorkerVersion::Listener overrides. |
| 129 void OnRunningStateChanged(ServiceWorkerVersion* version) override; | 130 void OnRunningStateChanged(ServiceWorkerVersion* version) override; |
| 130 void OnVersionStateChanged(ServiceWorkerVersion* version) override; | 131 void OnVersionStateChanged(ServiceWorkerVersion* version) override; |
| 131 void OnDevToolsRoutingIdChanged(ServiceWorkerVersion* version) override; | 132 void OnDevToolsRoutingIdChanged(ServiceWorkerVersion* version) override; |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 std::map<int, ServiceWorkerNavigationHandleCore*> | 378 std::map<int, ServiceWorkerNavigationHandleCore*> |
| 378 navigation_handle_cores_map_; | 379 navigation_handle_cores_map_; |
| 379 | 380 |
| 380 bool force_update_on_page_load_; | 381 bool force_update_on_page_load_; |
| 381 int next_handle_id_; | 382 int next_handle_id_; |
| 382 int next_registration_handle_id_; | 383 int next_registration_handle_id_; |
| 383 // Set in RegisterServiceWorker(), cleared in ClearAllServiceWorkersForTest(). | 384 // Set in RegisterServiceWorker(), cleared in ClearAllServiceWorkersForTest(). |
| 384 // This is used to avoid unnecessary disk read operation in tests. This value | 385 // This is used to avoid unnecessary disk read operation in tests. This value |
| 385 // is false if Chrome was relaunched after service workers were registered. | 386 // is false if Chrome was relaunched after service workers were registered. |
| 386 bool was_service_worker_registered_; | 387 bool was_service_worker_registered_; |
| 387 scoped_refptr<base::ObserverListThreadSafe<ServiceWorkerContextObserver>> | 388 scoped_refptr<base::ObserverListThreadSafe<ServiceWorkerContextCoreObserver>> |
| 388 observer_list_; | 389 observer_list_; |
| 389 base::WeakPtrFactory<ServiceWorkerContextCore> weak_factory_; | 390 base::WeakPtrFactory<ServiceWorkerContextCore> weak_factory_; |
| 390 | 391 |
| 391 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextCore); | 392 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextCore); |
| 392 }; | 393 }; |
| 393 | 394 |
| 394 } // namespace content | 395 } // namespace content |
| 395 | 396 |
| 396 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CORE_H_ | 397 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_CORE_H_ |
| OLD | NEW |