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

Unified Diff: components/gcm_driver/gcm_driver_desktop.cc

Issue 594383003: [GCM] Passing GCMClient::AccountTokenInfo list to GCMDriver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@account-mapper
Patch Set: Rebased Created 6 years, 3 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_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() {
« components/gcm_driver/gcm_driver_android.cc ('K') | « components/gcm_driver/gcm_driver_desktop.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698