Chromium Code Reviews| 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; |
| } |