Chromium Code Reviews| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_mutable_config_values.h |
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_mutable_config_values.h b/components/data_reduction_proxy/core/browser/data_reduction_proxy_mutable_config_values.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..de65b600b53aeb08806f52d93393feed02e90239 |
| --- /dev/null |
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_mutable_config_values.h |
| @@ -0,0 +1,79 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_MUTABLE_CONFIG_VALUES_H_ |
| +#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_MUTABLE_CONFIG_VALUES_H_ |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/ref_counted.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "components/data_reduction_proxy/core/common/data_reduction_proxy_config_values.h" |
| +#include "net/proxy/proxy_server.h" |
| +#include "url/gurl.h" |
| + |
| +namespace base { |
| +class SingleThreadTaskRunner; |
| +} |
| + |
| +namespace data_reduction_proxy { |
| + |
| +class DataReductionProxyParams; |
| + |
| +class DataReductionProxyMutableConfigValues |
|
bengr
2015/03/24 21:37:41
Add a class-level comment.
jeremyim
2015/03/24 23:20:28
Done.
|
| + : public DataReductionProxyConfigValues { |
| + public: |
| + // Creates a new |DataReductionProxyMutableConfigValues| using |params| as |
| + // the basis for its initial values. |
| + static scoped_ptr<DataReductionProxyMutableConfigValues> CreateFromParams( |
| + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner, |
| + DataReductionProxyParams* params); |
|
sclittle
2015/03/24 21:34:55
Could this be const DataReductionProxyParams*?
bengr
2015/03/24 21:37:42
Can this be a const& ?
jeremyim
2015/03/24 23:20:28
Done.
|
| + |
| + ~DataReductionProxyMutableConfigValues() override; |
| + |
| + // Updates |origin_| and |fallback_origin_| with the provided values. |
| + // Virtual for testing. |
| + virtual void UpdateValues(const net::ProxyServer& origin, |
| + const net::ProxyServer& fallback_origin); |
| + |
| + // Overrides of |DataReductionProxyConfigValues| |
| + bool promo_allowed() const override; |
| + bool holdback() const override; |
| + bool allowed() const override; |
| + bool fallback_allowed() const override; |
|
bengr
2015/03/24 21:37:41
The DRPParams code made the assumption that there
jeremyim
2015/03/24 23:20:28
Acknowledged.
|
| + bool alternative_allowed() const override; |
| + bool alternative_fallback_allowed() const override; |
| + bool UsingHTTPTunnel(const net::HostPortPair& proxy_server) const override; |
| + bool IsDataReductionProxy( |
| + const net::HostPortPair& host_port_pair, |
| + DataReductionProxyTypeInfo* proxy_info) const override; |
| + const net::ProxyServer& origin() const override; |
| + const net::ProxyServer& fallback_origin() const override; |
|
bengr
2015/03/24 21:37:41
What's the case for exposing all of these values?
jeremyim
2015/03/24 23:20:28
Acknowledged.
|
| + const net::ProxyServer& alt_origin() const override; |
| + const net::ProxyServer& alt_fallback_origin() const override; |
| + const net::ProxyServer& ssl_origin() const override; |
| + const GURL& secure_proxy_check_url() const override; |
| + |
| + protected: |
| + DataReductionProxyMutableConfigValues( |
| + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner); |
| + |
| + private: |
| + net::ProxyServer empty_origin_; |
| + bool promo_allowed_; |
| + bool holdback_; |
| + bool allowed_; |
| + bool fallback_allowed_; |
| + net::ProxyServer origin_; |
| + net::ProxyServer fallback_origin_; |
| + GURL secure_proxy_check_url_; |
| + |
| + // |io_task_runner_| should be the task runner for running operations on the |
| + // IO thread. |
| + scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(DataReductionProxyMutableConfigValues); |
| +}; |
| + |
| +} // namespace data_reduction_proxy |
| +#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_BROWSER_DATA_REDUCTION_PROXY_MUTABLE_CONFIG_VALUES_H_ |