OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc
e-loading |
6 | 6 |
7 #include "content/child/resource_dispatcher.h" | 7 #include "content/child/resource_dispatcher.h" |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 ResourceRequestBodyImpl* request_body, | 632 ResourceRequestBodyImpl* request_body, |
633 std::unique_ptr<RequestPeer> peer, | 633 std::unique_ptr<RequestPeer> peer, |
634 blink::WebURLRequest::LoadingIPCType ipc_type, | 634 blink::WebURLRequest::LoadingIPCType ipc_type, |
635 mojom::URLLoaderFactory* url_loader_factory) { | 635 mojom::URLLoaderFactory* url_loader_factory) { |
636 GURL frame_origin; | 636 GURL frame_origin; |
637 std::unique_ptr<ResourceRequest> request = | 637 std::unique_ptr<ResourceRequest> request = |
638 CreateRequest(request_info, request_body, &frame_origin); | 638 CreateRequest(request_info, request_body, &frame_origin); |
639 | 639 |
640 // Compute a unique request_id for this renderer process. | 640 // Compute a unique request_id for this renderer process. |
641 int request_id = MakeRequestID(); | 641 int request_id = MakeRequestID(); |
642 pending_requests_[request_id] = base::WrapUnique(new PendingRequestInfo( | 642 pending_requests_[request_id] = base::MakeUnique<PendingRequestInfo>( |
643 std::move(peer), request->resource_type, request->origin_pid, | 643 std::move(peer), request->resource_type, request->origin_pid, |
644 frame_origin, request->url, request_info.download_to_file)); | 644 frame_origin, request->url, request_info.download_to_file); |
645 | 645 |
646 if (resource_scheduling_filter_.get() && request_info.loading_task_runner) { | 646 if (resource_scheduling_filter_.get() && request_info.loading_task_runner) { |
647 resource_scheduling_filter_->SetRequestIdTaskRunner( | 647 resource_scheduling_filter_->SetRequestIdTaskRunner( |
648 request_id, request_info.loading_task_runner); | 648 request_id, request_info.loading_task_runner); |
649 } | 649 } |
650 | 650 |
651 if (ipc_type == blink::WebURLRequest::LoadingIPCType::Mojo) { | 651 if (ipc_type == blink::WebURLRequest::LoadingIPCType::Mojo) { |
652 std::unique_ptr<URLLoaderClientImpl> client( | 652 std::unique_ptr<URLLoaderClientImpl> client( |
653 new URLLoaderClientImpl(request_id, this, main_thread_task_runner_)); | 653 new URLLoaderClientImpl(request_id, this, main_thread_task_runner_)); |
654 mojom::URLLoaderPtr url_loader; | 654 mojom::URLLoaderPtr url_loader; |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
875 *frame_origin = extra_data->frame_origin(); | 875 *frame_origin = extra_data->frame_origin(); |
876 return request; | 876 return request; |
877 } | 877 } |
878 | 878 |
879 void ResourceDispatcher::SetResourceSchedulingFilter( | 879 void ResourceDispatcher::SetResourceSchedulingFilter( |
880 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { | 880 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { |
881 resource_scheduling_filter_ = resource_scheduling_filter; | 881 resource_scheduling_filter_ = resource_scheduling_filter; |
882 } | 882 } |
883 | 883 |
884 } // namespace content | 884 } // namespace content |
OLD | NEW |