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

Unified Diff: chrome/browser/prerender/prerender_resource_throttle.h

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: chrome/browser/prerender/prerender_resource_throttle.h
diff --git a/chrome/browser/prerender/prerender_resource_throttle.h b/chrome/browser/prerender/prerender_resource_throttle.h
index a9f853ec9ccb45379d74940b614b10688629d6d5..a9fa3e039beb770dd115ea8a5c5227f08aa9ce2e 100644
--- a/chrome/browser/prerender/prerender_resource_throttle.h
+++ b/chrome/browser/prerender/prerender_resource_throttle.h
@@ -14,6 +14,7 @@
#include "content/public/browser/resource_request_info.h"
#include "content/public/browser/resource_throttle.h"
#include "content/public/common/resource_type.h"
+#include "net/base/request_priority.h"
class GURL;
@@ -50,6 +51,9 @@ class PrerenderResourceThrottle
// May only be called if currently throttling the resource.
void ResumeHandler();
+ // Resets the resource priority back to its original value.
+ void ResetResourcePriority();
+
static void OverridePrerenderContentsForTesting(PrerenderContents* contents);
private:
@@ -89,6 +93,10 @@ class PrerenderResourceThrottle
net::URLRequest* request_;
int load_flags_; // Load flags to be OR'ed with the existing request flags.
Charlie Harrison 2017/04/12 12:37:26 nit: newline below.
droger 2017/04/12 13:20:54 Done.
+ // The throttle changes most request priorities to IDLE during prerendering.
+ // The priority is reset back to the original priority when prerendering is
+ // finished, unless the original priority is IDLE.
+ net::RequestPriority original_request_priority_;
scoped_refptr<PrerenderThrottleInfo> prerender_throttle_info_;

Powered by Google App Engine
This is Rietveld 408576698