summaryrefslogtreecommitdiffstats
path: root/net/proxy/proxy_config_service_linux.h
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-24 08:26:46 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-24 08:26:46 +0000
commit7672247cf3de10b55378d0591bdd5970c17a7f31 (patch)
treeca71a66222a57afc352e44bb0cde5ba274137064 /net/proxy/proxy_config_service_linux.h
parentdf6f2e1db4e6478dc62b5aa11f33e845734e6717 (diff)
downloadchromium_src-7672247cf3de10b55378d0591bdd5970c17a7f31.zip
chromium_src-7672247cf3de10b55378d0591bdd5970c17a7f31.tar.gz
chromium_src-7672247cf3de10b55378d0591bdd5970c17a7f31.tar.bz2
Use SingleThreadTaskRunner instead of MessageLoopProxy in ProxyConfigService.
MessageLoopProxy is not usable in plugin, and so it's not possible to use ProxyConfigService in plugins if it uses MessageLoopProxy. Review URL: https://chromiumcodereview.appspot.com/10414061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138751 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy/proxy_config_service_linux.h')
-rw-r--r--net/proxy/proxy_config_service_linux.h34
1 files changed, 18 insertions, 16 deletions
diff --git a/net/proxy/proxy_config_service_linux.h b/net/proxy/proxy_config_service_linux.h
index ffaa988..ed8cef1 100644
--- a/net/proxy/proxy_config_service_linux.h
+++ b/net/proxy/proxy_config_service_linux.h
@@ -23,7 +23,7 @@
class MessageLoopForIO;
namespace base {
-class MessageLoopProxy;
+class SingleThreadTaskRunner;
} // namespace base
namespace net {
@@ -49,10 +49,10 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService {
// one, in the concrete implementations. Returns true on success. Must be
// called before using other methods, and should be called on the thread
// running the glib main loop.
- // One of |glib_default_loop| and |file_loop| will be used for
+ // One of |glib_thread_task_runner| and |file_loop| will be used for
// gconf/gsettings calls or reading necessary files, depending on the
// implementation.
- virtual bool Init(base::MessageLoopProxy* glib_default_loop,
+ virtual bool Init(base::SingleThreadTaskRunner* glib_thread_task_runner,
MessageLoopForIO* file_loop) = 0;
// Releases the gconf/gsettings client, which clears cached directories and
@@ -66,7 +66,7 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService {
// Returns the message loop for the thread on which this object
// handles notifications, and also on which it must be destroyed.
// Returns NULL if it does not matter.
- virtual base::MessageLoopProxy* GetNotificationLoop() = 0;
+ virtual base::SingleThreadTaskRunner* GetNotificationTaskRunner() = 0;
// Returns the data source's name (e.g. "gconf", "gsettings", "KDE",
// "test"). Used only for diagnostic purposes (e.g. VLOG(1) etc.).
@@ -182,9 +182,10 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService {
// thread is specified so that notifications can post tasks to it
// (and for assertions). The message loop for the file thread is
// used to read any files needed to determine proxy settings.
- void SetUpAndFetchInitialConfig(base::MessageLoopProxy* glib_default_loop,
- base::MessageLoopProxy* io_loop,
- MessageLoopForIO* file_loop);
+ void SetUpAndFetchInitialConfig(
+ base::SingleThreadTaskRunner* glib_thread_task_runner,
+ base::SingleThreadTaskRunner* io_thread_task_runner,
+ MessageLoopForIO* file_loop);
// Handler for setting change notifications: fetches a new proxy
// configuration from settings, and if this config is different
@@ -252,7 +253,7 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService {
// notification but the config has not actually changed.
ProxyConfig reference_config_;
- // The MessageLoop for the UI thread, aka main browser thread. This thread
+ // The task runner for the glib thread, aka main browser thread. This thread
// is where we run the glib main loop (see base/message_pump_glib.h). It is
// the glib default loop in the sense that it runs the glib default context:
// as in the context where sources are added by g_timeout_add and
@@ -260,10 +261,10 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService {
// timeouts and idles and possibly other callbacks that will all be
// dispatched on this thread. Since gconf is not thread safe, any use of
// gconf must be done on the thread running this loop.
- scoped_refptr<base::MessageLoopProxy> glib_default_loop_;
- // MessageLoop for the IO thread. GetLatestProxyConfig() is called from
+ scoped_refptr<base::SingleThreadTaskRunner> glib_thread_task_runner_;
+ // Task runner for the IO thread. GetLatestProxyConfig() is called from
// the thread running this loop.
- scoped_refptr<base::MessageLoopProxy> io_loop_;
+ scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_;
ObserverList<Observer> observers_;
@@ -281,11 +282,12 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService {
virtual ~ProxyConfigServiceLinux();
- void SetupAndFetchInitialConfig(base::MessageLoopProxy* glib_default_loop,
- base::MessageLoopProxy* io_loop,
- MessageLoopForIO* file_loop) {
- delegate_->SetUpAndFetchInitialConfig(glib_default_loop, io_loop,
- file_loop);
+ void SetupAndFetchInitialConfig(
+ base::SingleThreadTaskRunner* glib_thread_task_runner,
+ base::SingleThreadTaskRunner* io_thread_task_runner,
+ MessageLoopForIO* file_loop) {
+ delegate_->SetUpAndFetchInitialConfig(glib_thread_task_runner,
+ io_thread_task_runner, file_loop);
}
void OnCheckProxyConfigSettings() {
delegate_->OnCheckProxyConfigSettings();