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

Unified Diff: components/gcm_driver/gcm_channel_status_request.cc

Issue 658223003: Merge to M39: [GCM] Updating GCM Status Syncer to the new Experiment Status pb (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2171
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
« no previous file with comments | « components/gcm_driver/DEPS ('k') | components/gcm_driver/gcm_channel_status_request_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dfd0bd1179fdd4f34f1b494c520d6253dcbe8a16..6db949b166307d1d974c224e24518a5e0dfceed8 100644
--- a/components/gcm_driver/gcm_channel_status_request.cc
+++ b/components/gcm_driver/gcm_channel_status_request.cc
@@ -7,12 +7,12 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
#include "components/gcm_driver/gcm_backoff_policy.h"
-#include "components/gcm_driver/proto/gcm_channel_status.pb.h"
#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_status.h"
+#include "sync/protocol/experiment_status.pb.h"
#include "url/gurl.h"
namespace gcm {
@@ -57,7 +57,7 @@ void GCMChannelStatusRequest::Start() {
GURL request_url(channel_status_request_url_);
- gcm_proto::ExperimentStatusRequest proto_data;
+ sync_pb::ExperimentStatusRequest proto_data;
proto_data.add_experiment_name(kGCMChannelTag);
std::string upload_data;
DCHECK(proto_data.SerializeToString(&upload_data));
@@ -99,16 +99,17 @@ bool GCMChannelStatusRequest::ParseResponse(const net::URLFetcher* source) {
return false;
}
- gcm_proto::ExperimentStatusResponse response_proto;
+ sync_pb::ExperimentStatusResponse response_proto;
if (!response_proto.ParseFromString(response_string)) {
LOG(ERROR) << "GCM channel response failed to be parse as proto.";
return false;
}
bool enabled = true;
- if (response_proto.has_gcm_channel() &&
- response_proto.gcm_channel().has_enabled()) {
- enabled = response_proto.gcm_channel().enabled();
+ if (response_proto.experiment_size() == 1 &&
+ response_proto.experiment(0).has_gcm_channel() &&
+ response_proto.experiment(0).gcm_channel().has_enabled()) {
+ enabled = response_proto.experiment(0).gcm_channel().enabled();
}
int poll_interval_seconds;
« no previous file with comments | « components/gcm_driver/DEPS ('k') | components/gcm_driver/gcm_channel_status_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698