diff options
author | mvanouwerkerk <mvanouwerkerk@chromium.org> | 2015-07-13 04:04:06 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-07-13 11:04:50 +0000 |
commit | f8633deb9da835a863a5f77bdc1c52ee701d8ae2 (patch) | |
tree | ff01f7e933c522cfd797efb19dc3c4816db995ec /components/proximity_auth | |
parent | ae428c2d3e3db2875b7c089db367d7f0caf077ac (diff) | |
download | chromium_src-f8633deb9da835a863a5f77bdc1c52ee701d8ae2.zip chromium_src-f8633deb9da835a863a5f77bdc1c52ee701d8ae2.tar.gz chromium_src-f8633deb9da835a863a5f77bdc1c52ee701d8ae2.tar.bz2 |
GCM: refactor IncomingMessaging and OutgoingMessage.
This will allow them to be used in:
chrome/common/service_messages.h
* Make them top level classes.
* Move IncomingMessage and OutgoingMessage to their own file
* Depend on this through the gcm_driver_common component
* Export them
BUG=402456
Design document: https://goo.gl/LRdGTm
Review URL: https://codereview.chromium.org/1210073006
Cr-Commit-Position: refs/heads/master@{#338494}
Diffstat (limited to 'components/proximity_auth')
3 files changed, 6 insertions, 6 deletions
diff --git a/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc b/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc index 548e9d6..7c07fc2 100644 --- a/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc +++ b/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc @@ -83,9 +83,8 @@ void CryptAuthGCMManagerImpl::RemoveObserver(Observer* observer) { void CryptAuthGCMManagerImpl::ShutdownHandler() { } -void CryptAuthGCMManagerImpl::OnMessage( - const std::string& app_id, - const gcm::GCMClient::IncomingMessage& message) { +void CryptAuthGCMManagerImpl::OnMessage(const std::string& app_id, + const gcm::IncomingMessage& message) { std::vector<std::string> fields; for (const auto& kv : message.data) { fields.push_back(std::string(kv.first) + ": " + std::string(kv.second)); diff --git a/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.h b/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.h index 84ae53b..c58fa45 100644 --- a/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.h +++ b/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.h @@ -8,6 +8,7 @@ #include "base/macros.h" #include "base/memory/weak_ptr.h" #include "base/observer_list.h" +#include "components/gcm_driver/common/gcm_messages.h" #include "components/gcm_driver/gcm_app_handler.h" #include "components/gcm_driver/gcm_client.h" #include "components/proximity_auth/cryptauth/cryptauth_gcm_manager.h" @@ -46,7 +47,7 @@ class CryptAuthGCMManagerImpl : public CryptAuthGCMManager, // GCMAppHandler: void ShutdownHandler() override; void OnMessage(const std::string& app_id, - const gcm::GCMClient::IncomingMessage& message) override; + const gcm::IncomingMessage& message) override; void OnMessagesDeleted(const std::string& app_id) override; void OnSendError(const std::string& app_id, const gcm::GCMClient::SendErrorDetails& details) override; diff --git a/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl_unittest.cc b/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl_unittest.cc index 02b35ac..9b93bca 100644 --- a/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl_unittest.cc +++ b/components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl_unittest.cc @@ -168,7 +168,7 @@ TEST_F(ProximityAuthCryptAuthGCMManagerImplTest, ConcurrentRegistrations) { TEST_F(ProximityAuthCryptAuthGCMManagerImplTest, ReenrollmentMessagesReceived) { EXPECT_CALL(*this, OnReenrollMessageProxy()).Times(2); - gcm::GCMClient::IncomingMessage message; + gcm::IncomingMessage message; message.data["registrationTickleType"] = "1"; // FORCE_ENROLLMENT message.collapse_key = kCryptAuthMessageCollapseKey; message.sender_id = kCryptAuthGCMSenderId; @@ -183,7 +183,7 @@ TEST_F(ProximityAuthCryptAuthGCMManagerImplTest, ReenrollmentMessagesReceived) { TEST_F(ProximityAuthCryptAuthGCMManagerImplTest, ResyncMessagesReceived) { EXPECT_CALL(*this, OnResyncMessageProxy()).Times(2); - gcm::GCMClient::IncomingMessage message; + gcm::IncomingMessage message; message.data["registrationTickleType"] = "3"; // DEVICES_SYNC message.collapse_key = kCryptAuthMessageCollapseKey; message.sender_id = kCryptAuthGCMSenderId; |