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

Unified Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 2552703003: Make reprioritization IPC batch rather than per-request.
Patch Set: Fix some typos. Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/loader/resource_dispatcher_host_impl.cc
diff --git a/content/browser/loader/resource_dispatcher_host_impl.cc b/content/browser/loader/resource_dispatcher_host_impl.cc
index fad7d214783f44ff611a9918f0859c664bbd2166..149d9a6440d311a6076561da59fd700841001686 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -1774,17 +1774,22 @@ void ResourceDispatcherHostImpl::OnReleaseDownloadedFile(
void ResourceDispatcherHostImpl::OnDidChangePriority(
ResourceRequesterInfo* requester_info,
- int request_id,
- net::RequestPriority new_priority,
- int intra_priority_value) {
- ResourceLoader* loader = GetLoader(requester_info->child_id(), request_id);
- // The request may go away before processing this message, so |loader| can
- // legitimately be null.
- if (!loader)
- return;
+ const std::vector<ResourcePriorityChangeInfo>& priority_info_vector) {
+ std::vector<ResourceScheduler::PriorityChangeRequest>
+ priority_change_requests;
+
+ for (auto& v : priority_info_vector) {
+ ResourceLoader* loader =
+ GetLoader(requester_info->child_id(), v.request_id);
+ // The request may go away before processing this message, so |loader| can
+ // legitimately be null.
+ if (!loader)
+ continue;
- scheduler_->ReprioritizeRequest(loader->request(), new_priority,
- intra_priority_value);
+ priority_change_requests.push_back(
+ {loader->request(), v.priority, v.intra_priority_value});
+ }
+ scheduler_->ReprioritizeRequests(priority_change_requests);
}
void ResourceDispatcherHostImpl::RegisterDownloadedTempFile(

Powered by Google App Engine
This is Rietveld 408576698