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

Unified Diff: net/proxy/proxy_config_service_linux.h

Issue 2944313003: Remove the dependence on BrowserThread::FILE for (Closed)
Patch Set: weeee Created 3 years, 6 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: net/proxy/proxy_config_service_linux.h
diff --git a/net/proxy/proxy_config_service_linux.h b/net/proxy/proxy_config_service_linux.h
index 4832c20da31f87a4a6ccb45adbd273eec3910178..572cdd877642bc6a1433082f8e0316204814c063 100644
--- a/net/proxy/proxy_config_service_linux.h
+++ b/net/proxy/proxy_config_service_linux.h
@@ -23,6 +23,7 @@
namespace base {
class SingleThreadTaskRunner;
+class SequencedTaskRunner;
} // namespace base
namespace net {
@@ -46,13 +47,11 @@ 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_task_runner| and |file_task_runner| will be
- // used for gconf/gsettings calls or reading necessary files, depending on
- // the implementation.
- virtual bool Init(
- const scoped_refptr<base::SingleThreadTaskRunner>& glib_task_runner,
- const scoped_refptr<base::SingleThreadTaskRunner>&
- file_task_runner) = 0;
+ // Either |glib_task_runner| or an internal sequenced task runner will
+ // be used for gconf/gsettings calls or reading necessary files,
+ // depending on the implementation.
mmenke 2017/06/22 18:07:06 Could we make it clearer that we're not performing
eroman 2017/06/22 19:50:47 Done. How about this: 50 // This interface s
mmenke 2017/06/22 19:52:10 SGTM
+ virtual bool Init(const scoped_refptr<base::SingleThreadTaskRunner>&
+ glib_task_runner) = 0;
// Releases the gconf/gsettings client, which clears cached directories and
// stops notifications.
@@ -65,8 +64,8 @@ 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 const scoped_refptr<base::SingleThreadTaskRunner>&
- GetNotificationTaskRunner() = 0;
+ virtual const scoped_refptr<base::SequencedTaskRunner>&
+ GetNotificationTaskRunner() = 0;
// Returns the source of proxy settings.
virtual ProxyConfigSource GetConfigSource() = 0;
@@ -150,9 +149,9 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService {
// RemoveObserver) from the IO thread.
//
// Setting change notification callbacks can occur at any time and are
- // run on either the UI thread (gconf/gsettings) or the file thread
- // (KDE). The new settings are fetched on that thread, and the resulting
- // proxy config is posted to the IO thread through
+ // run on either the UI thread (gconf/gsettings) or the sequenced task
+ // runner (KDE). The new settings are fetched on that thread, and the
+ // resulting proxy config is posted to the IO thread through
// Delegate::SetNewProxyConfig(). We then notify observers on the IO
// thread of the configuration change.
//
@@ -161,8 +160,9 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService {
// The substance of the ProxyConfigServiceLinux implementation is
// wrapped in the Delegate ref counted class. On deleting the
// ProxyConfigServiceLinux, Delegate::OnDestroy() is posted to either
- // the UI thread (gconf/gsettings) or the file thread (KDE) where change
- // notifications will be safely stopped before releasing Delegate.
+ // the UI thread (gconf/gsettings) or a sequenced task runner (KDE)
+ // where change notifications will be safely stopped before releasing
+ // Delegate.
class Delegate : public base::RefCountedThreadSafe<Delegate> {
public:
@@ -179,12 +179,10 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService {
// thread running the default glib main loop, and so this method
// must be called from the UI thread. The message loop for the IO
// 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.
+ // (and for assertions).
void SetUpAndFetchInitialConfig(
const scoped_refptr<base::SingleThreadTaskRunner>& glib_task_runner,
- const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
- const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner);
+ const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner);
// Handler for setting change notifications: fetches a new proxy
// configuration from settings, and if this config is different
@@ -199,11 +197,12 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService {
ProxyConfigService::ConfigAvailability GetLatestProxyConfig(
ProxyConfig* config);
- // Posts a call to OnDestroy() to the UI or FILE thread, depending on the
- // setting getter in use. Called from ProxyConfigServiceLinux's destructor.
+ // Posts a call to OnDestroy() to the UI or sequenced task runner,
+ // depending on the setting getter in use. Called from
+ // ProxyConfigServiceLinux's destructor.
void PostDestroyTask();
- // Safely stops change notifications. Posted to either the UI or FILE
- // thread, depending on the setting getter in use.
+ // Safely stops change notifications. Posted to either the UI or
+ // sequenced task runner, depending on the setting getter in use.
void OnDestroy();
private:
@@ -287,11 +286,8 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService {
void SetupAndFetchInitialConfig(
const scoped_refptr<base::SingleThreadTaskRunner>& glib_task_runner,
- const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
- const scoped_refptr<base::SingleThreadTaskRunner>& file_task_runner) {
- delegate_->SetUpAndFetchInitialConfig(glib_task_runner,
- io_task_runner,
- file_task_runner);
+ const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner) {
+ delegate_->SetUpAndFetchInitialConfig(glib_task_runner, io_task_runner);
}
void OnCheckProxyConfigSettings() {
delegate_->OnCheckProxyConfigSettings();

Powered by Google App Engine
This is Rietveld 408576698