| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 61 |
| 61 virtual ~ServiceWorkerRequestHandler(); | 62 virtual ~ServiceWorkerRequestHandler(); |
| 62 | 63 |
| 63 // Called via custom URLRequestJobFactory. | 64 // Called via custom URLRequestJobFactory. |
| 64 virtual net::URLRequestJob* MaybeCreateJob( | 65 virtual net::URLRequestJob* MaybeCreateJob( |
| 65 net::URLRequest* request, | 66 net::URLRequest* request, |
| 66 net::NetworkDelegate* network_delegate) = 0; | 67 net::NetworkDelegate* network_delegate) = 0; |
| 67 | 68 |
| 68 virtual void GetExtraResponseInfo( | 69 virtual void GetExtraResponseInfo( |
| 69 bool* was_fetched_via_service_worker, | 70 bool* was_fetched_via_service_worker, |
| 70 GURL* original_url_via_service_worker) const = 0; | 71 GURL* original_url_via_service_worker, |
| 72 base::TimeTicks* fetch_start_time, |
| 73 base::TimeTicks* fetch_ready_time, |
| 74 base::TimeTicks* fetch_end_time) const = 0; |
| 71 | 75 |
| 72 protected: | 76 protected: |
| 73 ServiceWorkerRequestHandler( | 77 ServiceWorkerRequestHandler( |
| 74 base::WeakPtr<ServiceWorkerContextCore> context, | 78 base::WeakPtr<ServiceWorkerContextCore> context, |
| 75 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 79 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
| 76 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 80 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
| 77 ResourceType resource_type); | 81 ResourceType resource_type); |
| 78 | 82 |
| 79 base::WeakPtr<ServiceWorkerContextCore> context_; | 83 base::WeakPtr<ServiceWorkerContextCore> context_; |
| 80 base::WeakPtr<ServiceWorkerProviderHost> provider_host_; | 84 base::WeakPtr<ServiceWorkerProviderHost> provider_host_; |
| 81 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; | 85 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; |
| 82 ResourceType resource_type_; | 86 ResourceType resource_type_; |
| 83 | 87 |
| 84 private: | 88 private: |
| 85 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); | 89 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); |
| 86 }; | 90 }; |
| 87 | 91 |
| 88 } // namespace content | 92 } // namespace content |
| 89 | 93 |
| 90 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ | 94 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ |
| OLD | NEW |