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

Side by Side Diff: chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.h

Issue 669163003: Handle disabling data reduction proxy for all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync to head Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_CONFIGURATOR_H_ 5 #ifndef CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_CONFIGURATOR_H_
6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_CONFIGURATOR_H_ 6 #define CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_CONFIGURATOR_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 14 matching lines...) Expand all
25 class PrefService; 25 class PrefService;
26 26
27 class DataReductionProxyChromeConfigurator 27 class DataReductionProxyChromeConfigurator
28 : public data_reduction_proxy::DataReductionProxyConfigurator { 28 : public data_reduction_proxy::DataReductionProxyConfigurator {
29 public: 29 public:
30 explicit DataReductionProxyChromeConfigurator( 30 explicit DataReductionProxyChromeConfigurator(
31 PrefService* prefs, 31 PrefService* prefs,
32 scoped_refptr<base::SequencedTaskRunner> network_task_runner); 32 scoped_refptr<base::SequencedTaskRunner> network_task_runner);
33 ~DataReductionProxyChromeConfigurator() override; 33 ~DataReductionProxyChromeConfigurator() override;
34 34
35 // Removes the data reduction proxy configuration from the proxy preference.
36 // This disables use of the data reduction proxy. This method is public to
37 // disable the proxy on incognito. Disable() should be used otherwise.
38 static void DisableInProxyConfigPref(PrefService* prefs);
39
35 void Enable(bool primary_restricted, 40 void Enable(bool primary_restricted,
36 bool fallback_restricted, 41 bool fallback_restricted,
37 const std::string& primary_origin, 42 const std::string& primary_origin,
38 const std::string& fallback_origin, 43 const std::string& fallback_origin,
39 const std::string& ssl_origin) override; 44 const std::string& ssl_origin) override;
40 void Disable() override; 45 void Disable() override;
41 46
42 // Add a host pattern to bypass. This should follow the same syntax used 47 // Add a host pattern to bypass. This should follow the same syntax used
43 // in net::ProxyBypassRules; that is, a hostname pattern, a hostname suffix 48 // in net::ProxyBypassRules; that is, a hostname pattern, a hostname suffix
44 // pattern, an IP literal, a CIDR block, or the magic string '<local>'. 49 // pattern, an IP literal, a CIDR block, or the magic string '<local>'.
45 // Bypass settings persist for the life of this object and are applied 50 // Bypass settings persist for the life of this object and are applied
46 // each time the proxy is enabled, but are not updated while it is enabled. 51 // each time the proxy is enabled, but are not updated while it is enabled.
47 void AddHostPatternToBypass(const std::string& pattern) override; 52 void AddHostPatternToBypass(const std::string& pattern) override;
48 53
49 // Add a URL pattern to bypass the proxy. The base implementation strips 54 // Add a URL pattern to bypass the proxy. The base implementation strips
50 // everything in |pattern| after the first single slash and then treats it 55 // everything in |pattern| after the first single slash and then treats it
51 // as a hostname pattern. Subclasses may implement other semantics. 56 // as a hostname pattern. Subclasses may implement other semantics.
52 void AddURLPatternToBypass(const std::string& pattern) override; 57 void AddURLPatternToBypass(const std::string& pattern) override;
53 58
54 // Updates the config for use on the IO thread. 59 // Updates the config for use on the IO thread.
55 void UpdateProxyConfigOnIO(const net::ProxyConfig& config); 60 void UpdateProxyConfigOnIO(const net::ProxyConfig& config);
56 61
57 // Returns the current data reduction proxy config, even if it is not the 62 // Returns the current data reduction proxy config, even if it is not the
58 // effective configuration used by the proxy service. 63 // effective configuration used by the proxy service.
59 const net::ProxyConfig& GetProxyConfigOnIO() const; 64 const net::ProxyConfig& GetProxyConfigOnIO() const;
60 65
61 private: 66 private:
62 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, TestBypassList); 67 FRIEND_TEST_ALL_PREFIXES(DataReductionProxyConfigTest, TestBypassList);
63 68
69 // Check whether the |proxy_rules| contain any of the data reduction proxies.
70 static bool ContainsDataReductionProxy(
71 const net::ProxyConfig::ProxyRules& proxy_rules);
72
64 PrefService* prefs_; 73 PrefService* prefs_;
65 scoped_refptr<base::SequencedTaskRunner> network_task_runner_; 74 scoped_refptr<base::SequencedTaskRunner> network_task_runner_;
66 75
67 std::vector<std::string> bypass_rules_; 76 std::vector<std::string> bypass_rules_;
68 net::ProxyConfig config_; 77 net::ProxyConfig config_;
69 78
70 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyChromeConfigurator); 79 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyChromeConfigurator);
71 }; 80 };
72 81
73 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_CONFIGURATOR _H_ 82 #endif // CHROME_BROWSER_NET_SPDYPROXY_DATA_REDUCTION_PROXY_CHROME_CONFIGURATOR _H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_configurator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698