Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHILD_SERVICE_WORKER_SERVICE_WORKER_NETWORK_PROVIDER_H_ | 5 #ifndef CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_NETWORK_PROVIDER_H_ |
| 6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_NETWORK_PROVIDER_H_ | 6 #define CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_NETWORK_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 19 matching lines...) Expand all Loading... | |
| 30 : public base::SupportsUserData::Data { | 30 : public base::SupportsUserData::Data { |
| 31 public: | 31 public: |
| 32 // Ownership is transferred to the DocumentState. | 32 // Ownership is transferred to the DocumentState. |
| 33 static void AttachToDocumentState( | 33 static void AttachToDocumentState( |
| 34 base::SupportsUserData* document_state, | 34 base::SupportsUserData* document_state, |
| 35 scoped_ptr<ServiceWorkerNetworkProvider> network_provider); | 35 scoped_ptr<ServiceWorkerNetworkProvider> network_provider); |
| 36 | 36 |
| 37 static ServiceWorkerNetworkProvider* FromDocumentState( | 37 static ServiceWorkerNetworkProvider* FromDocumentState( |
| 38 base::SupportsUserData* document_state); | 38 base::SupportsUserData* document_state); |
| 39 | 39 |
| 40 // PlzNavigate | |
| 41 // The provider_id is initialized by the browser for navigations. | |
| 42 ServiceWorkerNetworkProvider(int route_id, | |
| 43 ServiceWorkerProviderType type, | |
| 44 int browse_provider_id); | |
|
michaeln
2015/10/07 01:16:44
might want a 3rd empty ctor for the noop case
S
Fabrice (no longer in Chrome)
2015/10/07 12:59:43
Done.
| |
| 40 ServiceWorkerNetworkProvider(int route_id, ServiceWorkerProviderType type); | 45 ServiceWorkerNetworkProvider(int route_id, ServiceWorkerProviderType type); |
| 41 ~ServiceWorkerNetworkProvider() override; | 46 ~ServiceWorkerNetworkProvider() override; |
| 42 | 47 |
| 43 int provider_id() const { return provider_id_; } | 48 int provider_id() const { return provider_id_; } |
| 44 ServiceWorkerProviderContext* context() const { return context_.get(); } | 49 ServiceWorkerProviderContext* context() const { return context_.get(); } |
| 45 | 50 |
| 46 // This method is called for a provider that's associated with a | 51 // This method is called for a provider that's associated with a |
| 47 // running service worker script. The version_id indicates which | 52 // running service worker script. The version_id indicates which |
| 48 // ServiceWorkerVersion should be used. | 53 // ServiceWorkerVersion should be used. |
| 49 void SetServiceWorkerVersionId(int64 version_id); | 54 void SetServiceWorkerVersionId(int64 version_id); |
| 50 | 55 |
| 51 bool IsControlledByServiceWorker() const; | 56 bool IsControlledByServiceWorker() const; |
| 52 | 57 |
| 53 private: | 58 private: |
| 54 const int provider_id_; | 59 const int provider_id_; |
| 55 scoped_refptr<ServiceWorkerProviderContext> context_; | 60 scoped_refptr<ServiceWorkerProviderContext> context_; |
| 56 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerNetworkProvider); | 61 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerNetworkProvider); |
| 57 }; | 62 }; |
| 58 | 63 |
| 59 } // namespace content | 64 } // namespace content |
| 60 | 65 |
| 61 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_NETWORK_PROVIDER_H_ | 66 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_NETWORK_PROVIDER_H_ |
| OLD | NEW |