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

Unified Diff: components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.cc

Issue 1144153004: components: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 5 years, 7 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/instance_id/fake_gcm_driver_for_instance_id.cc
diff --git a/components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.cc b/components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.cc
index 6b09da0c43614183d858cf186a43c57d48acd22d..b52c37d3a6a3b4666a397a02ca334935e134bbb4 100644
--- a/components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.cc
+++ b/components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.cc
@@ -5,9 +5,11 @@
#include "components/gcm_driver/instance_id/fake_gcm_driver_for_instance_id.h"
#include "base/bind.h"
-#include "base/message_loop/message_loop.h"
+#include "base/location.h"
#include "base/rand_util.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
+#include "base/thread_task_runner_handle.h"
#include "components/gcm_driver/gcm_client.h"
namespace instance_id {
@@ -44,9 +46,8 @@ void FakeGCMDriverForInstanceID::GetInstanceIDData(
instance_id = iter->second.first;
extra_data = iter->second.second;
}
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(callback, instance_id, extra_data));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, instance_id, extra_data));
}
void FakeGCMDriverForInstanceID::GetToken(
@@ -65,9 +66,8 @@ void FakeGCMDriverForInstanceID::GetToken(
tokens_[key] = token;
}
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(callback, token, gcm::GCMClient::SUCCESS));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, token, gcm::GCMClient::SUCCESS));
}
void FakeGCMDriverForInstanceID::DeleteToken(
@@ -77,9 +77,8 @@ void FakeGCMDriverForInstanceID::DeleteToken(
const DeleteTokenCallback& callback) {
std::string key = app_id + authorized_entity + scope;
tokens_.erase(key);
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(callback, gcm::GCMClient::SUCCESS));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, gcm::GCMClient::SUCCESS));
}
} // namespace instance_id
« no previous file with comments | « components/gcm_driver/gcm_driver_desktop_unittest.cc ('k') | components/google/core/browser/google_url_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698