| Index: chrome/browser/net/predictor.cc
|
| diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc
|
| index a04cb13cd0e618c6fdce079eb0e0241cef61166c..aaea7d036676342ea593ad92c42aa5feacb06981 100644
|
| --- a/chrome/browser/net/predictor.cc
|
| +++ b/chrome/browser/net/predictor.cc
|
| @@ -235,7 +235,7 @@ void Predictor::AnticipateOmniboxUrl(const GURL& url, bool preconnectable) {
|
| UrlInfo::ResolutionMotivation motivation(UrlInfo::OMNIBOX_MOTIVATED);
|
| base::TimeTicks now = base::TimeTicks::Now();
|
|
|
| - if (preconnect_enabled_) {
|
| + if (preconnect_enabled()) {
|
| if (preconnectable && !is_new_host_request) {
|
| ++consecutive_omnibox_preconnect_count_;
|
| // The omnibox suggests a search URL (for which we can preconnect) after
|
| @@ -299,8 +299,8 @@ void Predictor::PreconnectUrlAndSubresources(const GURL& url,
|
| const GURL& first_party_for_cookies) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) ||
|
| BrowserThread::CurrentlyOn(BrowserThread::IO));
|
| - if (!predictor_enabled_ || !preconnect_enabled_ ||
|
| - !url.is_valid() || !url.has_host())
|
| + if (!predictor_enabled_ || !preconnect_enabled() || !url.is_valid() ||
|
| + !url.has_host())
|
| return;
|
| if (!CanPreresolveAndPreconnect())
|
| return;
|
| @@ -465,6 +465,8 @@ void Predictor::LearnFromNavigation(const GURL& referring_url,
|
| DCHECK_EQ(target_url, Predictor::CanonicalizeUrl(target_url));
|
| DCHECK_NE(target_url, GURL::EmptyGURL());
|
|
|
| + if (observer_)
|
| + observer_->OnLearnFromNavigation(referring_url, target_url);
|
| referrers_[referring_url].SuggestHost(target_url);
|
| // Possibly do some referrer trimming.
|
| TrimReferrers();
|
| @@ -940,7 +942,7 @@ void Predictor::PrepareFrameSubresources(const GURL& original_url,
|
| // size of the list with all the "Leaf" nodes in the tree (nodes that don't
|
| // load any subresources). If we learn about this resource, we will instead
|
| // provide a more carefully estimated preconnection count.
|
| - if (preconnect_enabled_) {
|
| + if (preconnect_enabled()) {
|
| PreconnectUrlOnIOThread(url, first_party_for_cookies,
|
| UrlInfo::SELF_REFERAL_MOTIVATED,
|
| kAllowCredentialsOnPreconnectByDefault, 2);
|
| @@ -960,7 +962,7 @@ void Predictor::PrepareFrameSubresources(const GURL& original_url,
|
| static_cast<int>(connection_expectation * 100),
|
| 10, 5000, 50);
|
| future_url->second.ReferrerWasObserved();
|
| - if (preconnect_enabled_ &&
|
| + if (preconnect_enabled() &&
|
| connection_expectation > kPreconnectWorthyExpectedValue) {
|
| evalution = PRECONNECTION;
|
| future_url->second.IncrementPreconnectionCount();
|
|
|