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()); |