| 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_REQUEST_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/supports_user_data.h" | 10 #include "base/supports_user_data.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/common/service_worker/service_worker_status_code.h" | 13 #include "content/common/service_worker/service_worker_status_code.h" |
| 14 #include "content/common/service_worker/service_worker_types.h" | 14 #include "content/common/service_worker/service_worker_types.h" |
| 15 #include "content/public/common/request_context_frame_type.h" | 15 #include "content/public/common/request_context_frame_type.h" |
| 16 #include "content/public/common/request_context_type.h" | 16 #include "content/public/common/request_context_type.h" |
| 17 #include "content/public/common/resource_type.h" | 17 #include "content/public/common/resource_type.h" |
| 18 #include "net/url_request/url_request_job_factory.h" | 18 #include "net/url_request/url_request_job_factory.h" |
| 19 #include "third_party/WebKit/public/platform/WebServiceWorkerResponseType.h" |
| 19 | 20 |
| 20 namespace net { | 21 namespace net { |
| 21 class NetworkDelegate; | 22 class NetworkDelegate; |
| 22 class URLRequest; | 23 class URLRequest; |
| 23 class URLRequestInterceptor; | 24 class URLRequestInterceptor; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace storage { | 27 namespace storage { |
| 27 class BlobStorageContext; | 28 class BlobStorageContext; |
| 28 } | 29 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // Called via custom URLRequestJobFactory. | 75 // Called via custom URLRequestJobFactory. |
| 75 virtual net::URLRequestJob* MaybeCreateJob( | 76 virtual net::URLRequestJob* MaybeCreateJob( |
| 76 net::URLRequest* request, | 77 net::URLRequest* request, |
| 77 net::NetworkDelegate* network_delegate, | 78 net::NetworkDelegate* network_delegate, |
| 78 ResourceContext* context) = 0; | 79 ResourceContext* context) = 0; |
| 79 | 80 |
| 80 virtual void GetExtraResponseInfo( | 81 virtual void GetExtraResponseInfo( |
| 81 bool* was_fetched_via_service_worker, | 82 bool* was_fetched_via_service_worker, |
| 82 bool* was_fallback_required_by_service_worker, | 83 bool* was_fallback_required_by_service_worker, |
| 83 GURL* original_url_via_service_worker, | 84 GURL* original_url_via_service_worker, |
| 85 blink::WebServiceWorkerResponseType* response_type_via_service_worker, |
| 84 base::TimeTicks* fetch_start_time, | 86 base::TimeTicks* fetch_start_time, |
| 85 base::TimeTicks* fetch_ready_time, | 87 base::TimeTicks* fetch_ready_time, |
| 86 base::TimeTicks* fetch_end_time) const = 0; | 88 base::TimeTicks* fetch_end_time) const = 0; |
| 87 | 89 |
| 88 protected: | 90 protected: |
| 89 ServiceWorkerRequestHandler( | 91 ServiceWorkerRequestHandler( |
| 90 base::WeakPtr<ServiceWorkerContextCore> context, | 92 base::WeakPtr<ServiceWorkerContextCore> context, |
| 91 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 93 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
| 92 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 94 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
| 93 ResourceType resource_type); | 95 ResourceType resource_type); |
| 94 | 96 |
| 95 base::WeakPtr<ServiceWorkerContextCore> context_; | 97 base::WeakPtr<ServiceWorkerContextCore> context_; |
| 96 base::WeakPtr<ServiceWorkerProviderHost> provider_host_; | 98 base::WeakPtr<ServiceWorkerProviderHost> provider_host_; |
| 97 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; | 99 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; |
| 98 ResourceType resource_type_; | 100 ResourceType resource_type_; |
| 99 | 101 |
| 100 private: | 102 private: |
| 101 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); | 103 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); |
| 102 }; | 104 }; |
| 103 | 105 |
| 104 } // namespace content | 106 } // namespace content |
| 105 | 107 |
| 106 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ | 108 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ |
| OLD | NEW |