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

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

Issue 11270027: Add a ResourceScheduler to ResourceDispatcherHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use new WebKit signals Created 7 years, 10 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_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 37891cb2bc672e2fc35321de022a5539728e50e7..099bc96ca6bbf1d7bca07983c48e9b67d94b8b81 100644
--- a/content/browser/loader/resource_dispatcher_host_impl.cc
+++ b/content/browser/loader/resource_dispatcher_host_impl.cc
@@ -205,31 +205,6 @@ void RemoveDownloadFileFromChildSecurityPolicy(int child_id,
#pragma warning(default: 4748)
#endif
-net::RequestPriority DetermineRequestPriority(
- const ResourceHostMsg_Request& request_data) {
- switch (request_data.priority) {
- case WebKit::WebURLRequest::PriorityVeryHigh:
- return net::HIGHEST;
-
- case WebKit::WebURLRequest::PriorityHigh:
- return net::MEDIUM;
-
- case WebKit::WebURLRequest::PriorityMedium:
- return net::LOW;
-
- case WebKit::WebURLRequest::PriorityLow:
- return net::LOWEST;
-
- case WebKit::WebURLRequest::PriorityVeryLow:
- return net::IDLE;
-
- case WebKit::WebURLRequest::PriorityUnresolved:
- default:
- NOTREACHED();
- return net::LOW;
- }
-}
-
void OnSwapOutACKHelper(int render_process_id,
int render_view_id,
bool timed_out) {
@@ -939,8 +914,7 @@ void ResourceDispatcherHostImpl::BeginRequest(
// transferred navigation case?
request->set_load_flags(load_flags);
-
- request->set_priority(DetermineRequestPriority(request_data));
+ request->set_priority(request_data.priority);
// Resolve elements from request_body and prepare upload data.
if (request_data.request_body) {
@@ -1049,11 +1023,12 @@ void ResourceDispatcherHostImpl::BeginRequest(
new TransferNavigationResourceThrottle(request));
}
- if (!throttles.empty()) {
- handler.reset(
- new ThrottlingResourceHandler(handler.Pass(), child_id, request_id,
- throttles.Pass()));
- }
+ throttles.push_back(
+ scheduler_.ScheduleRequest(child_id, route_id, request).release());
+
+ handler.reset(
+ new ThrottlingResourceHandler(handler.Pass(), child_id, request_id,
+ throttles.Pass()));
if (deferred_loader.get()) {
pending_loaders_[extra_info->GetGlobalRequestID()] = deferred_loader;

Powered by Google App Engine
This is Rietveld 408576698