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 #include "content/browser/loader/resource_scheduler.h" | 5 #include "content/browser/loader/resource_scheduler.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1073 scheduled_resource_request->set_request_priority_params( | 1073 scheduled_resource_request->set_request_priority_params( |
1074 new_priority_params); | 1074 new_priority_params); |
1075 return; | 1075 return; |
1076 } | 1076 } |
1077 | 1077 |
1078 Client* client = client_it->second; | 1078 Client* client = client_it->second; |
1079 client->ReprioritizeRequest(scheduled_resource_request, old_priority_params, | 1079 client->ReprioritizeRequest(scheduled_resource_request, old_priority_params, |
1080 new_priority_params); | 1080 new_priority_params); |
1081 } | 1081 } |
1082 | 1082 |
1083 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
| |
1084 net::RequestPriority new_priority) { | |
1085 int current_intra_priority = 0; | |
1086 auto* existing_request = ScheduledResourceRequest::ForRequest(request); | |
1087 if (existing_request) { | |
1088 current_intra_priority = | |
1089 existing_request->get_request_priority_params().intra_priority; | |
1090 } | |
1091 ReprioritizeRequest(request, new_priority, current_intra_priority); | |
1092 } | |
1093 | |
1083 ResourceScheduler::ClientId ResourceScheduler::MakeClientId( | 1094 ResourceScheduler::ClientId ResourceScheduler::MakeClientId( |
1084 int child_id, int route_id) { | 1095 int child_id, int route_id) { |
1085 return (static_cast<ResourceScheduler::ClientId>(child_id) << 32) | route_id; | 1096 return (static_cast<ResourceScheduler::ClientId>(child_id) << 32) | route_id; |
1086 } | 1097 } |
1087 | 1098 |
1088 } // namespace content | 1099 } // namespace content |
OLD | NEW |