| 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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 279 const bool report_security_info = false; | 279 const bool report_security_info = false; |
| 280 WebURLLoaderImpl::PopulateURLResponse(url_, response_head, response_.get(), | 280 WebURLLoaderImpl::PopulateURLResponse(url_, response_head, response_.get(), |
| 281 report_security_info); | 281 report_security_info); |
| 282 MaybeReportResponseToClient(); | 282 MaybeReportResponseToClient(); |
| 283 } | 283 } |
| 284 | 284 |
| 285 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, | 285 void OnReceiveRedirect(const net::RedirectInfo& redirect_info, |
| 286 const ResourceResponseHead& response_head) override { | 286 const ResourceResponseHead& response_head) override { |
| 287 // This will delete |this|. | 287 // This will delete |this|. |
| 288 ReportErrorToClient( | 288 ReportErrorToClient( |
| 289 "Service Worker navigation preload doesn't suport redirect."); | 289 "Service Worker navigation preload doesn't support redirects."); |
| 290 } | 290 } |
| 291 | 291 |
| 292 void OnDataDownloaded(int64_t data_length, | 292 void OnDataDownloaded(int64_t data_length, |
| 293 int64_t encoded_data_length) override { | 293 int64_t encoded_data_length) override { |
| 294 NOTREACHED(); | 294 NOTREACHED(); |
| 295 } | 295 } |
| 296 | 296 |
| 297 void OnUploadProgress(int64_t current_position, | 297 void OnUploadProgress(int64_t current_position, |
| 298 int64_t total_size, | 298 int64_t total_size, |
| 299 const base::Closure& ack_callback) override { | 299 const base::Closure& ack_callback) override { |
| 300 NOTREACHED(); | 300 NOTREACHED(); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override {} | 303 void OnReceiveCachedMetadata(const std::vector<uint8_t>& data) override {} |
| 304 | 304 |
| 305 void OnTransferSizeUpdated(int32_t transfer_size_diff) override { | 305 void OnTransferSizeUpdated(int32_t transfer_size_diff) override { |
| 306 NOTREACHED(); | |
| 307 } | 306 } |
| 308 | 307 |
| 309 void OnStartLoadingResponseBody( | 308 void OnStartLoadingResponseBody( |
| 310 mojo::ScopedDataPipeConsumerHandle body) override { | 309 mojo::ScopedDataPipeConsumerHandle body) override { |
| 311 DCHECK(!body_.is_valid()); | 310 DCHECK(!body_.is_valid()); |
| 312 body_ = std::move(body); | 311 body_ = std::move(body); |
| 313 MaybeReportResponseToClient(); | 312 MaybeReportResponseToClient(); |
| 314 } | 313 } |
| 315 | 314 |
| 316 void OnComplete(const ResourceRequestCompletionStatus& status) override { | 315 void OnComplete(const ResourceRequestCompletionStatus& status) override { |
| (...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1256 } | 1255 } |
| 1257 | 1256 |
| 1258 base::WeakPtr<ServiceWorkerContextClient> | 1257 base::WeakPtr<ServiceWorkerContextClient> |
| 1259 ServiceWorkerContextClient::GetWeakPtr() { | 1258 ServiceWorkerContextClient::GetWeakPtr() { |
| 1260 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 1259 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
| 1261 DCHECK(context_); | 1260 DCHECK(context_); |
| 1262 return context_->weak_factory.GetWeakPtr(); | 1261 return context_->weak_factory.GetWeakPtr(); |
| 1263 } | 1262 } |
| 1264 | 1263 |
| 1265 } // namespace content | 1264 } // namespace content |
| OLD | NEW |