| 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 "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 12 #include "content/common/service_worker/service_worker_status_code.h" | 13 #include "content/common/service_worker/service_worker_status_code.h" |
| 13 #include "content/public/common/resource_type.h" | 14 #include "content/public/common/resource_type.h" |
| 14 #include "net/url_request/url_request_job_factory.h" | 15 #include "net/url_request/url_request_job_factory.h" |
| 15 | 16 |
| 16 namespace net { | 17 namespace net { |
| 17 class NetworkDelegate; | 18 class NetworkDelegate; |
| 18 class URLRequest; | 19 class URLRequest; |
| 19 class URLRequestInterceptor; | 20 class URLRequestInterceptor; |
| 20 } | 21 } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 | 62 |
| 62 virtual ~ServiceWorkerRequestHandler(); | 63 virtual ~ServiceWorkerRequestHandler(); |
| 63 | 64 |
| 64 // Called via custom URLRequestJobFactory. | 65 // Called via custom URLRequestJobFactory. |
| 65 virtual net::URLRequestJob* MaybeCreateJob( | 66 virtual net::URLRequestJob* MaybeCreateJob( |
| 66 net::URLRequest* request, | 67 net::URLRequest* request, |
| 67 net::NetworkDelegate* network_delegate) = 0; | 68 net::NetworkDelegate* network_delegate) = 0; |
| 68 | 69 |
| 69 virtual void GetExtraResponseInfo( | 70 virtual void GetExtraResponseInfo( |
| 70 bool* was_fetched_via_service_worker, | 71 bool* was_fetched_via_service_worker, |
| 71 GURL* original_url_via_service_worker) const = 0; | 72 GURL* original_url_via_service_worker, |
| 73 base::TimeTicks* fetch_start_time, |
| 74 base::TimeTicks* fetch_ready_time, |
| 75 base::TimeTicks* fetch_end_time) const = 0; |
| 72 | 76 |
| 73 protected: | 77 protected: |
| 74 ServiceWorkerRequestHandler( | 78 ServiceWorkerRequestHandler( |
| 75 base::WeakPtr<ServiceWorkerContextCore> context, | 79 base::WeakPtr<ServiceWorkerContextCore> context, |
| 76 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 80 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
| 77 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 81 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
| 78 ResourceType resource_type); | 82 ResourceType resource_type); |
| 79 | 83 |
| 80 base::WeakPtr<ServiceWorkerContextCore> context_; | 84 base::WeakPtr<ServiceWorkerContextCore> context_; |
| 81 base::WeakPtr<ServiceWorkerProviderHost> provider_host_; | 85 base::WeakPtr<ServiceWorkerProviderHost> provider_host_; |
| 82 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; | 86 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; |
| 83 ResourceType resource_type_; | 87 ResourceType resource_type_; |
| 84 | 88 |
| 85 private: | 89 private: |
| 86 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); | 90 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); |
| 87 }; | 91 }; |
| 88 | 92 |
| 89 } // namespace content | 93 } // namespace content |
| 90 | 94 |
| 91 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ | 95 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ |
| OLD | NEW |