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" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // Creates a protocol interceptor for ServiceWorker. | 56 // Creates a protocol interceptor for ServiceWorker. |
57 static scoped_ptr<net::URLRequestInterceptor> CreateInterceptor(); | 57 static scoped_ptr<net::URLRequestInterceptor> CreateInterceptor(); |
58 | 58 |
59 virtual ~ServiceWorkerRequestHandler(); | 59 virtual ~ServiceWorkerRequestHandler(); |
60 | 60 |
61 // Called via custom URLRequestJobFactory. | 61 // Called via custom URLRequestJobFactory. |
62 virtual net::URLRequestJob* MaybeCreateJob( | 62 virtual net::URLRequestJob* MaybeCreateJob( |
63 net::URLRequest* request, | 63 net::URLRequest* request, |
64 net::NetworkDelegate* network_delegate) = 0; | 64 net::NetworkDelegate* network_delegate) = 0; |
65 | 65 |
| 66 virtual void GetExtraResponseInfo( |
| 67 bool* was_fetched_via_service_worker, |
| 68 GURL* original_url_via_service_worker) const = 0; |
| 69 |
66 protected: | 70 protected: |
67 ServiceWorkerRequestHandler( | 71 ServiceWorkerRequestHandler( |
68 base::WeakPtr<ServiceWorkerContextCore> context, | 72 base::WeakPtr<ServiceWorkerContextCore> context, |
69 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 73 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
70 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context, | 74 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context, |
71 ResourceType::Type resource_type); | 75 ResourceType::Type resource_type); |
72 | 76 |
73 base::WeakPtr<ServiceWorkerContextCore> context_; | 77 base::WeakPtr<ServiceWorkerContextCore> context_; |
74 base::WeakPtr<ServiceWorkerProviderHost> provider_host_; | 78 base::WeakPtr<ServiceWorkerProviderHost> provider_host_; |
75 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context_; | 79 base::WeakPtr<webkit_blob::BlobStorageContext> blob_storage_context_; |
76 ResourceType::Type resource_type_; | 80 ResourceType::Type resource_type_; |
77 | 81 |
78 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); | 82 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); |
79 }; | 83 }; |
80 | 84 |
81 } // namespace content | 85 } // namespace content |
82 | 86 |
83 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ | 87 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ |
OLD | NEW |