| 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 "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
| 9 #include "content/browser/service_worker/service_worker_request_handler.h" | 9 #include "content/browser/service_worker/service_worker_request_handler.h" |
| 10 | 10 |
| 11 namespace net { | 11 namespace net { |
| 12 class NetworkDelegate; | 12 class NetworkDelegate; |
| 13 class URLRequest; | 13 class URLRequest; |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 | 17 |
| 18 class ResourceRequestBody; |
| 18 class ServiceWorkerRegistration; | 19 class ServiceWorkerRegistration; |
| 19 class ServiceWorkerURLRequestJob; | 20 class ServiceWorkerURLRequestJob; |
| 20 class ServiceWorkerVersion; | 21 class ServiceWorkerVersion; |
| 21 | 22 |
| 22 // A request handler derivative used to handle requests from | 23 // A request handler derivative used to handle requests from |
| 23 // controlled documents. | 24 // controlled documents. |
| 24 class CONTENT_EXPORT ServiceWorkerControlleeRequestHandler | 25 class CONTENT_EXPORT ServiceWorkerControlleeRequestHandler |
| 25 : public ServiceWorkerRequestHandler { | 26 : public ServiceWorkerRequestHandler { |
| 26 public: | 27 public: |
| 27 ServiceWorkerControlleeRequestHandler( | 28 ServiceWorkerControlleeRequestHandler( |
| 28 base::WeakPtr<ServiceWorkerContextCore> context, | 29 base::WeakPtr<ServiceWorkerContextCore> context, |
| 29 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 30 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
| 30 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context, | 31 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context, |
| 31 ResourceType resource_type); | 32 ResourceType resource_type, |
| 33 scoped_refptr<ResourceRequestBody> body); |
| 32 virtual ~ServiceWorkerControlleeRequestHandler(); | 34 virtual ~ServiceWorkerControlleeRequestHandler(); |
| 33 | 35 |
| 34 // Called via custom URLRequestJobFactory. | 36 // Called via custom URLRequestJobFactory. |
| 35 virtual net::URLRequestJob* MaybeCreateJob( | 37 virtual net::URLRequestJob* MaybeCreateJob( |
| 36 net::URLRequest* request, | 38 net::URLRequest* request, |
| 37 net::NetworkDelegate* network_delegate) OVERRIDE; | 39 net::NetworkDelegate* network_delegate) OVERRIDE; |
| 38 | 40 |
| 39 virtual void GetExtraResponseInfo( | 41 virtual void GetExtraResponseInfo( |
| 40 bool* was_fetched_via_service_worker, | 42 bool* was_fetched_via_service_worker, |
| 41 GURL* original_url_via_service_worker) const OVERRIDE; | 43 GURL* original_url_via_service_worker) const OVERRIDE; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 52 const scoped_refptr<ServiceWorkerRegistration>& registration); | 54 const scoped_refptr<ServiceWorkerRegistration>& registration); |
| 53 void OnVersionStatusChanged( | 55 void OnVersionStatusChanged( |
| 54 ServiceWorkerRegistration* registration, | 56 ServiceWorkerRegistration* registration, |
| 55 ServiceWorkerVersion* version); | 57 ServiceWorkerVersion* version); |
| 56 | 58 |
| 57 // For sub resource case. | 59 // For sub resource case. |
| 58 void PrepareForSubResource(); | 60 void PrepareForSubResource(); |
| 59 | 61 |
| 60 bool is_main_resource_load_; | 62 bool is_main_resource_load_; |
| 61 scoped_refptr<ServiceWorkerURLRequestJob> job_; | 63 scoped_refptr<ServiceWorkerURLRequestJob> job_; |
| 64 scoped_refptr<ResourceRequestBody> body_; |
| 62 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_; | 65 base::WeakPtrFactory<ServiceWorkerControlleeRequestHandler> weak_factory_; |
| 63 | 66 |
| 64 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler); | 67 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerControlleeRequestHandler); |
| 65 }; | 68 }; |
| 66 | 69 |
| 67 } // namespace content | 70 } // namespace content |
| 68 | 71 |
| 69 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND
LER_H_ | 72 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTROLLEE_REQUEST_HAND
LER_H_ |
| OLD | NEW |