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

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

Issue 2807163002: [Prerender] Restore request priorities when swapped in (Closed)
Patch Set: Rebase Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/loader/resource_scheduler.cc
diff --git a/content/browser/loader/resource_scheduler.cc b/content/browser/loader/resource_scheduler.cc
index e1dcb0aa04ae1c3f52ee34e4c4ee2f09ced62df1..e51e2fe8be4d8745f71d7c15655165e4a65a4009 100644
--- a/content/browser/loader/resource_scheduler.cc
+++ b/content/browser/loader/resource_scheduler.cc
@@ -1080,6 +1080,17 @@ void ResourceScheduler::ReprioritizeRequest(net::URLRequest* request,
new_priority_params);
}
+void ResourceScheduler::ReprioritizeRequest(net::URLRequest* request,
Charlie Harrison 2017/04/12 12:37:26 Just curious: In practice, is this needed? I could
droger 2017/04/12 13:20:54 Yeah, I was wondering the same thing initially: in
Charlie Harrison 2017/04/12 13:37:04 Ah good catch. Yeah until we address that we shoul
+ net::RequestPriority new_priority) {
+ int current_intra_priority = 0;
+ auto* existing_request = ScheduledResourceRequest::ForRequest(request);
+ if (existing_request) {
+ current_intra_priority =
+ existing_request->get_request_priority_params().intra_priority;
+ }
+ ReprioritizeRequest(request, new_priority, current_intra_priority);
+}
+
ResourceScheduler::ClientId ResourceScheduler::MakeClientId(
int child_id, int route_id) {
return (static_cast<ResourceScheduler::ClientId>(child_id) << 32) | route_id;

Powered by Google App Engine
This is Rietveld 408576698