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

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

Issue 2926693002: Make content::ThrottlingURLLoader take a task runner and more efficient. (Closed)
Patch Set: sync & resolve Created 3 years, 6 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.h » ('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 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 weak_factory_.GetWeakPtr(), request_id, 659 weak_factory_.GetWeakPtr(), request_id,
660 base::Passed(std::move(consumer_handle)))); 660 base::Passed(std::move(consumer_handle))));
661 661
662 return request_id; 662 return request_id;
663 } 663 }
664 664
665 if (ipc_type == blink::WebURLRequest::LoadingIPCType::kMojo) { 665 if (ipc_type == blink::WebURLRequest::LoadingIPCType::kMojo) {
666 scoped_refptr<base::SingleThreadTaskRunner> task_runner = 666 scoped_refptr<base::SingleThreadTaskRunner> task_runner =
667 loading_task_runner ? loading_task_runner : thread_task_runner_; 667 loading_task_runner ? loading_task_runner : thread_task_runner_;
668 std::unique_ptr<URLLoaderClientImpl> client( 668 std::unique_ptr<URLLoaderClientImpl> client(
669 new URLLoaderClientImpl(request_id, this, std::move(task_runner))); 669 new URLLoaderClientImpl(request_id, this, task_runner));
670 std::unique_ptr<ThrottlingURLLoader> url_loader = 670 std::unique_ptr<ThrottlingURLLoader> url_loader =
671 ThrottlingURLLoader::CreateLoaderAndStart( 671 ThrottlingURLLoader::CreateLoaderAndStart(
672 url_loader_factory, std::move(throttles), routing_id, request_id, 672 url_loader_factory, std::move(throttles), routing_id, request_id,
673 mojom::kURLLoadOptionNone, std::move(request), client.get()); 673 mojom::kURLLoadOptionNone, std::move(request), client.get(),
674 std::move(task_runner));
675 ;
674 pending_requests_[request_id]->url_loader = std::move(url_loader); 676 pending_requests_[request_id]->url_loader = std::move(url_loader);
675 pending_requests_[request_id]->url_loader_client = std::move(client); 677 pending_requests_[request_id]->url_loader_client = std::move(client);
676 } else { 678 } else {
677 message_sender_->Send( 679 message_sender_->Send(
678 new ResourceHostMsg_RequestResource(routing_id, request_id, *request)); 680 new ResourceHostMsg_RequestResource(routing_id, request_id, *request));
679 } 681 }
680 682
681 return request_id; 683 return request_id;
682 } 684 }
683 685
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
845 delete message; 847 delete message;
846 } 848 }
847 } 849 }
848 850
849 void ResourceDispatcher::SetResourceSchedulingFilter( 851 void ResourceDispatcher::SetResourceSchedulingFilter(
850 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) { 852 scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) {
851 resource_scheduling_filter_ = resource_scheduling_filter; 853 resource_scheduling_filter_ = resource_scheduling_filter;
852 } 854 }
853 855
854 } // namespace content 856 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/child/url_loader_client_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698