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

Unified Diff: components/gcm_driver/gcm_client_impl.cc

Issue 445683003: [GCM] Exposing persistence of account mappings in GCM Driver (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updates based on self review Created 6 years, 4 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: components/gcm_driver/gcm_client_impl.cc
diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc
index b5240f95ea4ca1c85f89b218d350948a7c22a0b0..02ea2326fc055d2d0195123c957e87549cb1557f 100644
--- a/components/gcm_driver/gcm_client_impl.cc
+++ b/components/gcm_driver/gcm_client_impl.cc
@@ -469,6 +469,20 @@ void GCMClientImpl::SetAccountsForCheckin(
}
}
+void GCMClientImpl::UpdateAccountMapping(
+ const AccountMapping& account_mapping) {
+ gcm_store_->AddAccountMapping(account_mapping,
+ base::Bind(&GCMClientImpl::DefaultStoreCallback,
+ weak_ptr_factory_.GetWeakPtr()));
+}
+
+void GCMClientImpl::RemoveAccountMapping(const std::string& account_id) {
+ gcm_store_->RemoveAccountMapping(
+ account_id,
+ base::Bind(&GCMClientImpl::DefaultStoreCallback,
+ weak_ptr_factory_.GetWeakPtr()));
+}
+
void GCMClientImpl::StartCheckin() {
// Make sure no checkin is in progress.
if (checkin_request_.get())
@@ -584,6 +598,10 @@ void GCMClientImpl::UpdateRegistrationCallback(bool success) {
DCHECK(success);
}
+void GCMClientImpl::DefaultStoreCallback(bool success) {
+ DCHECK(success);
+}
+
void GCMClientImpl::Stop() {
weak_ptr_factory_.InvalidateWeakPtrs();
device_checkin_info_.Reset();

Powered by Google App Engine
This is Rietveld 408576698