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_IMPL_H_ | 5 #ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ |
6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ | 6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <deque> | 11 #include <deque> |
12 #include <map> | 12 #include <map> |
13 #include <set> | 13 #include <set> |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
19 #include "base/threading/non_thread_safe.h" | 19 #include "base/sequence_checker.h" |
20 #include "base/values.h" | 20 #include "base/values.h" |
21 #include "net/base/host_port_pair.h" | 21 #include "net/base/host_port_pair.h" |
22 #include "net/base/ip_address.h" | 22 #include "net/base/ip_address.h" |
23 #include "net/base/linked_hash_map.h" | 23 #include "net/base/linked_hash_map.h" |
24 #include "net/base/net_export.h" | 24 #include "net/base/net_export.h" |
25 #include "net/http/http_server_properties.h" | 25 #include "net/http/http_server_properties.h" |
26 | 26 |
27 namespace base { | 27 namespace base { |
28 class ListValue; | 28 class ListValue; |
29 } | 29 } |
30 | 30 |
31 namespace net { | 31 namespace net { |
32 | 32 |
33 struct AlternativeServiceHash { | 33 struct AlternativeServiceHash { |
34 size_t operator()(const net::AlternativeService& entry) const { | 34 size_t operator()(const net::AlternativeService& entry) const { |
35 return entry.protocol ^ std::hash<std::string>()(entry.host) ^ entry.port; | 35 return entry.protocol ^ std::hash<std::string>()(entry.host) ^ entry.port; |
36 } | 36 } |
37 }; | 37 }; |
38 | 38 |
39 // The implementation for setting/retrieving the HTTP server properties. | 39 // The implementation for setting/retrieving the HTTP server properties. |
40 class NET_EXPORT HttpServerPropertiesImpl | 40 class NET_EXPORT HttpServerPropertiesImpl : public HttpServerProperties { |
41 : public HttpServerProperties, | |
42 NON_EXPORTED_BASE(public base::NonThreadSafe) { | |
43 public: | 41 public: |
44 HttpServerPropertiesImpl(); | 42 HttpServerPropertiesImpl(); |
45 ~HttpServerPropertiesImpl() override; | 43 ~HttpServerPropertiesImpl() override; |
46 | 44 |
47 // Sets |spdy_servers_map_| with the servers (host/port) from | 45 // Sets |spdy_servers_map_| with the servers (host/port) from |
48 // |spdy_servers| that either support SPDY or not. | 46 // |spdy_servers| that either support SPDY or not. |
49 void SetSpdyServers(std::vector<std::string>* spdy_servers, | 47 void SetSpdyServers(std::vector<std::string>* spdy_servers, |
50 bool support_spdy); | 48 bool support_spdy); |
51 | 49 |
52 void SetAlternativeServiceServers( | 50 void SetAlternativeServiceServers( |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // Map from a Canonical scheme/host/port (host is some postfix of host names) | 166 // Map from a Canonical scheme/host/port (host is some postfix of host names) |
169 // to an actual origin, which has a plausible alternate protocol mapping. | 167 // to an actual origin, which has a plausible alternate protocol mapping. |
170 CanonicalHostMap canonical_host_to_origin_map_; | 168 CanonicalHostMap canonical_host_to_origin_map_; |
171 // Contains list of suffixes (for exmaple ".c.youtube.com", | 169 // Contains list of suffixes (for exmaple ".c.youtube.com", |
172 // ".googlevideo.com", ".googleusercontent.com") of canonical hostnames. | 170 // ".googlevideo.com", ".googleusercontent.com") of canonical hostnames. |
173 CanonicalSufficList canonical_suffixes_; | 171 CanonicalSufficList canonical_suffixes_; |
174 | 172 |
175 QuicServerInfoMap quic_server_info_map_; | 173 QuicServerInfoMap quic_server_info_map_; |
176 size_t max_server_configs_stored_in_properties_; | 174 size_t max_server_configs_stored_in_properties_; |
177 | 175 |
| 176 SEQUENCE_CHECKER(sequence_checker_); |
| 177 |
178 base::WeakPtrFactory<HttpServerPropertiesImpl> weak_ptr_factory_; | 178 base::WeakPtrFactory<HttpServerPropertiesImpl> weak_ptr_factory_; |
179 | 179 |
180 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesImpl); | 180 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesImpl); |
181 }; | 181 }; |
182 | 182 |
183 } // namespace net | 183 } // namespace net |
184 | 184 |
185 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ | 185 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ |
OLD | NEW |