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 #if defined(OS_ANDROID) | |
249 // Configure to max_retries at most kMaxRetries times for network changes. | |
250 fetcher_->SetAutomaticallyRetryOnNetworkChanges(kMaxRetries); | |
Peter Kasting
2014/08/27 19:52:46
Let me understand this. When the network changes,
Jaekyun Seok (inactive)
2014/08/28 02:00:52
Yes, that is correctly what happened on clank.
I c
Peter Kasting
2014/08/28 03:28:19
Hmm. Here are two ideas for a possible better fix
| |
251 #endif | |
248 | 252 |
249 fetcher_->Start(); | 253 fetcher_->Start(); |
250 } | 254 } |
251 | 255 |
252 void GoogleURLTracker::OnNavigationPending( | 256 void GoogleURLTracker::OnNavigationPending( |
253 scoped_ptr<GoogleURLTrackerNavigationHelper> nav_helper, | 257 scoped_ptr<GoogleURLTrackerNavigationHelper> nav_helper, |
254 infobars::InfoBarManager* infobar_manager, | 258 infobars::InfoBarManager* infobar_manager, |
255 int pending_id) { | 259 int pending_id) { |
256 GoogleURLTrackerMapEntry* map_entry = NULL; | 260 GoogleURLTrackerMapEntry* map_entry = NULL; |
257 | 261 |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
394 } | 398 } |
395 if (client_->IsListeningForNavigationStart()) { | 399 if (client_->IsListeningForNavigationStart()) { |
396 DCHECK(!search_committed_); | 400 DCHECK(!search_committed_); |
397 client_->SetListeningForNavigationStart(false); | 401 client_->SetListeningForNavigationStart(false); |
398 } | 402 } |
399 } | 403 } |
400 | 404 |
401 void GoogleURLTracker::NotifyGoogleURLUpdated() { | 405 void GoogleURLTracker::NotifyGoogleURLUpdated() { |
402 callback_list_.Notify(); | 406 callback_list_.Notify(); |
403 } | 407 } |
OLD | NEW |