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

Unified Diff: components/gcm_driver/gcm_driver.cc

Issue 914693002: Push API: Fix unsubscribing from GCM on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Compile fix Created 5 years, 10 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_driver.cc
diff --git a/components/gcm_driver/gcm_driver.cc b/components/gcm_driver/gcm_driver.cc
index a82e7b1bcff9e284809f57530eef878fea907d35..0e2477de4e8df02bfed5166489bced6938bcf053 100644
--- a/components/gcm_driver/gcm_driver.cc
+++ b/components/gcm_driver/gcm_driver.cc
@@ -70,6 +70,20 @@ void GCMDriver::Register(const std::string& app_id,
void GCMDriver::Unregister(const std::string& app_id,
const UnregisterCallback& callback) {
+ UnregisterInternal(app_id, nullptr /* maybe_sender_id */, callback);
+}
+
+void GCMDriver::UnregisterWithSenderId(
+ const std::string& app_id,
+ const std::string& sender_id,
+ const UnregisterCallback& callback) {
+ DCHECK(!sender_id.empty());
+ UnregisterInternal(app_id, &sender_id, callback);
+}
+
+void GCMDriver::UnregisterInternal(const std::string& app_id,
+ const std::string* maybe_sender_id,
+ const UnregisterCallback& callback) {
DCHECK(!app_id.empty());
DCHECK(!callback.is_null());
@@ -86,9 +100,10 @@ void GCMDriver::Unregister(const std::string& app_id,
return;
}
+
Peter Beverloo 2015/02/17 18:49:36 micro nit: extra blank line
johnme 2015/02/17 21:24:07 Done.
unregister_callbacks_[app_id] = callback;
- UnregisterImpl(app_id);
+ UnregisterImpl(app_id, maybe_sender_id);
}
void GCMDriver::Send(const std::string& app_id,

Powered by Google App Engine
This is Rietveld 408576698