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

Side by Side Diff: components/data_reduction_proxy/browser/data_reduction_proxy_configurator.h

Issue 286013002: Added alternative configuration for the data reduction proxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK fix Created 6 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 unified diff | Download patch
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 COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_CONFIGURATO R_H_ 5 #ifndef COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_CONFIGURATO R_H_
6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_CONFIGURATO R_H_ 6 #define COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_CONFIGURATO R_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 11
12 namespace data_reduction_proxy { 12 namespace data_reduction_proxy {
13 13
14 // Interface for enabling and disabling the data reduction proxy configuration, 14 // Interface for enabling and disabling the data reduction proxy configuration,
15 // and for adding bypass rules. This is the interface that is used to set the 15 // and for adding bypass rules. This is the interface that is used to set the
16 // networking configuration that causes traffic to be proxied. 16 // networking configuration that causes traffic to be proxied.
17 class DataReductionProxyConfigurator { 17 class DataReductionProxyConfigurator {
18 public: 18 public:
19 DataReductionProxyConfigurator() {} 19 DataReductionProxyConfigurator() {}
20 virtual ~DataReductionProxyConfigurator() {} 20 virtual ~DataReductionProxyConfigurator() {}
21 21
22 // Enable the data reduction proxy. If |primary_restricted|, the 22 // Enable the data reduction proxy. If |primary_restricted|, the
23 // |primary_origin| may not be used. If |fallback_restricted|, the 23 // |primary_origin| may not be used. If |fallback_restricted|, the
24 // |fallback_origin| may not be used. If both are restricted, then the 24 // |fallback_origin| may not be used. If both are restricted, then the
25 // proxy configuration will be the same as when |Disable()| is called. 25 // proxy configuration will be the same as when |Disable()| is called.
26 // If |ssl_origin| is non-empty, it will be used used for HTTPS traffic.
26 virtual void Enable(bool primary_restricted, 27 virtual void Enable(bool primary_restricted,
27 bool fallback_restricted, 28 bool fallback_restricted,
28 const std::string& primary_origin, 29 const std::string& primary_origin,
29 const std::string& fallback_origin) = 0; 30 const std::string& fallback_origin,
31 const std::string& ssl_origin) = 0;
30 32
31 // Disable the data reduction proxy. 33 // Disable the data reduction proxy.
32 virtual void Disable() = 0; 34 virtual void Disable() = 0;
33 35
34 // Adds a host pattern to bypass. This should follow the same syntax used 36 // Adds a host pattern to bypass. This should follow the same syntax used
35 // in net::ProxyBypassRules; that is, a hostname pattern, a hostname suffix 37 // in net::ProxyBypassRules; that is, a hostname pattern, a hostname suffix
36 // pattern, an IP literal, a CIDR block, or the magic string '<local>'. 38 // pattern, an IP literal, a CIDR block, or the magic string '<local>'.
37 // Bypass settings persist for the life of this object and are applied 39 // Bypass settings persist for the life of this object and are applied
38 // each time the proxy is enabled, but are not updated while it is enabled. 40 // each time the proxy is enabled, but are not updated while it is enabled.
39 virtual void AddHostPatternToBypass(const std::string& pattern) = 0; 41 virtual void AddHostPatternToBypass(const std::string& pattern) = 0;
40 42
41 // Adds a URL pattern to bypass the proxy. The base implementation strips 43 // Adds a URL pattern to bypass the proxy. The base implementation strips
42 // everything in |pattern| after the first single slash and then treats it 44 // everything in |pattern| after the first single slash and then treats it
43 // as a hostname pattern. 45 // as a hostname pattern.
44 virtual void AddURLPatternToBypass(const std::string& pattern) = 0; 46 virtual void AddURLPatternToBypass(const std::string& pattern) = 0;
45 47
46 private: 48 private:
47 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyConfigurator); 49 DISALLOW_COPY_AND_ASSIGN(DataReductionProxyConfigurator);
48 }; 50 };
49 51
50 } // namespace data_reduction_proxy 52 } // namespace data_reduction_proxy
51 53
52 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_CONFIGUR ATOR_H_ 54 #endif // COMPONENTS_DATA_REDUCTION_PROXY_BROWSER_DATA_REDUCTION_PROXY_CONFIGUR ATOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698