| 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(int32_t transfer_size_diff) override { |
| 293 NOTREACHED(); |
| 294 } |
| 295 |
| 292 void OnStartLoadingResponseBody( | 296 void OnStartLoadingResponseBody( |
| 293 mojo::ScopedDataPipeConsumerHandle body) override { | 297 mojo::ScopedDataPipeConsumerHandle body) override { |
| 294 DCHECK(!body_.is_valid()); | 298 DCHECK(!body_.is_valid()); |
| 295 body_ = std::move(body); | 299 body_ = std::move(body); |
| 296 MaybeReportResponseToClient(); | 300 MaybeReportResponseToClient(); |
| 297 } | 301 } |
| 298 | 302 |
| 299 void OnComplete(const ResourceRequestCompletionStatus& status) override { | 303 void OnComplete(const ResourceRequestCompletionStatus& status) override { |
| 300 // We don't report to |client| if OnStartLoadingResponseBody() has already | 304 // We don't report to |client| if OnStartLoadingResponseBody() has already |
| 301 // called OnNavigationPreloadResponse(). | 305 // called OnNavigationPreloadResponse(). |
| (...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1276 } | 1280 } |
| 1277 | 1281 |
| 1278 base::WeakPtr<ServiceWorkerContextClient> | 1282 base::WeakPtr<ServiceWorkerContextClient> |
| 1279 ServiceWorkerContextClient::GetWeakPtr() { | 1283 ServiceWorkerContextClient::GetWeakPtr() { |
| 1280 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 1284 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
| 1281 DCHECK(context_); | 1285 DCHECK(context_); |
| 1282 return context_->weak_factory.GetWeakPtr(); | 1286 return context_->weak_factory.GetWeakPtr(); |
| 1283 } | 1287 } |
| 1284 | 1288 |
| 1285 } // namespace content | 1289 } // namespace content |
| OLD | NEW |