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