| 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_CONTEXT_REQUEST_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_REQUEST_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_REQUEST_HANDLER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_REQUEST_HANDLER_H_ |
| 7 | 7 |
| 8 #include "content/browser/service_worker/service_worker_request_handler.h" | 8 #include "content/browser/service_worker/service_worker_request_handler.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 class ServiceWorkerVersion; | 12 class ServiceWorkerVersion; |
| 13 | 13 |
| 14 // A request handler derivative used to handle requests from | 14 // A request handler derivative used to handle requests from |
| 15 // service workers. | 15 // service workers. |
| 16 class CONTENT_EXPORT ServiceWorkerContextRequestHandler | 16 class CONTENT_EXPORT ServiceWorkerContextRequestHandler |
| 17 : public ServiceWorkerRequestHandler { | 17 : public ServiceWorkerRequestHandler { |
| 18 public: | 18 public: |
| 19 ServiceWorkerContextRequestHandler( | 19 ServiceWorkerContextRequestHandler( |
| 20 base::WeakPtr<ServiceWorkerContextCore> context, | 20 base::WeakPtr<ServiceWorkerContextCore> context, |
| 21 base::WeakPtr<ServiceWorkerProviderHost> provider_host, | 21 base::WeakPtr<ServiceWorkerProviderHost> provider_host, |
| 22 ResourceType::Type resource_type); | 22 ResourceType::Type resource_type); |
| 23 virtual ~ServiceWorkerContextRequestHandler(); | 23 virtual ~ServiceWorkerContextRequestHandler(); |
| 24 | 24 |
| 25 // Called via custom URLRequestJobFactory. | 25 // Called via custom URLRequestJobFactory. |
| 26 virtual net::URLRequestJob* MaybeCreateJob( | 26 virtual net::URLRequestJob* MaybeCreateJob( |
| 27 net::URLRequest* request, | 27 net::URLRequest* request, |
| 28 net::NetworkDelegate* network_delegate) OVERRIDE; | 28 net::NetworkDelegate* network_delegate, |
| 29 const scoped_refptr<ChromeBlobStorageContext>& |
| 30 blob_storage_context) OVERRIDE; |
| 29 | 31 |
| 30 private: | 32 private: |
| 31 bool ShouldAddToScriptCache(const GURL& url); | 33 bool ShouldAddToScriptCache(const GURL& url); |
| 32 bool ShouldReadFromScriptCache(const GURL& url, int64* response_id_out); | 34 bool ShouldReadFromScriptCache(const GURL& url, int64* response_id_out); |
| 33 | 35 |
| 34 scoped_refptr<ServiceWorkerVersion> version_; | 36 scoped_refptr<ServiceWorkerVersion> version_; |
| 35 | 37 |
| 36 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextRequestHandler); | 38 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerContextRequestHandler); |
| 37 }; | 39 }; |
| 38 | 40 |
| 39 } // namespace content | 41 } // namespace content |
| 40 | 42 |
| 41 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_REQUEST_HANDLER
_H_ | 43 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CONTEXT_REQUEST_HANDLER
_H_ |
| OLD | NEW |