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

Unified Diff: components/gcm_driver/gcm_driver_desktop.cc

Issue 378643002: [GCM] Check-in with signed in accounts associates device to user (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update to the code to prevent test crashes. Created 6 years, 5 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/gcm_driver_desktop.h ('k') | google_apis/gcm/engine/checkin_request.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 61f9cb122998ac50b7756d9f74e4d22085bec9ab..fa7c3c8ef21680091b304f391bf32f9feba1ba33 100644
--- a/components/gcm_driver/gcm_driver_desktop.cc
+++ b/components/gcm_driver/gcm_driver_desktop.cc
@@ -132,6 +132,9 @@ class GCMDriverDesktop::IOWorker : public GCMClient::Delegate {
void GetGCMStatistics(bool clear_logs);
void SetGCMRecording(bool recording);
+ void SetAccountsForCheckin(
+ const std::map<std::string, std::string>& account_tokens);
+
// For testing purpose. Can be called from UI thread. Use with care.
GCMClient* gcm_client_for_testing() const { return gcm_client_.get(); }
@@ -345,6 +348,14 @@ void GCMDriverDesktop::IOWorker::SetGCMRecording(bool recording) {
base::Bind(&GCMDriverDesktop::GetGCMStatisticsFinished, service_, stats));
}
+void GCMDriverDesktop::IOWorker::SetAccountsForCheckin(
+ const std::map<std::string, std::string>& account_tokens) {
+ DCHECK(io_thread_->RunsTasksOnCurrentThread());
+
+ if (gcm_client_.get())
+ gcm_client_->SetAccountsForCheckin(account_tokens);
+}
+
GCMDriverDesktop::GCMDriverDesktop(
scoped_ptr<GCMClientFactory> gcm_client_factory,
const GCMClient::ChromeBuildInfo& chrome_build_info,
@@ -581,6 +592,17 @@ void GCMDriverDesktop::SetGCMRecording(const GetGCMStatisticsCallback& callback,
recording));
}
+void GCMDriverDesktop::SetAccountsForCheckin(
+ const std::map<std::string, std::string>& account_tokens) {
+ DCHECK(ui_thread_->RunsTasksOnCurrentThread());
+
+ io_thread_->PostTask(
+ FROM_HERE,
+ base::Bind(&GCMDriverDesktop::IOWorker::SetAccountsForCheckin,
+ base::Unretained(io_worker_.get()),
+ account_tokens));
+}
+
GCMClient::Result GCMDriverDesktop::EnsureStarted() {
DCHECK(ui_thread_->RunsTasksOnCurrentThread());
« no previous file with comments | « components/gcm_driver/gcm_driver_desktop.h ('k') | google_apis/gcm/engine/checkin_request.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698