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

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

Issue 4194001: Implement exponential back-off mechanism and enforce it at the URLRequestHttpJob level. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' 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
===================================================================
--- chrome/service/cloud_print/cloud_print_url_fetcher.h (revision 66188)
+++ chrome/service/cloud_print/cloud_print_url_fetcher.h (working copy)
@@ -12,16 +12,14 @@
class DictionaryValue;
class GURL;
-class URLFetcherProtectEntry;
+class RequestThrottlerManager;
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 {
@@ -79,11 +77,11 @@
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);
@@ -102,14 +100,14 @@
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_;
+ RequestThrottlerManager* request_throttler_manager_;
willchan no longer on Chromium 2010/11/17 20:32:34 Why are we caching the singleton into a pointer?
yzshen 2010/11/19 23:51:36 I thought it was right since I read this in single
int num_retries_;
};

Powered by Google App Engine
This is Rietveld 408576698