Chromium Code Reviews| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 bool OriginHasForeignFetchRegistrations(const GURL& origin); | 237 bool OriginHasForeignFetchRegistrations(const GURL& origin); |
| 238 | 238 |
| 239 // Binds the ServiceWorkerWorkerClient of a dedicated (or shared) worker to | 239 // Binds the ServiceWorkerWorkerClient of a dedicated (or shared) worker to |
| 240 // the parent frame's ServiceWorkerProviderHost. (This is used only when | 240 // the parent frame's ServiceWorkerProviderHost. (This is used only when |
| 241 // off-main-thread-fetch is enabled.) | 241 // off-main-thread-fetch is enabled.) |
| 242 void BindWorkerFetchContext( | 242 void BindWorkerFetchContext( |
| 243 int render_process_id, | 243 int render_process_id, |
| 244 int service_worker_provider_id, | 244 int service_worker_provider_id, |
| 245 mojom::ServiceWorkerWorkerClientAssociatedPtrInfo client_ptr_info); | 245 mojom::ServiceWorkerWorkerClientAssociatedPtrInfo client_ptr_info); |
| 246 | 246 |
| 247 // The core context is only for use on the IO thread. | |
| 248 // Can be null before/during init, during/after shutdown, and after | |
| 249 // DeleteAndStartOver fails. | |
| 250 ServiceWorkerContextCore* context(); | |
|
falken
2017/06/30 01:14:36
This represents a big shift in this class's role.
gogerald1
2017/06/30 02:55:22
Done.
| |
| 251 | |
| 247 private: | 252 private: |
| 248 friend class BackgroundSyncManagerTest; | 253 friend class BackgroundSyncManagerTest; |
| 249 friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>; | 254 friend class base::RefCountedThreadSafe<ServiceWorkerContextWrapper>; |
| 250 friend class EmbeddedWorkerTestHelper; | 255 friend class EmbeddedWorkerTestHelper; |
| 251 friend class EmbeddedWorkerBrowserTest; | 256 friend class EmbeddedWorkerBrowserTest; |
| 252 friend class ForeignFetchRequestHandler; | 257 friend class ForeignFetchRequestHandler; |
| 253 friend class ServiceWorkerDispatcherHost; | 258 friend class ServiceWorkerDispatcherHost; |
| 254 friend class ServiceWorkerInternalsUI; | 259 friend class ServiceWorkerInternalsUI; |
| 255 friend class ServiceWorkerNavigationHandleCore; | 260 friend class ServiceWorkerNavigationHandleCore; |
| 256 friend class ServiceWorkerProcessManager; | 261 friend class ServiceWorkerProcessManager; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 297 void DidFindRegistrationForNavigationHint( | 302 void DidFindRegistrationForNavigationHint( |
| 298 const StartServiceWorkerForNavigationHintCallback& callback, | 303 const StartServiceWorkerForNavigationHintCallback& callback, |
| 299 ServiceWorkerStatusCode status, | 304 ServiceWorkerStatusCode status, |
| 300 scoped_refptr<ServiceWorkerRegistration> registration); | 305 scoped_refptr<ServiceWorkerRegistration> registration); |
| 301 | 306 |
| 302 void DidStartServiceWorkerForNavigationHint( | 307 void DidStartServiceWorkerForNavigationHint( |
| 303 const GURL& pattern, | 308 const GURL& pattern, |
| 304 const StartServiceWorkerForNavigationHintCallback& callback, | 309 const StartServiceWorkerForNavigationHintCallback& callback, |
| 305 ServiceWorkerStatusCode code); | 310 ServiceWorkerStatusCode code); |
| 306 | 311 |
| 307 // The core context is only for use on the IO thread. | |
| 308 // Can be null before/during init, during/after shutdown, and after | |
| 309 // DeleteAndStartOver fails. | |
| 310 ServiceWorkerContextCore* context(); | |
| 311 | |
| 312 // Observers of |context_core_| which live within content's implementation | 312 // Observers of |context_core_| which live within content's implementation |
| 313 // boundary. Shared with |context_core_|. | 313 // boundary. Shared with |context_core_|. |
| 314 const scoped_refptr< | 314 const scoped_refptr< |
| 315 base::ObserverListThreadSafe<ServiceWorkerContextCoreObserver>> | 315 base::ObserverListThreadSafe<ServiceWorkerContextCoreObserver>> |
| 316 core_observer_list_; | 316 core_observer_list_; |
| 317 | 317 |
| 318 // Observers which live outside content's implementation boundary. Observer | 318 // Observers which live outside content's implementation boundary. Observer |
| 319 // methods will always be dispatched on the UI thread. | 319 // methods will always be dispatched on the UI thread. |
| 320 base::ObserverList<ServiceWorkerContextObserver> observer_list_; | 320 base::ObserverList<ServiceWorkerContextObserver> observer_list_; |
| 321 | 321 |
| 322 const std::unique_ptr<ServiceWorkerProcessManager> process_manager_; | 322 const std::unique_ptr<ServiceWorkerProcessManager> process_manager_; |
| 323 // Cleared in ShutdownOnIO(): | 323 // Cleared in ShutdownOnIO(): |
| 324 std::unique_ptr<ServiceWorkerContextCore> context_core_; | 324 std::unique_ptr<ServiceWorkerContextCore> context_core_; |
| 325 | 325 |
| 326 // Initialized in Init(); true if the user data directory is empty. | 326 // Initialized in Init(); true if the user data directory is empty. |
| 327 bool is_incognito_; | 327 bool is_incognito_; |
| 328 | 328 |
| 329 // Raw pointer to the StoragePartitionImpl owning |this|. | 329 // Raw pointer to the StoragePartitionImpl owning |this|. |
| 330 StoragePartitionImpl* storage_partition_; | 330 StoragePartitionImpl* storage_partition_; |
| 331 | 331 |
| 332 // The ResourceContext associated with this context. | 332 // The ResourceContext associated with this context. |
| 333 ResourceContext* resource_context_; | 333 ResourceContext* resource_context_; |
| 334 | 334 |
| 335 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextWrapper); | 335 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextWrapper); |
| 336 }; | 336 }; |
| 337 | 337 |
| 338 } // namespace content | 338 } // namespace content |
| 339 | 339 |
| 340 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ | 340 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_WRAPPER_H_ |
| OLD | NEW |