| 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..d653c7246944fb8f084e2f3d9ee437e13ba22e9f 100644
|
| --- a/content/browser/loader/resource_scheduler.cc
|
| +++ b/content/browser/loader/resource_scheduler.cc
|
| @@ -237,8 +237,9 @@ class ResourceScheduler::ScheduledResourceRequest : public ResourceThrottle {
|
| }
|
|
|
| static ScheduledResourceRequest* ForRequest(net::URLRequest* request) {
|
| - return static_cast<UnownedPointer*>(request->GetUserData(kUserDataKey))
|
| - ->get();
|
| + UnownedPointer* pointer =
|
| + static_cast<UnownedPointer*>(request->GetUserData(kUserDataKey));
|
| + return pointer ? pointer->get() : nullptr;
|
| }
|
|
|
| // Starts the request. If |start_mode| is START_ASYNC, the request will not
|
| @@ -1080,6 +1081,17 @@ void ResourceScheduler::ReprioritizeRequest(net::URLRequest* request,
|
| new_priority_params);
|
| }
|
|
|
| +void ResourceScheduler::ReprioritizeRequest(net::URLRequest* request,
|
| + 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;
|
|
|