| 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 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 mojom::FetchEventPreloadHandlePtr preload_handle) | 363 mojom::FetchEventPreloadHandlePtr preload_handle) |
| 364 : fetch_event_id_(fetch_event_id), | 364 : fetch_event_id_(fetch_event_id), |
| 365 url_(url), | 365 url_(url), |
| 366 url_loader_(std::move(preload_handle->url_loader)), | 366 url_loader_(std::move(preload_handle->url_loader)), |
| 367 binding_(this, std::move(preload_handle->url_loader_client_request)) {} | 367 binding_(this, std::move(preload_handle->url_loader_client_request)) {} |
| 368 | 368 |
| 369 ~NavigationPreloadRequest() override {} | 369 ~NavigationPreloadRequest() override {} |
| 370 | 370 |
| 371 void OnReceiveResponse( | 371 void OnReceiveResponse( |
| 372 const ResourceResponseHead& response_head, | 372 const ResourceResponseHead& response_head, |
| 373 const base::Optional<net::SSLInfo>& ssl_info, |
| 373 mojom::DownloadedTempFilePtr downloaded_file) override { | 374 mojom::DownloadedTempFilePtr downloaded_file) override { |
| 374 DCHECK(!response_); | 375 DCHECK(!response_); |
| 375 DCHECK(!downloaded_file); | 376 DCHECK(!downloaded_file); |
| 376 response_ = base::MakeUnique<blink::WebURLResponse>(); | 377 response_ = base::MakeUnique<blink::WebURLResponse>(); |
| 377 // TODO(horo): Set report_security_info to true when DevTools is attached. | 378 // TODO(horo): Set report_security_info to true when DevTools is attached. |
| 378 const bool report_security_info = false; | 379 const bool report_security_info = false; |
| 379 WebURLLoaderImpl::PopulateURLResponse(url_, response_head, response_.get(), | 380 WebURLLoaderImpl::PopulateURLResponse(url_, response_head, response_.get(), |
| 380 report_security_info); | 381 report_security_info); |
| 381 MaybeReportResponseToClient(); | 382 MaybeReportResponseToClient(); |
| 382 } | 383 } |
| (...skipping 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1542 } | 1543 } |
| 1543 | 1544 |
| 1544 base::WeakPtr<ServiceWorkerContextClient> | 1545 base::WeakPtr<ServiceWorkerContextClient> |
| 1545 ServiceWorkerContextClient::GetWeakPtr() { | 1546 ServiceWorkerContextClient::GetWeakPtr() { |
| 1546 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); | 1547 DCHECK(worker_task_runner_->RunsTasksOnCurrentThread()); |
| 1547 DCHECK(context_); | 1548 DCHECK(context_); |
| 1548 return context_->weak_factory.GetWeakPtr(); | 1549 return context_->weak_factory.GetWeakPtr(); |
| 1549 } | 1550 } |
| 1550 | 1551 |
| 1551 } // namespace content | 1552 } // namespace content |
| OLD | NEW |