| 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 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h" | 5 #include "content/browser/service_worker/service_worker_fetch_dispatcher.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 worker_id_ = worker_id; | 143 worker_id_ = worker_id; |
| 144 devtools_request_id_ = base::StringPrintf("preload-%d", fetch_event_id); | 144 devtools_request_id_ = base::StringPrintf("preload-%d", fetch_event_id); |
| 145 MayBeRunDevToolsCallbacks(); | 145 MayBeRunDevToolsCallbacks(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override { | 148 void OnDataDownloaded(int64_t data_length, int64_t encoded_length) override { |
| 149 client_->OnDataDownloaded(data_length, encoded_length); | 149 client_->OnDataDownloaded(data_length, encoded_length); |
| 150 } | 150 } |
| 151 void OnUploadProgress(int64_t current_position, | 151 void OnUploadProgress(int64_t current_position, |
| 152 int64_t total_size, | 152 int64_t total_size, |
| 153 const base::Closure& ack_callback) override { | 153 OnUploadProgressCallback ack_callback) override { |
| 154 client_->OnUploadProgress(current_position, total_size, ack_callback); | 154 client_->OnUploadProgress(current_position, total_size, |
| 155 std::move(ack_callback)); |
| 155 } | 156 } |
| 156 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override { | 157 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override { |
| 157 client_->OnReceiveCachedMetadata(data); | 158 client_->OnReceiveCachedMetadata(data); |
| 158 } | 159 } |
| 159 void OnTransferSizeUpdated(int32_t transfer_size_diff) override { | 160 void OnTransferSizeUpdated(int32_t transfer_size_diff) override { |
| 160 client_->OnTransferSizeUpdated(transfer_size_diff); | 161 client_->OnTransferSizeUpdated(transfer_size_diff); |
| 161 } | 162 } |
| 162 void OnReceiveResponse( | 163 void OnReceiveResponse( |
| 163 const ResourceResponseHead& head, | 164 const ResourceResponseHead& head, |
| 164 const base::Optional<net::SSLInfo>& ssl_info, | 165 const base::Optional<net::SSLInfo>& ssl_info, |
| (...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 ServiceWorkerVersion* version, | 684 ServiceWorkerVersion* version, |
| 684 int event_finish_id, | 685 int event_finish_id, |
| 685 scoped_refptr<URLLoaderAssets> url_loader_assets, | 686 scoped_refptr<URLLoaderAssets> url_loader_assets, |
| 686 ServiceWorkerStatusCode status, | 687 ServiceWorkerStatusCode status, |
| 687 base::Time dispatch_event_time) { | 688 base::Time dispatch_event_time) { |
| 688 version->FinishRequest(event_finish_id, status != SERVICE_WORKER_ERROR_ABORT, | 689 version->FinishRequest(event_finish_id, status != SERVICE_WORKER_ERROR_ABORT, |
| 689 dispatch_event_time); | 690 dispatch_event_time); |
| 690 } | 691 } |
| 691 | 692 |
| 692 } // namespace content | 693 } // namespace content |
| OLD | NEW |