| Index: chrome/service/cloud_print/cloud_print_proxy_backend.cc
|
| ===================================================================
|
| --- chrome/service/cloud_print/cloud_print_proxy_backend.cc (revision 67336)
|
| +++ chrome/service/cloud_print/cloud_print_proxy_backend.cc (working copy)
|
| @@ -15,7 +15,6 @@
|
| #include "base/string_util.h"
|
| #include "base/utf_string_conversions.h"
|
| #include "base/values.h"
|
| -#include "chrome/common/net/url_fetcher_protect.h"
|
| #include "chrome/service/cloud_print/cloud_print_consts.h"
|
| #include "chrome/service/cloud_print/cloud_print_helpers.h"
|
| #include "chrome/service/cloud_print/cloud_print_url_fetcher.h"
|
| @@ -119,8 +118,6 @@
|
| const std::string& email);
|
| void NotifyAuthenticationFailed();
|
|
|
| - URLFetcherProtectEntry* CreateDefaultRetryPolicy();
|
| -
|
| // Starts a new printer registration process.
|
| void StartRegistration();
|
| // Ends the printer registration process.
|
| @@ -357,36 +354,9 @@
|
|
|
| proxy_id_ = proxy_id;
|
|
|
| - // Register the request retry policies for cloud print APIs and job data
|
| - // requests.
|
| - URLFetcherProtectManager::GetInstance()->Register(
|
| - kCloudPrintAPIRetryPolicy, CreateDefaultRetryPolicy());
|
| - URLFetcherProtectManager::GetInstance()->Register(
|
| - kJobDataRetryPolicy, CreateDefaultRetryPolicy())->SetMaxRetries(
|
| - kJobDataMaxRetryCount);
|
| -
|
| StartRegistration();
|
| }
|
|
|
| -URLFetcherProtectEntry*
|
| -CloudPrintProxyBackend::Core::CreateDefaultRetryPolicy() {
|
| - // Times are in milliseconds.
|
| - const int kSlidingWindowPeriod = 2000;
|
| - const int kMaxSendThreshold = 20;
|
| - const int kMaxRetries = -1;
|
| - const int kInitialTimeout = 100;
|
| - const double kMultiplier = 2.0;
|
| - const int kConstantFactor = 100;
|
| - const int kMaximumTimeout = 5*60*1000;
|
| - return new URLFetcherProtectEntry(kSlidingWindowPeriod,
|
| - kMaxSendThreshold,
|
| - kMaxRetries,
|
| - kInitialTimeout,
|
| - kMultiplier,
|
| - kConstantFactor,
|
| - kMaximumTimeout);
|
| -}
|
| -
|
| void CloudPrintProxyBackend::Core::StartRegistration() {
|
| DCHECK(MessageLoop::current() == backend_->core_thread_.message_loop());
|
| printer_list_.clear();
|
| @@ -444,7 +414,7 @@
|
| &CloudPrintProxyBackend::Core::HandlePrinterListResponse;
|
| request_ = new CloudPrintURLFetcher;
|
| request_->StartGetRequest(printer_list_url, this, auth_token_,
|
| - kCloudPrintAPIRetryPolicy);
|
| + kCloudPrintAPIMaxRetryCount);
|
| }
|
|
|
| void CloudPrintProxyBackend::Core::RegisterNextPrinter() {
|
| @@ -511,7 +481,7 @@
|
| &CloudPrintProxyBackend::Core::HandleRegisterPrinterResponse;
|
| request_ = new CloudPrintURLFetcher;
|
| request_->StartPostRequest(register_url, this, auth_token_,
|
| - kCloudPrintAPIRetryPolicy, mime_type,
|
| + kCloudPrintAPIMaxRetryCount, mime_type,
|
| post_data);
|
|
|
| } else {
|
|
|