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

Unified Diff: cloud_print/gcp20/prototype/privet_http_server.cc

Issue 22306002: GCP2.0 Device: New timeouts (5 sec). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed error when getClaimToken is not ready Created 7 years, 4 months 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
« no previous file with comments | « cloud_print/gcp20/prototype/printer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cloud_print/gcp20/prototype/privet_http_server.cc
diff --git a/cloud_print/gcp20/prototype/privet_http_server.cc b/cloud_print/gcp20/prototype/privet_http_server.cc
index b29b8e36d58dafcb08a8b18fb9af4fcdca3efc5b..0ffcfbc80b89983763bc7011d8d0924b07db1868 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");
« no previous file with comments | « cloud_print/gcp20/prototype/printer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698