OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/google/core/browser/google_url_tracker.h" | 5 #include "components/google/core/browser/google_url_tracker.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
238 ++fetcher_id_; | 238 ++fetcher_id_; |
239 // We don't want this fetch to set new entries in the cache or cookies, lest | 239 // We don't want this fetch to set new entries in the cache or cookies, lest |
240 // we alarm the user. | 240 // we alarm the user. |
241 fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE | | 241 fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE | |
242 net::LOAD_DO_NOT_SAVE_COOKIES); | 242 net::LOAD_DO_NOT_SAVE_COOKIES); |
243 fetcher_->SetRequestContext(client_->GetRequestContext()); | 243 fetcher_->SetRequestContext(client_->GetRequestContext()); |
244 | 244 |
245 // Configure to max_retries at most kMaxRetries times for 5xx errors. | 245 // Configure to max_retries at most kMaxRetries times for 5xx errors. |
246 static const int kMaxRetries = 5; | 246 static const int kMaxRetries = 5; |
247 fetcher_->SetMaxRetriesOn5xx(kMaxRetries); | 247 fetcher_->SetMaxRetriesOn5xx(kMaxRetries); |
248 // Configure to max_retries at most kMaxRetries times for network changes. | |
pauljensen
2014/09/05 13:22:56
What is "max_retries"? would "retry" make more se
Jaekyun Seok (inactive)
2014/09/05 19:00:50
Done.
| |
249 fetcher_->SetAutomaticallyRetryOnNetworkChanges(kMaxRetries); | |
248 | 250 |
249 fetcher_->Start(); | 251 fetcher_->Start(); |
250 } | 252 } |
251 | 253 |
252 void GoogleURLTracker::OnNavigationPending( | 254 void GoogleURLTracker::OnNavigationPending( |
253 scoped_ptr<GoogleURLTrackerNavigationHelper> nav_helper, | 255 scoped_ptr<GoogleURLTrackerNavigationHelper> nav_helper, |
254 infobars::InfoBarManager* infobar_manager, | 256 infobars::InfoBarManager* infobar_manager, |
255 int pending_id) { | 257 int pending_id) { |
256 GoogleURLTrackerMapEntry* map_entry = NULL; | 258 GoogleURLTrackerMapEntry* map_entry = NULL; |
257 | 259 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
394 } | 396 } |
395 if (client_->IsListeningForNavigationStart()) { | 397 if (client_->IsListeningForNavigationStart()) { |
396 DCHECK(!search_committed_); | 398 DCHECK(!search_committed_); |
397 client_->SetListeningForNavigationStart(false); | 399 client_->SetListeningForNavigationStart(false); |
398 } | 400 } |
399 } | 401 } |
400 | 402 |
401 void GoogleURLTracker::NotifyGoogleURLUpdated() { | 403 void GoogleURLTracker::NotifyGoogleURLUpdated() { |
402 callback_list_.Notify(); | 404 callback_list_.Notify(); |
403 } | 405 } |
OLD | NEW |