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

Unified Diff: components/data_reduction_proxy/core/common/data_reduction_proxy_server.cc

Issue 2575323002: Store data reduction proxy server in a separate class (Closed)
Patch Set: ryansturm comments Created 4 years 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/data_reduction_proxy/core/common/data_reduction_proxy_server.cc
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_server.cc b/components/data_reduction_proxy/core/common/data_reduction_proxy_server.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bddd81d41ac18ed2f7f257869369ffd3325e1883
--- /dev/null
+++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_server.cc
@@ -0,0 +1,34 @@
+// Copyright 2016 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.
+
+#include "components/data_reduction_proxy/core/common/data_reduction_proxy_server.h"
+
+namespace data_reduction_proxy {
+
+DataReductionProxyServer::DataReductionProxyServer(
+ const net::ProxyServer& proxy_server,
+ ProxyServer_ProxyType proxy_type)
+ : proxy_server_(proxy_server), proxy_type_(proxy_type) {}
+
+bool DataReductionProxyServer::operator==(
+ const DataReductionProxyServer& other) const {
+ return proxy_server_ == other.proxy_server_ &&
+ proxy_type_ == other.proxy_type_;
+}
+
+// static
+std::vector<net::ProxyServer>
+DataReductionProxyServer::ConvertToNetProxyServers(
+ const std::vector<DataReductionProxyServer>& data_reduction_proxy_servers) {
+ std::vector<net::ProxyServer> net_proxy_servers;
+ for (auto data_reduction_proxy_server : data_reduction_proxy_servers)
+ net_proxy_servers.push_back(data_reduction_proxy_server.proxy_server());
+ return net_proxy_servers;
+}
+
+ProxyServer_ProxyType DataReductionProxyServer::GetProxyTypeForTesting() const {
+ return proxy_type_;
+}
+
+} // namespace data_reduction_proxy

Powered by Google App Engine
This is Rietveld 408576698