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

Unified Diff: components/gcm_driver/gcm_client_impl.cc

Issue 2675293003: Push API: Don't wait for network when unsubscribing (Closed)
Patch Set: Address peter's review comments Created 3 years, 10 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 | « components/gcm_driver/gcm_client.h ('k') | components/gcm_driver/instance_id/instance_id.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/gcm_client_impl.cc
diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc
index a18b5850b5d8bb4e78dca77ee4628e696dc3f20d..5420646009c631e2568e754586fe0e6360884ad9 100644
--- a/components/gcm_driver/gcm_client_impl.cc
+++ b/components/gcm_driver/gcm_client_impl.cc
@@ -961,14 +961,17 @@ void GCMClientImpl::OnRegisterCompleted(
Result result;
PendingRegistrationRequests::const_iterator iter =
pending_registration_requests_.find(registration_info);
- if (iter == pending_registration_requests_.end())
+ if (iter == pending_registration_requests_.end()) {
result = UNKNOWN_ERROR;
- else if (status == RegistrationRequest::INVALID_SENDER)
+ } else if (status == RegistrationRequest::INVALID_SENDER) {
result = INVALID_PARAMETER;
- else if (registration_id.empty())
+ } else if (registration_id.empty()) {
+ // All other errors are currently treated as SERVER_ERROR (including
+ // REACHED_MAX_RETRIES due to the device being offline!).
result = SERVER_ERROR;
- else
+ } else {
result = SUCCESS;
+ }
if (result == SUCCESS) {
// Cache it.
@@ -1114,7 +1117,8 @@ void GCMClientImpl::OnUnregisterCompleted(
result = INVALID_PARAMETER;
break;
default:
- // All other errors are treated as SERVER_ERROR.
+ // All other errors are currently treated as SERVER_ERROR (including
+ // REACHED_MAX_RETRIES due to the device being offline!).
result = SERVER_ERROR;
break;
}
« no previous file with comments | « components/gcm_driver/gcm_client.h ('k') | components/gcm_driver/instance_id/instance_id.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698