| 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 10 matching lines...) Expand all Loading... |
| 21 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerResponseType.h" | 21 #include "third_party/WebKit/public/platform/modules/serviceworker/WebServiceWor
kerResponseType.h" |
| 22 #include "url/gurl.h" | 22 #include "url/gurl.h" |
| 23 | 23 |
| 24 namespace net { | 24 namespace net { |
| 25 class NetworkDelegate; | 25 class NetworkDelegate; |
| 26 class URLRequest; | 26 class URLRequest; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace content { | 29 namespace content { |
| 30 | 30 |
| 31 class ResourceRequestBody; | 31 class ResourceRequestBodyImpl; |
| 32 class ServiceWorkerRegistration; | 32 class ServiceWorkerRegistration; |
| 33 class ServiceWorkerVersion; | 33 class ServiceWorkerVersion; |
| 34 | 34 |
| 35 // A request handler derivative used to handle requests from | 35 // A request handler derivative used to handle requests from |
| 36 // controlled documents. | 36 // controlled documents. |
| 37 class CONTENT_EXPORT ServiceWorkerControlleeRequestHandler | 37 class CONTENT_EXPORT ServiceWorkerControlleeRequestHandler |
| 38 : public ServiceWorkerRequestHandler, | 38 : public ServiceWorkerRequestHandler, |
| 39 public ServiceWorkerURLRequestJob::Delegate { | 39 public ServiceWorkerURLRequestJob::Delegate { |
| 40 public: | 40 public: |
| 41 ServiceWorkerControlleeRequestHandler( | 41 ServiceWorkerControlleeRequestHandler( |
| 42 base::WeakPtr<ServiceWorkerContextCore> context, | 42 base::WeakPtr<ServiceWorkerContextCore> context, |
| 43 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 43 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
| 44 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 44 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
| 45 FetchRequestMode request_mode, | 45 FetchRequestMode request_mode, |
| 46 FetchCredentialsMode credentials_mode, | 46 FetchCredentialsMode credentials_mode, |
| 47 FetchRedirectMode redirect_mode, | 47 FetchRedirectMode redirect_mode, |
| 48 ResourceType resource_type, | 48 ResourceType resource_type, |
| 49 RequestContextType request_context_type, | 49 RequestContextType request_context_type, |
| 50 RequestContextFrameType frame_type, | 50 RequestContextFrameType frame_type, |
| 51 scoped_refptr<ResourceRequestBody> body); | 51 scoped_refptr<ResourceRequestBodyImpl> body); |
| 52 ~ServiceWorkerControlleeRequestHandler() override; | 52 ~ServiceWorkerControlleeRequestHandler() override; |
| 53 | 53 |
| 54 // Called via custom URLRequestJobFactory. | 54 // Called via custom URLRequestJobFactory. |
| 55 net::URLRequestJob* MaybeCreateJob( | 55 net::URLRequestJob* MaybeCreateJob( |
| 56 net::URLRequest* request, | 56 net::URLRequest* request, |
| 57 net::NetworkDelegate* network_delegate, | 57 net::NetworkDelegate* network_delegate, |
| 58 ResourceContext* resource_context) override; | 58 ResourceContext* resource_context) override; |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, | 61 FRIEND_TEST_ALL_PREFIXES(ServiceWorkerControlleeRequestHandlerTest, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 void ClearJob(); | 100 void ClearJob(); |
| 101 | 101 |
| 102 const bool is_main_resource_load_; | 102 const bool is_main_resource_load_; |
| 103 const bool is_main_frame_load_; | 103 const bool is_main_frame_load_; |
| 104 base::WeakPtr<ServiceWorkerURLRequestJob> job_; | 104 base::WeakPtr<ServiceWorkerURLRequestJob> job_; |
| 105 FetchRequestMode request_mode_; | 105 FetchRequestMode request_mode_; |
| 106 FetchCredentialsMode credentials_mode_; | 106 FetchCredentialsMode credentials_mode_; |
| 107 FetchRedirectMode redirect_mode_; | 107 FetchRedirectMode redirect_mode_; |
| 108 RequestContextType request_context_type_; | 108 RequestContextType request_context_type_; |
| 109 RequestContextFrameType frame_type_; | 109 RequestContextFrameType frame_type_; |
| 110 scoped_refptr<ResourceRequestBody> body_; | 110 scoped_refptr<ResourceRequestBodyImpl> body_; |
| 111 ResourceContext* resource_context_; | 111 ResourceContext* resource_context_; |
| 112 GURL stripped_url_; | 112 GURL stripped_url_; |
| 113 bool force_update_started_; | 113 bool force_update_started_; |
| 114 | 114 |
| 115 // True if the next time this request is started, the response should be | 115 // True if the next time this request is started, the response should be |
| 116 // delivered from the network, bypassing the ServiceWorker. Cleared after the | 116 // delivered from the network, bypassing the ServiceWorker. Cleared after the |
| 117 // next intercept opportunity, for main frame requests. | 117 // next intercept opportunity, for main frame requests. |
| 118 bool use_network_; | 118 bool use_network_; |
| 119 | 119 |
| 120 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_; | 120 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_; |
| 121 | 121 |
| 122 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler); | 122 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler); |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 } // namespace content | 125 } // namespace content |
| 126 | 126 |
| 127 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND
LER_H_ | 127 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND
LER_H_ |
| OLD | NEW |