Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(971)

Side by Side Diff: chrome/browser/google/google_url_tracker.cc

Issue 11464028: Introduce ERR_NETWORK_CHANGED and allow URLFetcher to automatically retry on that error. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed nits Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/google/google_url_tracker.h" 5 #include "chrome/browser/google/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/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/browser/google/google_url_tracker_factory.h" 10 #include "chrome/browser/google/google_url_tracker_factory.h"
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 net::URLFetcher::GET, this)); 322 net::URLFetcher::GET, this));
323 ++fetcher_id_; 323 ++fetcher_id_;
324 // We don't want this fetch to set new entries in the cache or cookies, lest 324 // We don't want this fetch to set new entries in the cache or cookies, lest
325 // we alarm the user. 325 // we alarm the user.
326 fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE | 326 fetcher_->SetLoadFlags(net::LOAD_DISABLE_CACHE |
327 net::LOAD_DO_NOT_SAVE_COOKIES); 327 net::LOAD_DO_NOT_SAVE_COOKIES);
328 fetcher_->SetRequestContext(profile_->GetRequestContext()); 328 fetcher_->SetRequestContext(profile_->GetRequestContext());
329 329
330 // Configure to max_retries at most kMaxRetries times for 5xx errors. 330 // Configure to max_retries at most kMaxRetries times for 5xx errors.
331 static const int kMaxRetries = 5; 331 static const int kMaxRetries = 5;
332 fetcher_->SetMaxRetries(kMaxRetries); 332 fetcher_->SetMaxRetriesOn5xx(kMaxRetries);
333 333
334 fetcher_->Start(); 334 fetcher_->Start();
335 } 335 }
336 336
337 void GoogleURLTracker::SearchCommitted() { 337 void GoogleURLTracker::SearchCommitted() {
338 if (need_to_prompt_) { 338 if (need_to_prompt_) {
339 search_committed_ = true; 339 search_committed_ = true;
340 // These notifications will fire a bit later in the same call chain we're 340 // These notifications will fire a bit later in the same call chain we're
341 // currently in. 341 // currently in.
342 if (!registrar_.IsRegistered(this, content::NOTIFICATION_NAV_ENTRY_PENDING, 342 if (!registrar_.IsRegistered(this, content::NOTIFICATION_NAV_ENTRY_PENDING,
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 } 523 }
524 if (registrar_.IsRegistered(this, content::NOTIFICATION_NAV_ENTRY_PENDING, 524 if (registrar_.IsRegistered(this, content::NOTIFICATION_NAV_ENTRY_PENDING,
525 content::NotificationService::AllBrowserContextsAndSources())) { 525 content::NotificationService::AllBrowserContextsAndSources())) {
526 DCHECK(!search_committed_); 526 DCHECK(!search_committed_);
527 registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_PENDING, 527 registrar_.Remove(this, content::NOTIFICATION_NAV_ENTRY_PENDING,
528 content::NotificationService::AllBrowserContextsAndSources()); 528 content::NotificationService::AllBrowserContextsAndSources());
529 registrar_.Remove(this, chrome::NOTIFICATION_INSTANT_COMMITTED, 529 registrar_.Remove(this, chrome::NOTIFICATION_INSTANT_COMMITTED,
530 content::NotificationService::AllBrowserContextsAndSources()); 530 content::NotificationService::AllBrowserContextsAndSources());
531 } 531 }
532 } 532 }
OLDNEW
« no previous file with comments | « chrome/browser/chrome_to_mobile_service.cc ('k') | chrome/browser/history/web_history_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698