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

Unified Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.h

Issue 449973002: Use data reduction proxy when managed proxy config returns direct (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@no-uma-in-proxy-service
Patch Set: Remove copy from ProxyConfig access Created 6 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: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.h
diff --git a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.h b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.h
index 8efc3edd4ea7221091995f922acca32b3da01fff..03face22d55faebc5921e577e8b8988174953938 100644
--- a/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.h
+++ b/chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.h
@@ -9,14 +9,27 @@
#include <vector>
#include "base/gtest_prod_util.h"
+#include "base/task_runner.h"
#include "components/data_reduction_proxy/browser/data_reduction_proxy_configurator.h"
+#include "net/proxy/proxy_config.h"
+
+namespace base {
+class SequencedTaskRunner;
+}
+
+namespace net {
+class ProxyInfo;
+class ProxyService;
+}
class PrefService;
class DataReductionProxyChromeConfigurator
: public data_reduction_proxy::DataReductionProxyConfigurator {
public:
- explicit DataReductionProxyChromeConfigurator(PrefService* prefs);
+ explicit DataReductionProxyChromeConfigurator(
+ PrefService* prefs,
+ scoped_refptr<base::SequencedTaskRunner> network_task_runner);
virtual ~DataReductionProxyChromeConfigurator();
virtual void Enable(bool primary_restricted,
@@ -38,11 +51,23 @@ class DataReductionProxyChromeConfigurator
// as a hostname pattern. Subclasses may implement other semantics.
virtual void AddURLPatternToBypass(const std::string& pattern) OVERRIDE;
+ // Updates the config for use on the IO thread.
+ void UpdateProxyConfigOnIO(const net::ProxyConfig& config);
+
+ // Returns the current data reduction proxy config, even if it is not the
+ // effective configuration used by the proxy service. Note the ID of the
mef 2014/08/12 17:56:35 I think this comment is wrong (starting with "Note
bengr 2014/08/12 20:09:39 I think it is correct. ProxyConfig::ProxyConfig()
bengr 2014/08/13 01:31:27 Done.
+ // proxy config is set to a bogus value. It cannot be left uninitialized,
+ // else the config will return invalid.
+ const net::ProxyConfig& GetProxyConfigOnIO() const;
+
private:
FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, TestBypassList);
PrefService* prefs_;
+ scoped_refptr<base::SequencedTaskRunner> network_task_runner_;
+
std::vector<std::string> bypass_rules_;
+ net::ProxyConfig config_;
DISALLOW_COPY_AND_ASSIGN(DataReductionProxyChromeConfigurator);
};

Powered by Google App Engine
This is Rietveld 408576698