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

Unified Diff: chrome/service/cloud_print/cloud_print_url_fetcher.h

Issue 5276007: Implement exponential back-off mechanism. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: pull latest to merge Created 10 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/service/cloud_print/cloud_print_url_fetcher.h
diff --git a/chrome/service/cloud_print/cloud_print_url_fetcher.h b/chrome/service/cloud_print/cloud_print_url_fetcher.h
index cbf9bf21f0e676ae2b3d755cc945f10310e074fb..68499b4ddb13ae8b4f3c78fd8856445f089dba63 100644
--- a/chrome/service/cloud_print/cloud_print_url_fetcher.h
+++ b/chrome/service/cloud_print/cloud_print_url_fetcher.h
@@ -13,16 +13,13 @@
class DictionaryValue;
class GURL;
-class URLFetcherProtectEntry;
class URLRequestStatus;
// A wrapper around URLFetcher for CloudPrint. URLFetcher applies retry logic
// only on HTTP response codes >= 500. In the cloud print case, we want to
// retry on all network errors. In addition, we want to treat non-JSON responses
// (for all CloudPrint APIs that expect JSON responses) as errors and they
-// must also be retried. Also URLFetcher uses the host name of the URL as the
-// key for applying the retry policy. In our case, we want to apply one global
-// policy for many requests (not necessarily scoped by hostname).
+// must also be retried.
class CloudPrintURLFetcher
: public base::RefCountedThreadSafe<CloudPrintURLFetcher>,
public URLFetcher::Delegate {
@@ -80,11 +77,11 @@ class CloudPrintURLFetcher
void StartGetRequest(const GURL& url,
Delegate* delegate,
const std::string& auth_token,
- const std::string& retry_policy);
+ int max_retries);
void StartPostRequest(const GURL& url,
Delegate* delegate,
const std::string& auth_token,
- const std::string& retry_policy,
+ int max_retries,
const std::string& post_data_mime_type,
const std::string& post_data);
@@ -103,14 +100,12 @@ class CloudPrintURLFetcher
URLFetcher::RequestType request_type,
Delegate* delegate,
const std::string& auth_token,
- const std::string& retry_policy,
+ int max_retries,
const std::string& post_data_mime_type,
const std::string& post_data);
- void StartRequestNow();
scoped_ptr<URLFetcher> request_;
Delegate* delegate_;
- URLFetcherProtectEntry* protect_entry_;
int num_retries_;
};
« no previous file with comments | « chrome/service/cloud_print/cloud_print_proxy_backend.cc ('k') | chrome/service/cloud_print/cloud_print_url_fetcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698