OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_HTTP_HTTP_SERVER_PROPERTIES_H_ | 5 #ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION + 1, | 79 ALTERNATE_PROTOCOL_MINIMUM_VALID_VERSION + 1, |
80 }; | 80 }; |
81 | 81 |
82 NET_EXPORT const char* AlternateProtocolToString(AlternateProtocol protocol); | 82 NET_EXPORT const char* AlternateProtocolToString(AlternateProtocol protocol); |
83 NET_EXPORT AlternateProtocol AlternateProtocolFromString( | 83 NET_EXPORT AlternateProtocol AlternateProtocolFromString( |
84 const std::string& str); | 84 const std::string& str); |
85 NET_EXPORT_PRIVATE AlternateProtocol AlternateProtocolFromNextProto( | 85 NET_EXPORT_PRIVATE AlternateProtocol AlternateProtocolFromNextProto( |
86 NextProto next_proto); | 86 NextProto next_proto); |
87 | 87 |
88 struct NET_EXPORT AlternateProtocolInfo { | 88 struct NET_EXPORT AlternateProtocolInfo { |
| 89 AlternateProtocolInfo() |
| 90 : port(0), |
| 91 protocol(UNINITIALIZED_ALTERNATE_PROTOCOL), |
| 92 probability(0), |
| 93 is_broken(false) {} |
| 94 |
89 AlternateProtocolInfo(uint16 port, | 95 AlternateProtocolInfo(uint16 port, |
90 AlternateProtocol protocol, | 96 AlternateProtocol protocol, |
91 double probability) | 97 double probability) |
92 : port(port), | 98 : port(port), |
93 protocol(protocol), | 99 protocol(protocol), |
94 probability(probability), | 100 probability(probability), |
95 is_broken(false) {} | 101 is_broken(false) {} |
96 | 102 |
97 AlternateProtocolInfo(uint16 port, | 103 AlternateProtocolInfo(uint16 port, |
98 AlternateProtocol protocol, | 104 AlternateProtocol protocol, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 public: | 161 public: |
156 HttpServerProperties() {} | 162 HttpServerProperties() {} |
157 virtual ~HttpServerProperties() {} | 163 virtual ~HttpServerProperties() {} |
158 | 164 |
159 // Gets a weak pointer for this object. | 165 // Gets a weak pointer for this object. |
160 virtual base::WeakPtr<HttpServerProperties> GetWeakPtr() = 0; | 166 virtual base::WeakPtr<HttpServerProperties> GetWeakPtr() = 0; |
161 | 167 |
162 // Deletes all data. | 168 // Deletes all data. |
163 virtual void Clear() = 0; | 169 virtual void Clear() = 0; |
164 | 170 |
165 // Returns true if |server| supports SPDY. | 171 // Returns true if |server| supports a network protocol which honors |
166 virtual bool SupportsSpdy(const HostPortPair& server) = 0; | 172 // request prioritization. |
| 173 virtual bool SupportsRequestPriority(const HostPortPair& server) = 0; |
167 | 174 |
168 // Add |server| into the persistent store. Should only be called from IO | 175 // Add |server| into the persistent store. Should only be called from IO |
169 // thread. | 176 // thread. |
170 virtual void SetSupportsSpdy(const HostPortPair& server, | 177 virtual void SetSupportsSpdy(const HostPortPair& server, |
171 bool support_spdy) = 0; | 178 bool support_spdy) = 0; |
172 | 179 |
173 // Returns true if |server| has required HTTP/1.1 via HTTP/2 error code. | 180 // Returns true if |server| has required HTTP/1.1 via HTTP/2 error code. |
174 virtual bool RequiresHTTP11(const HostPortPair& server) = 0; | 181 virtual bool RequiresHTTP11(const HostPortPair& server) = 0; |
175 | 182 |
176 // Require HTTP/1.1 on subsequent connections. Not persisted. | 183 // Require HTTP/1.1 on subsequent connections. Not persisted. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 267 |
261 virtual const ServerNetworkStatsMap& server_network_stats_map() const = 0; | 268 virtual const ServerNetworkStatsMap& server_network_stats_map() const = 0; |
262 | 269 |
263 private: | 270 private: |
264 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); | 271 DISALLOW_COPY_AND_ASSIGN(HttpServerProperties); |
265 }; | 272 }; |
266 | 273 |
267 } // namespace net | 274 } // namespace net |
268 | 275 |
269 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | 276 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
OLD | NEW |