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 #include "content/renderer/service_worker/service_worker_context_client.h" | 5 #include "content/renderer/service_worker/service_worker_context_client.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 url_loader_ = nullptr; | 282 url_loader_ = nullptr; |
283 ReportErrorToClient( | 283 ReportErrorToClient( |
284 "Service Worker navigation preload doesn't suport redirect."); | 284 "Service Worker navigation preload doesn't suport redirect."); |
285 } | 285 } |
286 | 286 |
287 void OnDataDownloaded(int64_t data_length, | 287 void OnDataDownloaded(int64_t data_length, |
288 int64_t encoded_data_length) override { | 288 int64_t encoded_data_length) override { |
289 NOTREACHED(); | 289 NOTREACHED(); |
290 } | 290 } |
291 | 291 |
| 292 void OnTransferSizeUpdated(int64_t transfer_size_diff) override {} |
| 293 |
292 void OnStartLoadingResponseBody( | 294 void OnStartLoadingResponseBody( |
293 mojo::ScopedDataPipeConsumerHandle body) override { | 295 mojo::ScopedDataPipeConsumerHandle body) override { |
294 DCHECK(!body_.is_valid()); | 296 DCHECK(!body_.is_valid()); |
295 body_ = std::move(body); | 297 body_ = std::move(body); |
296 MaybeReportResponseToClient(); | 298 MaybeReportResponseToClient(); |
297 } | 299 } |
298 | 300 |
299 void OnComplete(const ResourceRequestCompletionStatus& status) override { | 301 void OnComplete(const ResourceRequestCompletionStatus& status) override { |
300 // We don't report to |client| if OnStartLoadingResponseBody() has already | 302 // We don't report to |client| if OnStartLoadingResponseBody() has already |
301 // called OnNavigationPreloadResponse(). | 303 // called OnNavigationPreloadResponse(). |
(...skipping 981 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1283 } | 1285 } |
1284 | 1286 |
1285 base::WeakPtr<ServiceWorkerContextClient> | 1287 base::WeakPtr<ServiceWorkerContextClient> |
1286 ServiceWorkerContextClient::GetWeakPtr() { | 1288 ServiceWorkerContextClient::GetWeakPtr() { |
1287 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 1289 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
1288 DCHECK(context_); | 1290 DCHECK(context_); |
1289 return context_->weak_factory.GetWeakPtr(); | 1291 return context_->weak_factory.GetWeakPtr(); |
1290 } | 1292 } |
1291 | 1293 |
1292 } // namespace content | 1294 } // namespace content |
OLD | NEW |