diff options
author | maksymb@chromium.org <maksymb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-06 07:56:23 +0000 |
---|---|---|
committer | maksymb@chromium.org <maksymb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-06 07:56:23 +0000 |
commit | 80cb067682d99a9f1e610ad50b090e6f85ceb4ed (patch) | |
tree | e1985c47a2a6bdf6cac6c04133022df0c883c6aa /cloud_print | |
parent | df26e138a181228afeb4145cbe87eb1382ff32ef (diff) | |
download | chromium_src-80cb067682d99a9f1e610ad50b090e6f85ceb4ed.zip chromium_src-80cb067682d99a9f1e610ad50b090e6f85ceb4ed.tar.gz chromium_src-80cb067682d99a9f1e610ad50b090e6f85ceb4ed.tar.bz2 |
GCP2.0 Device: New timeouts (5 sec).
BUG=
Review URL: https://chromiumcodereview.appspot.com/22306002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215847 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cloud_print')
-rw-r--r-- | cloud_print/gcp20/prototype/printer.cc | 4 | ||||
-rw-r--r-- | cloud_print/gcp20/prototype/privet_http_server.cc | 9 |
2 files changed, 9 insertions, 4 deletions
diff --git a/cloud_print/gcp20/prototype/printer.cc b/cloud_print/gcp20/prototype/printer.cc index 5a252c0..a161edd 100644 --- a/cloud_print/gcp20/prototype/printer.cc +++ b/cloud_print/gcp20/prototype/printer.cc @@ -240,9 +240,9 @@ PrivetHttpServer::RegistrationErrorStatus Printer::RegistrationGetClaimToken( if (reg_info_.confirmation_state != RegistrationInfo::CONFIRMATION_CONFIRMED) return ConfirmationToRegistrationError(reg_info_.confirmation_state); - // If reply wasn't received yet, reply with |device_busy| error. + // If reply wasn't received yet, reply with |pending_user_action| error. if (reg_info_.state == RegistrationInfo::DEV_REG_REGISTRATION_STARTED) - return PrivetHttpServer::REG_ERROR_DEVICE_BUSY; + return PrivetHttpServer::REG_ERROR_PENDING_USER_ACTION; DCHECK_EQ(reg_info_.state, RegistrationInfo::DEV_REG_REGISTRATION_CLAIM_TOKEN_READY); diff --git a/cloud_print/gcp20/prototype/privet_http_server.cc b/cloud_print/gcp20/prototype/privet_http_server.cc index b29b8e3..0ffcfbc 100644 --- a/cloud_print/gcp20/prototype/privet_http_server.cc +++ b/cloud_print/gcp20/prototype/privet_http_server.cc @@ -14,6 +14,9 @@ namespace { +const int kDeviceBusyTimeout = 30; // in seconds +const int kPendingUserActionTimeout = 5; // in seconds + // {"error":|error_type|} scoped_ptr<base::DictionaryValue> CreateError(const std::string& error_type) { scoped_ptr<base::DictionaryValue> error(new base::DictionaryValue); @@ -296,10 +299,12 @@ void PrivetHttpServer::ProcessRegistrationStatus( *current_response = CreateError("invalid_params"); break; case REG_ERROR_DEVICE_BUSY: - *current_response = CreateErrorWithTimeout("device_busy", 30); + *current_response = CreateErrorWithTimeout("device_busy", + kDeviceBusyTimeout); break; case REG_ERROR_PENDING_USER_ACTION: - *current_response = CreateErrorWithTimeout("pending_user_action", 30); + *current_response = CreateErrorWithTimeout("pending_user_action", + kPendingUserActionTimeout); break; case REG_ERROR_USER_CANCEL: *current_response = CreateError("user_cancel"); |