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_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HANDLER
_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HANDLER
_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HANDLER
_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HANDLER
_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/gtest_prod_util.h" | 10 #include "base/gtest_prod_util.h" |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 : public ServiceWorkerRequestHandler, | 42 : public ServiceWorkerRequestHandler, |
43 public ServiceWorkerURLJobWrapper::Delegate { | 43 public ServiceWorkerURLJobWrapper::Delegate { |
44 public: | 44 public: |
45 ServiceWorkerControlleeRequestHandler( | 45 ServiceWorkerControlleeRequestHandler( |
46 base::WeakPtr<ServiceWorkerContextCore> context, | 46 base::WeakPtr<ServiceWorkerContextCore> context, |
47 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 47 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
48 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 48 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
49 FetchRequestMode request_mode, | 49 FetchRequestMode request_mode, |
50 FetchCredentialsMode credentials_mode, | 50 FetchCredentialsMode credentials_mode, |
51 FetchRedirectMode redirect_mode, | 51 FetchRedirectMode redirect_mode, |
| 52 const std::string& integrity, |
52 ResourceType resource_type, | 53 ResourceType resource_type, |
53 RequestContextType request_context_type, | 54 RequestContextType request_context_type, |
54 RequestContextFrameType frame_type, | 55 RequestContextFrameType frame_type, |
55 scoped_refptr<ResourceRequestBodyImpl> body); | 56 scoped_refptr<ResourceRequestBodyImpl> body); |
56 ~ServiceWorkerControlleeRequestHandler() override; | 57 ~ServiceWorkerControlleeRequestHandler() override; |
57 | 58 |
58 // Called via custom URLRequestJobFactory. | 59 // Called via custom URLRequestJobFactory. |
59 // Returning a nullptr indicates that the request is not handled by | 60 // Returning a nullptr indicates that the request is not handled by |
60 // this handler. | 61 // this handler. |
61 // This could get called multiple times during the lifetime. | 62 // This could get called multiple times during the lifetime. |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 void ClearJob(); | 120 void ClearJob(); |
120 | 121 |
121 bool JobWasCanceled() const; | 122 bool JobWasCanceled() const; |
122 | 123 |
123 const bool is_main_resource_load_; | 124 const bool is_main_resource_load_; |
124 const bool is_main_frame_load_; | 125 const bool is_main_frame_load_; |
125 std::unique_ptr<ServiceWorkerURLJobWrapper> url_job_; | 126 std::unique_ptr<ServiceWorkerURLJobWrapper> url_job_; |
126 FetchRequestMode request_mode_; | 127 FetchRequestMode request_mode_; |
127 FetchCredentialsMode credentials_mode_; | 128 FetchCredentialsMode credentials_mode_; |
128 FetchRedirectMode redirect_mode_; | 129 FetchRedirectMode redirect_mode_; |
| 130 std::string integrity_; |
129 RequestContextType request_context_type_; | 131 RequestContextType request_context_type_; |
130 RequestContextFrameType frame_type_; | 132 RequestContextFrameType frame_type_; |
131 scoped_refptr<ResourceRequestBodyImpl> body_; | 133 scoped_refptr<ResourceRequestBodyImpl> body_; |
132 ResourceContext* resource_context_; | 134 ResourceContext* resource_context_; |
133 GURL stripped_url_; | 135 GURL stripped_url_; |
134 bool force_update_started_; | 136 bool force_update_started_; |
135 | 137 |
136 // True if the next time this request is started, the response should be | 138 // True if the next time this request is started, the response should be |
137 // delivered from the network, bypassing the ServiceWorker. Cleared after the | 139 // delivered from the network, bypassing the ServiceWorker. Cleared after the |
138 // next intercept opportunity, for main frame requests. | 140 // next intercept opportunity, for main frame requests. |
139 bool use_network_; | 141 bool use_network_; |
140 | 142 |
141 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_; | 143 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_; |
142 | 144 |
143 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler); | 145 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler); |
144 }; | 146 }; |
145 | 147 |
146 } // namespace content | 148 } // namespace content |
147 | 149 |
148 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND
LER_H_ | 150 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND
LER_H_ |
OLD | NEW |