| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_FOREIGN_FETCH_REQUEST_HANDLER_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_FOREIGN_FETCH_REQUEST_HANDLER_H_ |
| 6 #define CONTENT_BROWSER_SERVICE_WORKER_FOREIGN_FETCH_REQUEST_HANDLER_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_FOREIGN_FETCH_REQUEST_HANDLER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 scoped_refptr<ResourceRequestBody> body); | 91 scoped_refptr<ResourceRequestBody> body); |
| 92 | 92 |
| 93 // Called when a ServiceWorkerRegistration has (or hasn't) been found for the | 93 // Called when a ServiceWorkerRegistration has (or hasn't) been found for the |
| 94 // request being handled. | 94 // request being handled. |
| 95 void DidFindRegistration( | 95 void DidFindRegistration( |
| 96 const base::WeakPtr<ServiceWorkerURLRequestJob>& job, | 96 const base::WeakPtr<ServiceWorkerURLRequestJob>& job, |
| 97 ServiceWorkerStatusCode status, | 97 ServiceWorkerStatusCode status, |
| 98 const scoped_refptr<ServiceWorkerRegistration>& registration); | 98 const scoped_refptr<ServiceWorkerRegistration>& registration); |
| 99 | 99 |
| 100 // ServiceWorkerURLRequestJob::Delegate implementation: | 100 // ServiceWorkerURLRequestJob::Delegate implementation: |
| 101 void OnPrepareToRestart(base::TimeTicks service_worker_start_time, | 101 void OnPrepareToRestart() override; |
| 102 base::TimeTicks service_worker_ready_time) override; | |
| 103 void OnStartCompleted( | |
| 104 bool was_fetched_via_service_worker, | |
| 105 bool was_fallback_required, | |
| 106 const GURL& original_url_via_service_worker, | |
| 107 blink::WebServiceWorkerResponseType response_type_via_service_worker, | |
| 108 base::TimeTicks worker_start_time, | |
| 109 base::TimeTicks service_worker_ready_time, | |
| 110 bool response_is_in_cache_storage, | |
| 111 const std::string& response_cache_storage_cache_name) override; | |
| 112 ServiceWorkerVersion* GetServiceWorkerVersion( | 102 ServiceWorkerVersion* GetServiceWorkerVersion( |
| 113 ServiceWorkerMetrics::URLRequestJobResult* result) override; | 103 ServiceWorkerMetrics::URLRequestJobResult* result) override; |
| 114 | 104 |
| 115 // Sets |job_| to nullptr, and clears all extra response info associated with | 105 // Sets |job_| to nullptr, and clears all extra response info associated with |
| 116 // that job. | 106 // that job. |
| 117 void ClearJob(); | 107 void ClearJob(); |
| 118 | 108 |
| 119 scoped_refptr<ServiceWorkerContextWrapper> context_; | 109 scoped_refptr<ServiceWorkerContextWrapper> context_; |
| 120 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; | 110 base::WeakPtr<storage::BlobStorageContext> blob_storage_context_; |
| 121 ResourceType resource_type_; | 111 ResourceType resource_type_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 134 bool use_network_ = false; | 124 bool use_network_ = false; |
| 135 | 125 |
| 136 base::WeakPtrFactory<ForeignFetchRequestHandler> weak_factory_; | 126 base::WeakPtrFactory<ForeignFetchRequestHandler> weak_factory_; |
| 137 | 127 |
| 138 DISALLOW_COPY_AND_ASSIGN(ForeignFetchRequestHandler); | 128 DISALLOW_COPY_AND_ASSIGN(ForeignFetchRequestHandler); |
| 139 }; | 129 }; |
| 140 | 130 |
| 141 } // namespace content | 131 } // namespace content |
| 142 | 132 |
| 143 #endif // CONTENT_BROWSER_SERVICE_WORKER_FOREIGN_FETCH_REQUEST_HANDLER_H_ | 133 #endif // CONTENT_BROWSER_SERVICE_WORKER_FOREIGN_FETCH_REQUEST_HANDLER_H_ |
| OLD | NEW |