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

Unified Diff: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc

Issue 60193004: [Prerender] Avoid setting prerender requests for sync XHRs to IDLE priority (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
diff --git a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
index 62b6c57a6743f9df85454df16c16cb8b20e5a153..fdfc8961338dcf9f2b33960734bfd263ad3bb944 100644
--- a/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
+++ b/chrome/browser/renderer_host/chrome_resource_dispatcher_host_delegate.cc
@@ -51,6 +51,7 @@
#include "extensions/common/user_script.h"
#include "net/base/load_flags.h"
#include "net/base/load_timing_info.h"
+#include "net/base/request_priority.h"
#include "net/http/http_response_headers.h"
#include "net/ssl/ssl_config_service.h"
#include "net/url_request/url_request.h"
@@ -287,7 +288,13 @@ void ChromeResourceDispatcherHostDelegate::RequestBeginning(
child_id, route_id);
if (is_prerendering) {
user_data->set_is_prerender(true);
- request->SetPriority(net::IDLE);
+ // Requests with the IGNORE_LIMITS flag set (i.e., sync XHRs)
+ // should remain at MAXIMUM_PRIORITY.
+ if (request->load_flags() & net::LOAD_IGNORE_LIMITS) {
+ DCHECK_EQ(request->priority(), net::MAXIMUM_PRIORITY);
+ } else {
+ request->SetPriority(net::IDLE);
+ }
}
ProfileIOData* io_data = ProfileIOData::FromResourceContext(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698