| 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_URL_REQUEST_JOB_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 | 85 |
| 86 // Called after dispatching the fetch event to determine if processing of | 86 // Called after dispatching the fetch event to determine if processing of |
| 87 // the request should still continue, or if processing should be aborted. | 87 // the request should still continue, or if processing should be aborted. |
| 88 // When false is returned, this sets |*result| to an appropriate error. | 88 // When false is returned, this sets |*result| to an appropriate error. |
| 89 virtual bool RequestStillValid( | 89 virtual bool RequestStillValid( |
| 90 ServiceWorkerMetrics::URLRequestJobResult* result); | 90 ServiceWorkerMetrics::URLRequestJobResult* result); |
| 91 | 91 |
| 92 // Called to signal that loading failed, and that the resource being loaded | 92 // Called to signal that loading failed, and that the resource being loaded |
| 93 // was a main resource. | 93 // was a main resource. |
| 94 virtual void MainResourceLoadFailed() {} | 94 virtual void MainResourceLoadFailed() {} |
| 95 | |
| 96 // Returns the origin of the page/context which initiated this request. | |
| 97 virtual GURL GetRequestingOrigin() = 0; | |
| 98 }; | 95 }; |
| 99 | 96 |
| 100 ServiceWorkerURLRequestJob( | 97 ServiceWorkerURLRequestJob( |
| 101 net::URLRequest* request, | 98 net::URLRequest* request, |
| 102 net::NetworkDelegate* network_delegate, | 99 net::NetworkDelegate* network_delegate, |
| 103 const std::string& client_id, | 100 const std::string& client_id, |
| 104 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, | 101 base::WeakPtr<storage::BlobStorageContext> blob_storage_context, |
| 105 const ResourceContext* resource_context, | 102 const ResourceContext* resource_context, |
| 106 FetchRequestMode request_mode, | 103 FetchRequestMode request_mode, |
| 107 FetchCredentialsMode credentials_mode, | 104 FetchCredentialsMode credentials_mode, |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 bool did_record_result_ = false; | 273 bool did_record_result_ = false; |
| 277 | 274 |
| 278 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; | 275 base::WeakPtrFactory<ServiceWorkerURLRequestJob> weak_factory_; |
| 279 | 276 |
| 280 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); | 277 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerURLRequestJob); |
| 281 }; | 278 }; |
| 282 | 279 |
| 283 } // namespace content | 280 } // namespace content |
| 284 | 281 |
| 285 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ | 282 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_URL_REQUEST_JOB_H_ |
| OLD | NEW |