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

Unified Diff: net/proxy/proxy_config_service_linux_unittest.cc

Issue 540593002: Use scoped_refptr<SingleThreadTaskRunner> when initializing ProxyConfigService (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « net/proxy/proxy_config_service_linux.cc ('k') | net/proxy/proxy_config_service_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/proxy/proxy_config_service_linux_unittest.cc
diff --git a/net/proxy/proxy_config_service_linux_unittest.cc b/net/proxy/proxy_config_service_linux_unittest.cc
index 5635a87d053e3ff1039dcca3ee3961c94aabb205..6b70b1b0f5940b4f539b4aa21b0970e22410fd28 100644
--- a/net/proxy/proxy_config_service_linux_unittest.cc
+++ b/net/proxy/proxy_config_service_linux_unittest.cc
@@ -175,8 +175,11 @@ class MockSettingGetter
values = zero_values;
}
- virtual bool Init(base::SingleThreadTaskRunner* glib_thread_task_runner,
- base::MessageLoopForIO* file_loop) OVERRIDE {
+ virtual bool Init(
+ const scoped_refptr<base::SingleThreadTaskRunner>& glib_task_runner,
+ const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner)
+ OVERRIDE {
+ task_runner_ = glib_task_runner;
return true;
}
@@ -187,8 +190,9 @@ class MockSettingGetter
return true;
}
- virtual base::SingleThreadTaskRunner* GetNotificationTaskRunner() OVERRIDE {
- return NULL;
+ virtual const scoped_refptr<base::SingleThreadTaskRunner>&
+ GetNotificationTaskRunner() OVERRIDE {
+ return task_runner_;
}
virtual ProxyConfigSource GetConfigSource() OVERRIDE {
@@ -243,6 +247,7 @@ class MockSettingGetter
GConfValues values;
private:
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
SettingsTable<StringSetting, const char*> strings_table;
SettingsTable<BoolSetting, BoolSettingValue> bools_table;
SettingsTable<IntSetting, int> ints_table;
@@ -288,13 +293,11 @@ class SynchConfigGetter {
// all on the calling thread (meant to be the thread with the
// default glib main loop, which is the UI thread).
void SetupAndInitialFetch() {
- base::MessageLoop* file_loop = io_thread_.message_loop();
- DCHECK_EQ(base::MessageLoop::TYPE_IO, file_loop->type());
// We pass the mock IO thread as both the IO and file threads.
config_service_->SetupAndFetchInitialConfig(
- base::MessageLoopProxy::current().get(),
- io_thread_.message_loop_proxy().get(),
- static_cast<base::MessageLoopForIO*>(file_loop));
+ base::MessageLoopProxy::current(),
+ io_thread_.message_loop_proxy(),
+ io_thread_.message_loop_proxy());
}
// Synchronously gets the proxy config.
net::ProxyConfigService::ConfigAvailability SyncGetLatestProxyConfig(
« no previous file with comments | « net/proxy/proxy_config_service_linux.cc ('k') | net/proxy/proxy_config_service_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698