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

Unified Diff: components/proxy_config/pref_proxy_config_tracker_impl.h

Issue 1296663003: Componentize proxy code from chrome/browser/net (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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/proxy_config/pref_proxy_config_tracker_impl.h
diff --git a/chrome/browser/net/pref_proxy_config_tracker_impl.h b/components/proxy_config/pref_proxy_config_tracker_impl.h
similarity index 89%
rename from chrome/browser/net/pref_proxy_config_tracker_impl.h
rename to components/proxy_config/pref_proxy_config_tracker_impl.h
index 1e35389959c713bc714d3401e2692ef68f835180..023d44a6b3afc397127d8d1fcbceb120bb4bffc1 100644
--- a/chrome/browser/net/pref_proxy_config_tracker_impl.h
+++ b/components/proxy_config/pref_proxy_config_tracker_impl.h
@@ -2,15 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_NET_PREF_PROXY_CONFIG_TRACKER_IMPL_H_
-#define CHROME_BROWSER_NET_PREF_PROXY_CONFIG_TRACKER_IMPL_H_
+#ifndef COMPONENTS_PROXY_CONFIG_PREF_PROXY_CONFIG_TRACKER_IMPL_H_
+#define COMPONENTS_PROXY_CONFIG_PREF_PROXY_CONFIG_TRACKER_IMPL_H_
#include "base/basictypes.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "base/prefs/pref_change_registrar.h"
-#include "chrome/browser/net/pref_proxy_config_tracker.h"
+#include "base/threading/thread_checker.h"
+#include "components/proxy_config/pref_proxy_config_tracker.h"
#include "components/proxy_config/proxy_config_dictionary.h"
#include "net/proxy/proxy_config.h"
#include "net/proxy/proxy_config_service.h"
@@ -18,6 +19,10 @@
class PrefService;
class PrefRegistrySimple;
+namespace base {
+class SingleThreadTaskRunner;
+}
+
namespace user_prefs {
class PrefRegistrySyncable;
}
@@ -27,9 +32,8 @@ class PrefRegistrySyncable;
// configuration determined by a baseline delegate ProxyConfigService on
// non-ChromeOS platforms. ChromeOS has its own implementation of overrides in
// chromeos::ProxyConfigServiceImpl.
-class ChromeProxyConfigService
- : public net::ProxyConfigService,
- public net::ProxyConfigService::Observer {
+class ChromeProxyConfigService : public net::ProxyConfigService,
droger 2015/08/17 13:51:36 This class should probably be renamed, maybe as Pr
Abhishek 2015/08/19 08:30:49 Done.
+ public net::ProxyConfigService::Observer {
public:
// Takes ownership of the passed |base_service|.
// GetLatestProxyConfig returns ConfigAvailability::CONFIG_PENDING until
@@ -73,6 +77,8 @@ class ChromeProxyConfigService
// Indicates whether the base service registration is done.
bool registered_observer_;
+ base::ThreadChecker thread_checker_;
+
DISALLOW_COPY_AND_ASSIGN(ChromeProxyConfigService);
};
@@ -81,7 +87,9 @@ class ChromeProxyConfigService
// ChromeProxyConfigService::UpdateProxyConfig to use.
class PrefProxyConfigTrackerImpl : public PrefProxyConfigTracker {
public:
- explicit PrefProxyConfigTrackerImpl(PrefService* pref_service);
+ explicit PrefProxyConfigTrackerImpl(
droger 2015/08/17 13:51:35 Nit: Remove "explicit"
Abhishek 2015/08/19 08:30:49 Done.
+ PrefService* pref_service,
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner);
droger 2015/08/17 13:51:36 Call this io_task_runner or network_task_runner.
Abhishek 2015/08/19 08:30:49 Done.
~PrefProxyConfigTrackerImpl() override;
// PrefProxyConfigTracker implementation:
@@ -159,7 +167,11 @@ class PrefProxyConfigTrackerImpl : public PrefProxyConfigTracker {
bool update_pending_; // True if config has not been pushed to network stack.
PrefChangeRegistrar proxy_prefs_;
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
droger 2015/08/17 13:51:36 Call this io_task_runner_ or network_task_runner_.
Abhishek 2015/08/19 08:30:49 Done.
+
+ base::ThreadChecker thread_checker_;
+
DISALLOW_COPY_AND_ASSIGN(PrefProxyConfigTrackerImpl);
};
-#endif // CHROME_BROWSER_NET_PREF_PROXY_CONFIG_TRACKER_IMPL_H_
+#endif // COMPONENTS_PROXY_CONFIG_PREF_PROXY_CONFIG_TRACKER_IMPL_H_

Powered by Google App Engine
This is Rietveld 408576698