| 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 ffa77d11db63188d38d4270d68306023faad89e2..02414bda1690400e802d3c686d94c38b347ff89c 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,
|
| @@ -204,14 +210,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,
|
|
|