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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // Creates a protocol interceptor for ServiceWorker. | 69 // Creates a protocol interceptor for ServiceWorker. |
70 static scoped_ptr<net::URLRequestInterceptor> CreateInterceptor( | 70 static scoped_ptr<net::URLRequestInterceptor> CreateInterceptor( |
71 ResourceContext* resource_context); | 71 ResourceContext* resource_context); |
72 | 72 |
73 // Returns true if the request falls into the scope of a ServiceWorker. | 73 // Returns true if the request falls into the scope of a ServiceWorker. |
74 // It's only reliable after the ServiceWorkerRequestHandler MaybeCreateJob | 74 // It's only reliable after the ServiceWorkerRequestHandler MaybeCreateJob |
75 // method runs to completion for this request. The AppCache handler uses | 75 // method runs to completion for this request. The AppCache handler uses |
76 // this to avoid colliding with ServiceWorkers. | 76 // this to avoid colliding with ServiceWorkers. |
77 static bool IsControlledByServiceWorker(net::URLRequest* request); | 77 static bool IsControlledByServiceWorker(net::URLRequest* request); |
78 | 78 |
79 virtual ~ServiceWorkerRequestHandler(); | 79 ~ServiceWorkerRequestHandler() override; |
80 | 80 |
81 // Called via custom URLRequestJobFactory. | 81 // Called via custom URLRequestJobFactory. |
82 virtual net::URLRequestJob* MaybeCreateJob( | 82 virtual net::URLRequestJob* MaybeCreateJob( |
83 net::URLRequest* request, | 83 net::URLRequest* request, |
84 net::NetworkDelegate* network_delegate, | 84 net::NetworkDelegate* network_delegate, |
85 ResourceContext* context) = 0; | 85 ResourceContext* context) = 0; |
86 | 86 |
87 virtual void GetExtraResponseInfo( | 87 virtual void GetExtraResponseInfo( |
88 bool* was_fetched_via_service_worker, | 88 bool* was_fetched_via_service_worker, |
89 bool* was_fallback_required_by_service_worker, | 89 bool* was_fallback_required_by_service_worker, |
(...skipping 15 matching lines...) Expand all Loading... |
105 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; | 105 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; |
106 ResourceType resource_type_; | 106 ResourceType resource_type_; |
107 | 107 |
108 private: | 108 private: |
109 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); | 109 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerRequestHandler); |
110 }; | 110 }; |
111 | 111 |
112 } // namespace content | 112 } // namespace content |
113 | 113 |
114 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ | 114 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_REQUEST_HANDLER_H_ |
OLD | NEW |