forked from hasufell/hasufell-repository
65 lines
2.8 KiB
Diff
65 lines
2.8 KiB
Diff
--- ./components/google/core/browser/google_url_tracker.cc
|
|
+++ ./components/google/core/browser/google_url_tracker.cc.new
|
|
@@ -22,9 +22,9 @@
|
|
|
|
|
|
const char GoogleURLTracker::kDefaultGoogleHomepage[] =
|
|
- "https://www.google.com/";
|
|
+ "";
|
|
const char GoogleURLTracker::kSearchDomainCheckURL[] =
|
|
- "https://www.google.com/searchdomaincheck?format=domain&type=chrome";
|
|
+ "";
|
|
|
|
GoogleURLTracker::GoogleURLTracker(scoped_ptr<GoogleURLTrackerClient> client,
|
|
Mode mode)
|
|
@@ -143,48 +143,4 @@
|
|
}
|
|
|
|
void GoogleURLTracker::StartFetchIfDesirable() {
|
|
- // Bail if a fetch isn't appropriate right now. This function will be called
|
|
- // again each time one of the preconditions changes, so we'll fetch
|
|
- // immediately once all of them are met.
|
|
- //
|
|
- // See comments in header on the class, on RequestServerCheck(), and on the
|
|
- // various members here for more detail on exactly what the conditions are.
|
|
- if (in_startup_sleep_ || already_fetched_ || !need_to_fetch_)
|
|
- return;
|
|
-
|
|
- // Some switches should disable the Google URL tracker entirely. If we can't
|
|
- // do background networking, we can't do the necessary fetch, and if the user
|
|
- // specified a Google base URL manually, we shouldn't bother to look up any
|
|
- // alternatives or offer to switch to them.
|
|
- if (!client_->IsBackgroundNetworkingEnabled() ||
|
|
- base::CommandLine::ForCurrentProcess()->HasSwitch(
|
|
- switches::kGoogleBaseURL))
|
|
- return;
|
|
-
|
|
- already_fetched_ = true;
|
|
- fetcher_ = net::URLFetcher::Create(fetcher_id_, GURL(kSearchDomainCheckURL),
|
|
- net::URLFetcher::GET, this);
|
|
- data_use_measurement::DataUseUserData::AttachToFetcher(
|
|
- fetcher_.get(),
|
|
- data_use_measurement::DataUseUserData::GOOGLE_URL_TRACKER);
|
|
- ++fetcher_id_;
|
|
- // We don't want this fetch to set new entries in the cache or cookies, lest
|
|
- // we alarm the user.
|
|
- fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE |
|
|
- net::LOAD_DO_NOT_SAVE_COOKIES);
|
|
- fetcher_->SetRequestContext(client_->GetRequestContext());
|
|
-
|
|
- // Configure to retry at most kMaxRetries times for 5xx errors.
|
|
- static const int kMaxRetries = 5;
|
|
- fetcher_->SetMaxRetriesOn5xx(kMaxRetries);
|
|
-
|
|
- // Also retry kMaxRetries times on network change errors. A network change can
|
|
- // propagate through Chrome in various stages, so it's possible for this code
|
|
- // to be reached via OnNetworkChanged(), and then have the fetch we kick off
|
|
- // be canceled due to e.g. the DNS server changing at a later time. In general
|
|
- // it's not possible to ensure that by the time we reach here any requests we
|
|
- // start won't be canceled in this fashion, so retrying is the best we can do.
|
|
- fetcher_->SetAutomaticallyRetryOnNetworkChanges(kMaxRetries);
|
|
-
|
|
- fetcher_->Start();
|
|
}
|
|
|