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

Unified Diff: chrome/browser/services/gcm/gcm_profile_service.cc

Issue 98173009: GCM Checkin implementation with unit tests and protobufs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gcm-store
Patch Set: Updating the copyright notice Created 6 years, 11 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: chrome/browser/services/gcm/gcm_profile_service.cc
diff --git a/chrome/browser/services/gcm/gcm_profile_service.cc b/chrome/browser/services/gcm/gcm_profile_service.cc
index 478a905ddf83a053833cdd61d1eb3b7cffac0840..4f0c270014514b92ce09a8bd9936e4857813ea09 100644
--- a/chrome/browser/services/gcm/gcm_profile_service.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service.cc
@@ -166,7 +166,7 @@ class GCMProfileService::IOWorker
// Overridden from GCMClient::Delegate:
// Called from IO thread.
- virtual void OnCheckInFinished(const GCMClient::CheckInInfo& checkin_info,
+ virtual void OnCheckInFinished(const GCMClient::CheckinInfo& checkin_info,
GCMClient::Result result) OVERRIDE;
virtual void OnRegisterFinished(const std::string& app_id,
const std::string& registration_id,
@@ -181,7 +181,7 @@ class GCMProfileService::IOWorker
virtual void OnMessageSendError(const std::string& app_id,
const std::string& message_id,
GCMClient::Result result) OVERRIDE;
- virtual GCMClient::CheckInInfo GetCheckInInfo() const OVERRIDE;
+ virtual GCMClient::CheckinInfo GetCheckinInfo() const OVERRIDE;
virtual void OnLoadingCompleted() OVERRIDE;
virtual base::TaskRunner* GetFileTaskRunner() OVERRIDE;
@@ -189,7 +189,8 @@ class GCMProfileService::IOWorker
void SetUser(const std::string& username);
void RemoveUser(const std::string& username);
void CheckIn();
- void SetCheckInInfo(GCMClient::CheckInInfo checkin_info);
+ // TODO(fgorski): Update to pass by const ref.
+ void SetCheckinInfo(GCMClient::CheckinInfo checkin_info);
void CheckOut();
void Register(const std::string& app_id,
const std::vector<std::string>& sender_ids,
@@ -210,7 +211,7 @@ class GCMProfileService::IOWorker
// The checkin info obtained from the server for the signed in user associated
// with the profile.
- GCMClient::CheckInInfo checkin_info_;
+ GCMClient::CheckinInfo checkin_info_;
};
GCMProfileService::IOWorker::IOWorker(
@@ -222,7 +223,7 @@ GCMProfileService::IOWorker::~IOWorker() {
}
void GCMProfileService::IOWorker::OnCheckInFinished(
- const GCMClient::CheckInInfo& checkin_info,
+ const GCMClient::CheckinInfo& checkin_info,
GCMClient::Result result) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
@@ -310,7 +311,7 @@ void GCMProfileService::IOWorker::OnMessageSendError(
result));
}
-GCMClient::CheckInInfo GCMProfileService::IOWorker::GetCheckInInfo() const {
+GCMClient::CheckinInfo GCMProfileService::IOWorker::GetCheckinInfo() const {
return checkin_info_;
}
@@ -360,8 +361,8 @@ void GCMProfileService::IOWorker::CheckIn() {
GCMClient::Get()->CheckIn(username_);
}
-void GCMProfileService::IOWorker::SetCheckInInfo(
- GCMClient::CheckInInfo checkin_info) {
+void GCMProfileService::IOWorker::SetCheckinInfo(
+ GCMClient::CheckinInfo checkin_info) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
checkin_info_ = checkin_info;
@@ -670,13 +671,13 @@ void GCMProfileService::AddUser(const std::string& username) {
Encryptor::DecryptString(encrypted_secret, &decrypted_secret);
uint64 secret = 0;
if (base::StringToUint64(decrypted_secret, &secret) && secret) {
- GCMClient::CheckInInfo checkin_info;
+ GCMClient::CheckinInfo checkin_info;
checkin_info.android_id = android_id;
checkin_info.secret = secret;
content::BrowserThread::PostTask(
content::BrowserThread::IO,
FROM_HERE,
- base::Bind(&GCMProfileService::IOWorker::SetCheckInInfo,
+ base::Bind(&GCMProfileService::IOWorker::SetCheckinInfo,
io_worker_,
checkin_info));
@@ -735,7 +736,7 @@ void GCMProfileService::Unregister(const std::string& app_id) {
app_id));
}
-void GCMProfileService::CheckInFinished(GCMClient::CheckInInfo checkin_info,
+void GCMProfileService::CheckInFinished(GCMClient::CheckinInfo checkin_info,
GCMClient::Result result) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));

Powered by Google App Engine
This is Rietveld 408576698