Chromium Code Reviews| Index: components/gcm_driver/gcm_driver_desktop.cc |
| diff --git a/components/gcm_driver/gcm_driver_desktop.cc b/components/gcm_driver/gcm_driver_desktop.cc |
| index b2d2e558c32c207b63bbd799f9d1fa1a4eb0d680..06736e6ad60b50db12654dadedb3574bd5960c66 100644 |
| --- a/components/gcm_driver/gcm_driver_desktop.cc |
| +++ b/components/gcm_driver/gcm_driver_desktop.cc |
| @@ -13,6 +13,7 @@ |
| #include "base/logging.h" |
| #include "base/sequenced_task_runner.h" |
| #include "base/threading/sequenced_worker_pool.h" |
| +#include "components/gcm_driver/gcm_account_mapper.h" |
| #include "components/gcm_driver/gcm_app_handler.h" |
| #include "components/gcm_driver/gcm_channel_status_syncer.h" |
| #include "components/gcm_driver/gcm_client_factory.h" |
| @@ -614,15 +615,22 @@ void GCMDriverDesktop::RemoveAccountMapping(const std::string& account_id) { |
| account_id)); |
| } |
| -void GCMDriverDesktop::SetAccountsForCheckin( |
| - const std::map<std::string, std::string>& account_tokens) { |
| +void GCMDriverDesktop::SetAccountTokens( |
| + const std::vector<GCMClient::AccountTokenInfo>& account_tokens) { |
| DCHECK(ui_thread_->RunsTasksOnCurrentThread()); |
| + std::map<std::string, std::string> account_token_map; |
|
jianli
2014/09/25 20:26:45
I think we should also pass std::vector to IO thre
fgorski
2014/09/26 22:51:42
Done.
|
| + for (std::vector<GCMClient::AccountTokenInfo>::const_iterator iter = |
| + account_tokens.begin(); |
| + iter != account_tokens.end(); |
| + ++iter) { |
| + account_token_map[iter->email] = iter->access_token; |
| + } |
| io_thread_->PostTask( |
| FROM_HERE, |
| base::Bind(&GCMDriverDesktop::IOWorker::SetAccountsForCheckin, |
| base::Unretained(io_worker_.get()), |
| - account_tokens)); |
| + account_token_map)); |
| } |
| GCMClient::Result GCMDriverDesktop::EnsureStarted() { |