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

Unified Diff: chrome/browser/net/predictor_tab_helper.h

Issue 1857573002: [reland] Change net's predictor_tab_helper to use the new content Navigation API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update finch test config on chromeos Created 4 years, 7 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
« no previous file with comments | « chrome/browser/net/predictor_browsertest.cc ('k') | chrome/browser/net/predictor_tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/predictor_tab_helper.h
diff --git a/chrome/browser/net/predictor_tab_helper.h b/chrome/browser/net/predictor_tab_helper.h
index 4d95ba0d2b56d9635856a557fda4c1ae320d74a9..7480b17b85e91e406ea9a8777e135bd386f881d4 100644
--- a/chrome/browser/net/predictor_tab_helper.h
+++ b/chrome/browser/net/predictor_tab_helper.h
@@ -11,6 +11,10 @@
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
+namespace content {
+class NavigationHandle;
+}
+
namespace chrome_browser_net {
class PredictorTabHelper
@@ -19,7 +23,9 @@ class PredictorTabHelper
public:
~PredictorTabHelper() override;
- // content::WebContentsObserver implementation
+ // content::WebContentsObserver:
+ void DidStartNavigation(
+ content::NavigationHandle* navigation_handle) override;
void DidStartNavigationToPendingEntry(
const GURL& url,
content::NavigationController::ReloadType reload_type) override;
@@ -28,6 +34,17 @@ class PredictorTabHelper
explicit PredictorTabHelper(content::WebContents* web_contents);
friend class content::WebContentsUserData<PredictorTabHelper>;
+ void PreconnectUrl(const GURL& url);
+
+ // This boolean is set to true after a call to
+ // DidStartNavigationToPendingEntry, which fires off predictive preconnects.
+ // This ensures that the resulting call to DidStartNavigation does not
+ // duplicate these preconnects. The tab helper spawns preconnects on the
+ // navigation to the pending entry because DidStartNavigation is called after
+ // render process spawn (pre-PlzNavigate), which can take substantial time
+ // especially on Android.
+ bool predicted_from_pending_entry_;
+
DISALLOW_COPY_AND_ASSIGN(PredictorTabHelper);
};
« no previous file with comments | « chrome/browser/net/predictor_browsertest.cc ('k') | chrome/browser/net/predictor_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698