Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: content/child/resource_dispatcher.cc

Issue 2710403002: Use the loading task runner for mojo-loading (Closed)
Patch Set: fix Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/child/url_loader_client_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 pending_requests_[request_id] = base::MakeUnique<PendingRequestInfo>( 661 pending_requests_[request_id] = base::MakeUnique<PendingRequestInfo>(
662 std::move(peer), request->resource_type, request->origin_pid, 662 std::move(peer), request->resource_type, request->origin_pid,
663 frame_origin, request->url, request->download_to_file); 663 frame_origin, request->url, request->download_to_file);
664 664
665 if (resource_scheduling_filter_.get() && loading_task_runner) { 665 if (resource_scheduling_filter_.get() && loading_task_runner) {
666 resource_scheduling_filter_->SetRequestIdTaskRunner(request_id, 666 resource_scheduling_filter_->SetRequestIdTaskRunner(request_id,
667 loading_task_runner); 667 loading_task_runner);
668 } 668 }
669 669
670 if (ipc_type == blink::WebURLRequest::LoadingIPCType::Mojo) { 670 if (ipc_type == blink::WebURLRequest::LoadingIPCType::Mojo) {
671 scoped_refptr<base::SingleThreadTaskRunner> task_runner =
672 loading_task_runner ? loading_task_runner : main_thread_task_runner_;
671 std::unique_ptr<URLLoaderClientImpl> client( 673 std::unique_ptr<URLLoaderClientImpl> client(
672 new URLLoaderClientImpl(request_id, this, main_thread_task_runner_)); 674 new URLLoaderClientImpl(request_id, this, std::move(task_runner)));
673 mojom::URLLoaderAssociatedPtr url_loader; 675 mojom::URLLoaderAssociatedPtr url_loader;
674 mojom::URLLoaderClientAssociatedPtrInfo client_ptr_info; 676 mojom::URLLoaderClientAssociatedPtrInfo client_ptr_info;
675 client->Bind(&client_ptr_info); 677 client->Bind(&client_ptr_info);
676 url_loader_factory->CreateLoaderAndStart(MakeRequest(&url_loader), 678 url_loader_factory->CreateLoaderAndStart(MakeRequest(&url_loader),
677 routing_id, request_id, *request, 679 routing_id, request_id, *request,
678 std::move(client_ptr_info)); 680 std::move(client_ptr_info));
679 pending_requests_[request_id]->url_loader = std::move(url_loader); 681 pending_requests_[request_id]->url_loader = std::move(url_loader);
680 pending_requests_[request_id]->url_loader_client = std::move(client); 682 pending_requests_[request_id]->url_loader_client = std::move(client);
681 } else { 683 } else {
682 message_sender_->Send( 684 message_sender_->Send(
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 delete message; 822 delete message;
821 } 823 }
822 } 824 }
823 825
824 void ResourceDispatcher::SetResourceSchedulingFilter( 826 void ResourceDispatcher::SetResourceSchedulingFilter(
825 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { 827 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) {
826 resource_scheduling_filter_ = resource_scheduling_filter; 828 resource_scheduling_filter_ = resource_scheduling_filter;
827 } 829 }
828 830
829 } // namespace content 831 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/child/url_loader_client_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698