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

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

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.h
diff --git a/components/data_reduction_proxy/core/common/data_reduction_proxy_server.h b/components/data_reduction_proxy/core/common/data_reduction_proxy_server.h
new file mode 100644
index 0000000000000000000000000000000000000000..4f6626fa6e8fe7d2ddda50400c22164b7a010ec5
--- /dev/null
+++ b/components/data_reduction_proxy/core/common/data_reduction_proxy_server.h
@@ -0,0 +1,44 @@
+// 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.
+
+#ifndef COMPONENTS_DATA_REDUCTION_PROXY_CORE_COMMON_DATA_REDUCTION_PROXY_SERVER_H_
+#define COMPONENTS_DATA_REDUCTION_PROXY_CORE_COMMON_DATA_REDUCTION_PROXY_SERVER_H_
+
+#include <vector>
+
+#include "components/data_reduction_proxy/proto/client_config.pb.h"
+#include "net/proxy/proxy_server.h"
+
+namespace data_reduction_proxy {
+
+// A class that stores information about a single data reduction proxy server.
+class DataReductionProxyServer {
+ public:
+ DataReductionProxyServer(const net::ProxyServer& proxy_server,
+ ProxyServer_ProxyType proxy_type);
+
+ DataReductionProxyServer(const DataReductionProxyServer& other) = default;
+
+ DataReductionProxyServer& operator=(const DataReductionProxyServer& other) =
+ default;
+
+ bool operator==(const DataReductionProxyServer& other) const;
+
+ net::ProxyServer proxy_server() const { return proxy_server_; }
+
+ static std::vector<net::ProxyServer> ConvertToNetProxyServers(
+ const std::vector<DataReductionProxyServer>&
+ data_reduction_proxy_servers);
+
+ // Returns |proxy_type_| for verification by tests.
+ ProxyServer_ProxyType GetProxyTypeForTesting() const;
+
+ private:
+ net::ProxyServer proxy_server_;
+ ProxyServer_ProxyType proxy_type_;
+};
+
+} // namespace data_reduction_proxy
+
+#endif // COMPONENTS_DATA_REDUCTION_PROXY_CORE_COMMON_DATA_REDUCTION_PROXY_SERVER_H_

Powered by Google App Engine
This is Rietveld 408576698