| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 NET_PROXY_PROXY_SERVER_H_ | 5 #ifndef NET_PROXY_PROXY_SERVER_H_ |
| 6 #define NET_PROXY_PROXY_SERVER_H_ | 6 #define NET_PROXY_PROXY_SERVER_H_ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_MACOSX) | 10 #if defined(OS_MACOSX) |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 return scheme_ == other.scheme_ && | 148 return scheme_ == other.scheme_ && |
| 149 host_port_pair_.Equals(other.host_port_pair_); | 149 host_port_pair_.Equals(other.host_port_pair_); |
| 150 } | 150 } |
| 151 | 151 |
| 152 // Comparator function so this can be placed in a std::map. | 152 // Comparator function so this can be placed in a std::map. |
| 153 bool operator<(const ProxyServer& other) const { | 153 bool operator<(const ProxyServer& other) const { |
| 154 return std::tie(scheme_, host_port_pair_) < | 154 return std::tie(scheme_, host_port_pair_) < |
| 155 std::tie(other.scheme_, other.host_port_pair_); | 155 std::tie(other.scheme_, other.host_port_pair_); |
| 156 } | 156 } |
| 157 | 157 |
| 158 // Returns the estimate of dynamically allocated memory in bytes. |
| 159 size_t EstimateMemoryUsage() const; |
| 160 |
| 158 private: | 161 private: |
| 159 // Creates a ProxyServer given a scheme, and host/port string. If parsing the | 162 // Creates a ProxyServer given a scheme, and host/port string. If parsing the |
| 160 // host/port string fails, the returned instance will be invalid. | 163 // host/port string fails, the returned instance will be invalid. |
| 161 static ProxyServer FromSchemeHostAndPort( | 164 static ProxyServer FromSchemeHostAndPort( |
| 162 Scheme scheme, | 165 Scheme scheme, |
| 163 std::string::const_iterator host_and_port_begin, | 166 std::string::const_iterator host_and_port_begin, |
| 164 std::string::const_iterator host_and_port_end); | 167 std::string::const_iterator host_and_port_end); |
| 165 | 168 |
| 166 Scheme scheme_; | 169 Scheme scheme_; |
| 167 HostPortPair host_port_pair_; | 170 HostPortPair host_port_pair_; |
| 168 }; | 171 }; |
| 169 | 172 |
| 170 typedef std::pair<HostPortPair, ProxyServer> HostPortProxyPair; | 173 typedef std::pair<HostPortPair, ProxyServer> HostPortProxyPair; |
| 171 | 174 |
| 172 } // namespace net | 175 } // namespace net |
| 173 | 176 |
| 174 #endif // NET_PROXY_PROXY_SERVER_H_ | 177 #endif // NET_PROXY_PROXY_SERVER_H_ |
| OLD | NEW |