| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 : fetch_event_id_(fetch_event_id), | 264 : fetch_event_id_(fetch_event_id), |
| 265 url_(url), | 265 url_(url), |
| 266 url_loader_(std::move(preload_handle->url_loader)), | 266 url_loader_(std::move(preload_handle->url_loader)), |
| 267 binding_(this, std::move(preload_handle->url_loader_client_request)) {} | 267 binding_(this, std::move(preload_handle->url_loader_client_request)) {} |
| 268 | 268 |
| 269 ~NavigationPreloadRequest() override { | 269 ~NavigationPreloadRequest() override { |
| 270 } | 270 } |
| 271 | 271 |
| 272 void OnReceiveResponse( | 272 void OnReceiveResponse( |
| 273 const ResourceResponseHead& response_head, | 273 const ResourceResponseHead& response_head, |
| 274 mojom::DownloadedTempFileAssociatedPtrInfo downloaded_file) override { | 274 mojom::DownloadedTempFilePtr downloaded_file) override { |
| 275 DCHECK(!response_); | 275 DCHECK(!response_); |
| 276 DCHECK(!downloaded_file.is_valid()); | 276 DCHECK(!downloaded_file); |
| 277 response_ = base::MakeUnique<blink::WebURLResponse>(); | 277 response_ = base::MakeUnique<blink::WebURLResponse>(); |
| 278 // TODO(horo): Set report_security_info to true when DevTools is attached. | 278 // TODO(horo): Set report_security_info to true when DevTools is attached. |
| 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 { |
| (...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1260 } | 1260 } |
| 1261 | 1261 |
| 1262 base::WeakPtr<ServiceWorkerContextClient> | 1262 base::WeakPtr<ServiceWorkerContextClient> |
| 1263 ServiceWorkerContextClient::GetWeakPtr() { | 1263 ServiceWorkerContextClient::GetWeakPtr() { |
| 1264 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 1264 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
| 1265 DCHECK(context_); | 1265 DCHECK(context_); |
| 1266 return context_->weak_factory.GetWeakPtr(); | 1266 return context_->weak_factory.GetWeakPtr(); |
| 1267 } | 1267 } |
| 1268 | 1268 |
| 1269 } // namespace content | 1269 } // namespace content |
| OLD | NEW |