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

Unified Diff: components/gcm_driver/gcm_channel_status_request.cc

Issue 653843003: [GCM] Start GCMChannelStatusSyncer when GCM is disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
Index: components/gcm_driver/gcm_channel_status_request.cc
diff --git a/components/gcm_driver/gcm_channel_status_request.cc b/components/gcm_driver/gcm_channel_status_request.cc
index 6db949b166307d1d974c224e24518a5e0dfceed8..fc1eff7d2e64d6b519ec34805d34bee02b5ff98c 100644
--- a/components/gcm_driver/gcm_channel_status_request.cc
+++ b/components/gcm_driver/gcm_channel_status_request.cc
@@ -93,12 +93,17 @@ bool GCMChannelStatusRequest::ParseResponse(const net::URLFetcher* source) {
}
std::string response_string;
- if (!source->GetResponseAsString(&response_string) ||
- response_string.empty()) {
+ if (!source->GetResponseAsString(&response_string)) {
LOG(ERROR) << "GCM channel response failed to be retrieved.";
return false;
}
+ // Empty response means to keep the existing values.
+ if (response_string.empty()) {
+ callback_.Run(false, false, 0);
+ return true;
+ }
+
sync_pb::ExperimentStatusResponse response_proto;
if (!response_proto.ParseFromString(response_string)) {
LOG(ERROR) << "GCM channel response failed to be parse as proto.";
fgorski 2014/10/14 17:40:37 nit: parse -> parsed
jianli 2014/10/14 23:21:47 Done.
@@ -120,7 +125,7 @@ bool GCMChannelStatusRequest::ParseResponse(const net::URLFetcher* source) {
if (poll_interval_seconds < kMinPollIntervalSeconds)
poll_interval_seconds = kMinPollIntervalSeconds;
- callback_.Run(enabled, poll_interval_seconds);
+ callback_.Run(true, enabled, poll_interval_seconds);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698