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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 14 #include "base/memory/ref_counted.h" |
15 #include "base/supports_user_data.h" | 15 #include "base/supports_user_data.h" |
16 #include "content/common/content_export.h" | 16 #include "content/common/content_export.h" |
17 #include "content/common/service_worker/service_worker_types.h" | 17 #include "content/common/service_worker/service_worker_types.h" |
18 #include "third_party/WebKit/public/web/WebSandboxFlags.h" | 18 |
19 namespace blink { | |
20 class WebLocalFrame; | |
21 } | |
jww
2016/05/24 18:06:03
nit: " // namespace blink"
falken
2016/05/25 09:19:58
Done.
| |
19 | 22 |
20 namespace content { | 23 namespace content { |
21 | 24 |
22 class ServiceWorkerProviderContext; | 25 class ServiceWorkerProviderContext; |
23 struct RequestNavigationParams; | 26 struct RequestNavigationParams; |
24 | 27 |
25 // A unique provider_id is generated for each instance. | 28 // A unique provider_id is generated for each instance. |
26 // Instantiated prior to the main resource load being started and remains | 29 // Instantiated prior to the main resource load being started and remains |
27 // allocated until after the last subresource load has occurred. | 30 // allocated until after the last subresource load has occurred. |
28 // This is used to track the lifetime of a Document to create | 31 // This is used to track the lifetime of a Document to create |
(...skipping 10 matching lines...) Expand all Loading... | |
39 static void AttachToDocumentState( | 42 static void AttachToDocumentState( |
40 base::SupportsUserData* document_state, | 43 base::SupportsUserData* document_state, |
41 std::unique_ptr<ServiceWorkerNetworkProvider> network_provider); | 44 std::unique_ptr<ServiceWorkerNetworkProvider> network_provider); |
42 | 45 |
43 static ServiceWorkerNetworkProvider* FromDocumentState( | 46 static ServiceWorkerNetworkProvider* FromDocumentState( |
44 base::SupportsUserData* document_state); | 47 base::SupportsUserData* document_state); |
45 | 48 |
46 static std::unique_ptr<ServiceWorkerNetworkProvider> CreateForNavigation( | 49 static std::unique_ptr<ServiceWorkerNetworkProvider> CreateForNavigation( |
47 int route_id, | 50 int route_id, |
48 const RequestNavigationParams& request_params, | 51 const RequestNavigationParams& request_params, |
49 blink::WebSandboxFlags sandbox_flags, | 52 blink::WebLocalFrame* frame, |
50 bool content_initiated); | 53 bool content_initiated); |
51 | 54 |
52 // PlzNavigate | 55 // PlzNavigate |
53 // The |browser_provider_id| is initialized by the browser for navigations. | 56 // The |browser_provider_id| is initialized by the browser for navigations. |
54 ServiceWorkerNetworkProvider(int route_id, | 57 ServiceWorkerNetworkProvider(int route_id, |
55 ServiceWorkerProviderType type, | 58 ServiceWorkerProviderType type, |
56 int browser_provider_id); | 59 int browser_provider_id); |
57 ServiceWorkerNetworkProvider(int route_id, ServiceWorkerProviderType type); | 60 ServiceWorkerNetworkProvider(int route_id, ServiceWorkerProviderType type); |
58 ServiceWorkerNetworkProvider(); | 61 ServiceWorkerNetworkProvider(); |
59 ~ServiceWorkerNetworkProvider() override; | 62 ~ServiceWorkerNetworkProvider() override; |
(...skipping 10 matching lines...) Expand all Loading... | |
70 | 73 |
71 private: | 74 private: |
72 const int provider_id_; | 75 const int provider_id_; |
73 scoped_refptr<ServiceWorkerProviderContext> context_; | 76 scoped_refptr<ServiceWorkerProviderContext> context_; |
74 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerNetworkProvider); | 77 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerNetworkProvider); |
75 }; | 78 }; |
76 | 79 |
77 } // namespace content | 80 } // namespace content |
78 | 81 |
79 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_NETWORK_PROVIDER_H_ | 82 #endif // CONTENT_CHILD_SERVICE_WORKER_SERVICE_WORKER_NETWORK_PROVIDER_H_ |
OLD | NEW |