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

Unified Diff: components/gcm_driver/fake_gcm_client.cc

Issue 1137463003: Support getting and deleting token for Instance ID. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch to land Created 5 years, 7 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 | « components/gcm_driver/fake_gcm_client.h ('k') | components/gcm_driver/fake_gcm_driver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/gcm_driver/fake_gcm_client.cc
diff --git a/components/gcm_driver/fake_gcm_client.cc b/components/gcm_driver/fake_gcm_client.cc
index 50a4598d9369e33879690cf52b28cbdaa2032b75..b74faa5bc72d42637eef210cdb0d202b6064e817 100644
--- a/components/gcm_driver/fake_gcm_client.cc
+++ b/components/gcm_driver/fake_gcm_client.cc
@@ -74,27 +74,33 @@ void FakeGCMClient::Stop() {
delegate_->OnDisconnected();
}
-void FakeGCMClient::Register(const std::string& app_id,
- const std::vector<std::string>& sender_ids) {
+void FakeGCMClient::Register(
+ const linked_ptr<RegistrationInfo>& registration_info) {
DCHECK(io_thread_->RunsTasksOnCurrentThread());
- std::string registration_id = GetRegistrationIdFromSenderIds(sender_ids);
+ GCMRegistrationInfo* gcm_registration_info =
+ GCMRegistrationInfo::FromRegistrationInfo(registration_info.get());
+ DCHECK(gcm_registration_info);
+
+ std::string registration_id = GetRegistrationIdFromSenderIds(
+ gcm_registration_info->sender_ids);
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&FakeGCMClient::RegisterFinished,
weak_ptr_factory_.GetWeakPtr(),
- app_id,
+ registration_info,
registration_id));
}
-void FakeGCMClient::Unregister(const std::string& app_id) {
+void FakeGCMClient::Unregister(
+ const linked_ptr<RegistrationInfo>& registration_info) {
DCHECK(io_thread_->RunsTasksOnCurrentThread());
base::MessageLoop::current()->PostTask(
FROM_HERE,
base::Bind(&FakeGCMClient::UnregisterFinished,
weak_ptr_factory_.GetWeakPtr(),
- app_id));
+ registration_info));
}
void FakeGCMClient::Send(const std::string& app_id,
@@ -138,14 +144,16 @@ void FakeGCMClient::UpdateHeartbeatTimer(scoped_ptr<base::Timer> timer) {
}
void FakeGCMClient::AddInstanceIDData(const std::string& app_id,
- const std::string& instance_id_data) {
+ const std::string& instance_id,
+ const std::string& extra_data) {
}
void FakeGCMClient::RemoveInstanceIDData(const std::string& app_id) {
}
-std::string FakeGCMClient::GetInstanceIDData(const std::string& app_id) {
- return std::string();
+void FakeGCMClient::GetInstanceIDData(const std::string& app_id,
+ std::string* instance_id,
+ std::string* extra_data) {
}
void FakeGCMClient::AddHeartbeatInterval(const std::string& scope,
@@ -211,14 +219,18 @@ void FakeGCMClient::Started() {
delegate_->OnConnected(net::IPEndPoint());
}
-void FakeGCMClient::RegisterFinished(const std::string& app_id,
- const std::string& registrion_id) {
+void FakeGCMClient::RegisterFinished(
+ const linked_ptr<RegistrationInfo>& registration_info,
+ const std::string& registrion_id) {
delegate_->OnRegisterFinished(
- app_id, registrion_id, registrion_id.empty() ? SERVER_ERROR : SUCCESS);
+ registration_info,
+ registrion_id,
+ registrion_id.empty() ? SERVER_ERROR : SUCCESS);
}
-void FakeGCMClient::UnregisterFinished(const std::string& app_id) {
- delegate_->OnUnregisterFinished(app_id, GCMClient::SUCCESS);
+void FakeGCMClient::UnregisterFinished(
+ const linked_ptr<RegistrationInfo>& registration_info) {
+ delegate_->OnUnregisterFinished(registration_info, GCMClient::SUCCESS);
}
void FakeGCMClient::SendFinished(const std::string& app_id,
« no previous file with comments | « components/gcm_driver/fake_gcm_client.h ('k') | components/gcm_driver/fake_gcm_driver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698