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

Side by Side Diff: chrome/browser/chrome_to_mobile_service.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
« no previous file with comments | « no previous file | chrome/browser/google/google_url_tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/chrome_to_mobile_service.h" 5 #include "chrome/browser/chrome_to_mobile_service.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/file_util.h" 9 #include "base/file_util.h"
10 #include "base/guid.h" 10 #include "base/guid.h"
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 return; 523 return;
524 } 524 }
525 525
526 data->type = SNAPSHOT; 526 data->type = SNAPSHOT;
527 SendJobRequest(observer, *data); 527 SendJobRequest(observer, *data);
528 } 528 }
529 529
530 void ChromeToMobileService::InitRequest(net::URLFetcher* request) { 530 void ChromeToMobileService::InitRequest(net::URLFetcher* request) {
531 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 531 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
532 request->SetRequestContext(profile_->GetRequestContext()); 532 request->SetRequestContext(profile_->GetRequestContext());
533 request->SetMaxRetries(kMaxRetries); 533 request->SetMaxRetriesOn5xx(kMaxRetries);
534 DCHECK(!access_token_.empty()); 534 DCHECK(!access_token_.empty());
535 request->SetExtraRequestHeaders("Authorization: OAuth " + 535 request->SetExtraRequestHeaders("Authorization: OAuth " +
536 access_token_ + "\r\n" + cloud_print::kChromeCloudPrintProxyHeader); 536 access_token_ + "\r\n" + cloud_print::kChromeCloudPrintProxyHeader);
537 request->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | 537 request->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES |
538 net::LOAD_DO_NOT_SAVE_COOKIES); 538 net::LOAD_DO_NOT_SAVE_COOKIES);
539 } 539 }
540 540
541 void ChromeToMobileService::SendJobRequest(base::WeakPtr<Observer> observer, 541 void ChromeToMobileService::SendJobRequest(base::WeakPtr<Observer> observer,
542 const JobData& data) { 542 const JobData& data) {
543 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); 543 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 738
739 // Report failure below and ignore the second response. 739 // Report failure below and ignore the second response.
740 request_observer_map_.erase(other); 740 request_observer_map_.erase(other);
741 break; 741 break;
742 } 742 }
743 } 743 }
744 744
745 if (observer.get()) 745 if (observer.get())
746 observer->OnSendComplete(success); 746 observer->OnSendComplete(success);
747 } 747 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/google/google_url_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698