| 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);
|
| };
|
|
|
|
|