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

Unified Diff: google_apis/gcm/gcm_client_impl.cc

Issue 215363007: [GCM] Adding basic G-services handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removing the G-services handling form GCMClientImpl Created 6 years, 8 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 | « google_apis/gcm/gcm_client_impl.h ('k') | google_apis/gcm/tools/mcs_probe.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: google_apis/gcm/gcm_client_impl.cc
diff --git a/google_apis/gcm/gcm_client_impl.cc b/google_apis/gcm/gcm_client_impl.cc
index 568e740384cb490c36813a0e3c9a2ef17a43801d..ecb4b27fdab827fb22a65dd12cfb5a0f6d89592c 100644
--- a/google_apis/gcm/gcm_client_impl.cc
+++ b/google_apis/gcm/gcm_client_impl.cc
@@ -11,6 +11,7 @@
#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram.h"
#include "base/sequenced_task_runner.h"
+#include "base/strings/string_number_conversions.h"
#include "base/time/default_clock.h"
#include "google_apis/gcm/base/mcs_message.h"
#include "google_apis/gcm/base/mcs_util.h"
@@ -293,32 +294,36 @@ void GCMClientImpl::ResetState() {
}
void GCMClientImpl::StartCheckin() {
+ CheckinRequest::RequestInfo request_info(
+ device_checkin_info_.android_id,
+ device_checkin_info_.secret,
+ std::string(),
+ account_ids_,
+ chrome_build_proto_);
checkin_request_.reset(
- new CheckinRequest(base::Bind(&GCMClientImpl::OnCheckinCompleted,
- weak_ptr_factory_.GetWeakPtr()),
+ new CheckinRequest(request_info,
kDefaultBackoffPolicy,
- chrome_build_proto_,
- device_checkin_info_.android_id,
- device_checkin_info_.secret,
- account_ids_,
+ base::Bind(&GCMClientImpl::OnCheckinCompleted,
+ weak_ptr_factory_.GetWeakPtr()),
url_request_context_getter_));
checkin_request_->Start();
}
-void GCMClientImpl::OnCheckinCompleted(uint64 android_id,
- uint64 security_token) {
+void GCMClientImpl::OnCheckinCompleted(
+ const checkin_proto::AndroidCheckinResponse& checkin_response) {
checkin_request_.reset();
- CheckinInfo checkin_info;
- checkin_info.android_id = android_id;
- checkin_info.secret = security_token;
-
- if (!checkin_info.IsValid()) {
- // TODO(fgorski): I don't think a retry here will help, we should probalby
+ if (!checkin_response.has_android_id() ||
+ !checkin_response.has_security_token()) {
+ // TODO(fgorski): I don't think a retry here will help, we should probably
// start over. By checking in with (0, 0).
return;
}
+ CheckinInfo checkin_info;
+ checkin_info.android_id = checkin_response.android_id();
+ checkin_info.secret = checkin_response.security_token();
+
if (state_ == INITIAL_DEVICE_CHECKIN) {
OnFirstTimeDeviceCheckinCompleted(checkin_info);
} else {
« no previous file with comments | « google_apis/gcm/gcm_client_impl.h ('k') | google_apis/gcm/tools/mcs_probe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698