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

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

Issue 378643002: [GCM] Check-in with signed in accounts associates device to user (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixing compilation issue on android Created 6 years, 5 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_account_tracker.cc
diff --git a/chrome/browser/services/gcm/gcm_account_tracker.cc b/chrome/browser/services/gcm/gcm_account_tracker.cc
index 00bb15053bfc564fe65e6e3a2cbb25731d3cedd7..070b54c24325174fac818b591be062f8ceed1531 100644
--- a/chrome/browser/services/gcm/gcm_account_tracker.cc
+++ b/chrome/browser/services/gcm/gcm_account_tracker.cc
@@ -13,8 +13,7 @@
namespace gcm {
namespace {
-const char kGCMGroupServerScope[] =
- "oauth2:https://www.googleapis.com/auth/gcm";
+const char kGCMGroupServerScope[] = "https://www.googleapis.com/auth/gcm";
Nicolas Zea 2014/07/10 20:57:32 Why is this changing?
fgorski 2014/07/11 22:51:20 I am correcting the scope here, now that I was abl
const char kGCMAccountTrackerName[] = "gcm_account_tracker";
} // namespace
@@ -75,10 +74,12 @@ void GCMAccountTracker::Stop() {
}
void GCMAccountTracker::OnAccountAdded(const gaia::AccountIds& ids) {
+ DVLOG(1) << "Account added: " << ids.email;
// We listen for the account signing in, which happens after account is added.
}
void GCMAccountTracker::OnAccountRemoved(const gaia::AccountIds& ids) {
+ DVLOG(1) << "Account removed: " << ids.email;
// We listen for the account signing out, which happens before account is
// removed.
}
@@ -97,6 +98,7 @@ void GCMAccountTracker::OnGetTokenSuccess(
const base::Time& expiration_time) {
DCHECK(request);
DCHECK(!request->GetAccountId().empty());
+ DVLOG(1) << "Get token success: " << request->GetAccountId();
AccountInfos::iterator iter = account_infos_.find(request->GetAccountId());
DCHECK(iter != account_infos_.end());
@@ -120,6 +122,7 @@ void GCMAccountTracker::OnGetTokenFailure(
const GoogleServiceAuthError& error) {
DCHECK(request);
DCHECK(!request->GetAccountId().empty());
+ DVLOG(1) << "Get token failure: " << request->GetAccountId();
AccountInfos::iterator iter = account_infos_.find(request->GetAccountId());
DCHECK(iter != account_infos_.end());
@@ -181,7 +184,14 @@ void GCMAccountTracker::CompleteCollectingTokens() {
}
}
- callback_.Run(account_tokens, account_removed);
+ // Make sure that there is something to report, otherwise bail out.
+ if (!account_tokens.empty() || account_removed) {
+ DVLOG(1) << "Calling callback: " << account_tokens.size() << ", "
+ << (account_removed ? "" : "no ") << "account removed.";
+ callback_.Run(account_tokens, account_removed);
+ } else {
+ DVLOG(1) << "Skipping calling callback.";
+ }
}
void GCMAccountTracker::DeleteTokenRequest(
@@ -215,6 +225,7 @@ void GCMAccountTracker::GetToken(AccountInfos::iterator& account_iter) {
}
void GCMAccountTracker::OnAccountSignedIn(const gaia::AccountIds& ids) {
+ DVLOG(1) << "Account signed in: " << ids.email;
AccountInfos::iterator iter = account_infos_.find(ids.account_key);
if (iter == account_infos_.end()) {
DCHECK(!ids.email.empty());
@@ -228,6 +239,7 @@ void GCMAccountTracker::OnAccountSignedIn(const gaia::AccountIds& ids) {
}
void GCMAccountTracker::OnAccountSignedOut(const gaia::AccountIds& ids) {
+ DVLOG(1) << "Account signed out: " << ids.email;
AccountInfos::iterator iter = account_infos_.find(ids.account_key);
if (iter == account_infos_.end())
return;
« no previous file with comments | « no previous file | chrome/browser/services/gcm/gcm_profile_service.cc » ('j') | components/gcm_driver/gcm_client_impl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698