Chromium Code Reviews| Index: content/child/service_worker/service_worker_network_provider.h |
| diff --git a/content/child/service_worker/service_worker_network_provider.h b/content/child/service_worker/service_worker_network_provider.h |
| index c991aecb80f7240f0394f3b3df940a49acf9d9c2..df23b03b05c865cefef2f1f9a10222e22a0b7820 100644 |
| --- a/content/child/service_worker/service_worker_network_provider.h |
| +++ b/content/child/service_worker/service_worker_network_provider.h |
| @@ -18,12 +18,13 @@ |
| namespace blink { |
| class WebLocalFrame; |
| +class WebServiceWorkerNetworkProvider; |
| } // namespace blink |
| namespace content { |
| -class ServiceWorkerProviderContext; |
| struct RequestNavigationParams; |
| +class ServiceWorkerProviderContext; |
| // A unique provider_id is generated for each instance. |
| // Instantiated prior to the main resource load being started and remains |
| @@ -35,22 +36,20 @@ struct RequestNavigationParams; |
| // |
| // Basically, it's a scoped integer that sends an ipc upon construction |
| // and destruction. |
| -class CONTENT_EXPORT ServiceWorkerNetworkProvider |
| - : public base::SupportsUserData::Data { |
| +class CONTENT_EXPORT ServiceWorkerNetworkProvider { |
| public: |
| - // Ownership is transferred to the DocumentState. |
| - static void AttachToDocumentState( |
| - base::SupportsUserData* document_state, |
| - std::unique_ptr<ServiceWorkerNetworkProvider> network_provider); |
| - |
| - static ServiceWorkerNetworkProvider* FromDocumentState( |
| - base::SupportsUserData* document_state); |
| - |
| - static std::unique_ptr<ServiceWorkerNetworkProvider> CreateForNavigation( |
| - int route_id, |
| - const RequestNavigationParams& request_params, |
| - blink::WebLocalFrame* frame, |
| - bool content_initiated); |
| + // Creates a ServiceWorkerNetworkProvider for navigation and wraps it |
| + // with WebServiceWorkerNetworkProvider to be owned by blink. |
|
falken
2017/03/10 04:26:00
super nitty: Blink ("blink" for the namespace only
kinuko
2017/03/10 05:52:28
Done.
|
| + static std::unique_ptr<blink::WebServiceWorkerNetworkProvider> |
| + CreateForNavigation(int route_id, |
| + const RequestNavigationParams& request_params, |
| + blink::WebLocalFrame* frame, |
| + bool content_initiated); |
| + |
| + // Returns inward ServiceWorkerNetworkProvider. Valid only for |
| + // WebServiceWorkerNetworkProvider created by CreateForNavigation. |
| + static ServiceWorkerNetworkProvider* GetInwardProviderForNavigation( |
|
falken
2017/03/10 04:26:00
"Inward" seems like an uncommon term. Would "FromW
kinuko
2017/03/10 05:52:28
Sounds much better, done.
|
| + blink::WebServiceWorkerNetworkProvider*); |
|
kinuko
2017/03/09 16:23:03
This is a little awkward, maybe we can make Servic
|
| // PlzNavigate |
| // The |browser_provider_id| is initialized by the browser for navigations. |
| @@ -61,8 +60,9 @@ class CONTENT_EXPORT ServiceWorkerNetworkProvider |
| ServiceWorkerNetworkProvider(int route_id, |
| ServiceWorkerProviderType type, |
| bool is_parent_frame_secure); |
| + |
| ServiceWorkerNetworkProvider(); |
| - ~ServiceWorkerNetworkProvider() override; |
| + ~ServiceWorkerNetworkProvider(); |
| int provider_id() const { return provider_id_; } |
| ServiceWorkerProviderContext* context() const { return context_.get(); } |