| 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 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // exists. | 73 // exists. |
| 74 std::string GetCanonicalSuffix(const std::string& host); | 74 std::string GetCanonicalSuffix(const std::string& host); |
| 75 | 75 |
| 76 // ----------------------------- | 76 // ----------------------------- |
| 77 // HttpServerProperties methods: | 77 // HttpServerProperties methods: |
| 78 // ----------------------------- | 78 // ----------------------------- |
| 79 | 79 |
| 80 base::WeakPtr<HttpServerProperties> GetWeakPtr() override; | 80 base::WeakPtr<HttpServerProperties> GetWeakPtr() override; |
| 81 void Clear() override; | 81 void Clear() override; |
| 82 bool SupportsRequestPriority(const url::SchemeHostPort& server) override; | 82 bool SupportsRequestPriority(const url::SchemeHostPort& server) override; |
| 83 bool GetSupportsSpdy(const HostPortPair& server) override; | 83 bool GetSupportsSpdy(const url::SchemeHostPort& server) override; |
| 84 void SetSupportsSpdy(const HostPortPair& server, bool support_spdy) override; | 84 void SetSupportsSpdy(const url::SchemeHostPort& server, |
| 85 bool support_spdy) override; |
| 85 bool RequiresHTTP11(const HostPortPair& server) override; | 86 bool RequiresHTTP11(const HostPortPair& server) override; |
| 86 void SetHTTP11Required(const HostPortPair& server) override; | 87 void SetHTTP11Required(const HostPortPair& server) override; |
| 87 void MaybeForceHTTP11(const HostPortPair& server, | 88 void MaybeForceHTTP11(const HostPortPair& server, |
| 88 SSLConfig* ssl_config) override; | 89 SSLConfig* ssl_config) override; |
| 89 AlternativeServiceVector GetAlternativeServices( | 90 AlternativeServiceVector GetAlternativeServices( |
| 90 const url::SchemeHostPort& origin) override; | 91 const url::SchemeHostPort& origin) override; |
| 91 bool SetAlternativeService(const url::SchemeHostPort& origin, | 92 bool SetAlternativeService(const url::SchemeHostPort& origin, |
| 92 const AlternativeService& alternative_service, | 93 const AlternativeService& alternative_service, |
| 93 base::Time expiration) override; | 94 base::Time expiration) override; |
| 94 bool SetAlternativeServices(const url::SchemeHostPort& origin, | 95 bool SetAlternativeServices(const url::SchemeHostPort& origin, |
| 95 const AlternativeServiceInfoVector& | 96 const AlternativeServiceInfoVector& |
| 96 alternative_service_info_vector) override; | 97 alternative_service_info_vector) override; |
| 97 void MarkAlternativeServiceBroken( | 98 void MarkAlternativeServiceBroken( |
| 98 const AlternativeService& alternative_service) override; | 99 const AlternativeService& alternative_service) override; |
| 99 void MarkAlternativeServiceRecentlyBroken( | 100 void MarkAlternativeServiceRecentlyBroken( |
| 100 const AlternativeService& alternative_service) override; | 101 const AlternativeService& alternative_service) override; |
| 101 bool IsAlternativeServiceBroken( | 102 bool IsAlternativeServiceBroken( |
| 102 const AlternativeService& alternative_service) const override; | 103 const AlternativeService& alternative_service) const override; |
| 103 bool WasAlternativeServiceRecentlyBroken( | 104 bool WasAlternativeServiceRecentlyBroken( |
| 104 const AlternativeService& alternative_service) override; | 105 const AlternativeService& alternative_service) override; |
| 105 void ConfirmAlternativeService( | 106 void ConfirmAlternativeService( |
| 106 const AlternativeService& alternative_service) override; | 107 const AlternativeService& alternative_service) override; |
| 107 void ClearAlternativeServices(const url::SchemeHostPort& origin) override; | 108 void ClearAlternativeServices(const url::SchemeHostPort& origin) override; |
| 108 const AlternativeServiceMap& alternative_service_map() const override; | 109 const AlternativeServiceMap& alternative_service_map() const override; |
| 109 scoped_ptr<base::Value> GetAlternativeServiceInfoAsValue() const override; | 110 scoped_ptr<base::Value> GetAlternativeServiceInfoAsValue() const override; |
| 110 const SettingsMap& GetSpdySettings( | 111 const SettingsMap& GetSpdySettings( |
| 111 const HostPortPair& host_port_pair) override; | 112 const url::SchemeHostPort& origin) override; |
| 112 bool SetSpdySetting(const HostPortPair& host_port_pair, | 113 bool SetSpdySetting(const url::SchemeHostPort& origin, |
| 113 SpdySettingsIds id, | 114 SpdySettingsIds id, |
| 114 SpdySettingsFlags flags, | 115 SpdySettingsFlags flags, |
| 115 uint32_t value) override; | 116 uint32_t value) override; |
| 116 void ClearSpdySettings(const HostPortPair& host_port_pair) override; | 117 void ClearSpdySettings(const url::SchemeHostPort& origin) override; |
| 117 void ClearAllSpdySettings() override; | 118 void ClearAllSpdySettings() override; |
| 118 const SpdySettingsMap& spdy_settings_map() const override; | 119 const SpdySettingsMap& spdy_settings_map() const override; |
| 119 bool GetSupportsQuic(IPAddress* last_address) const override; | 120 bool GetSupportsQuic(IPAddress* last_address) const override; |
| 120 void SetSupportsQuic(bool used_quic, const IPAddress& address) override; | 121 void SetSupportsQuic(bool used_quic, const IPAddress& address) override; |
| 121 void SetServerNetworkStats(const HostPortPair& host_port_pair, | 122 void SetServerNetworkStats(const url::SchemeHostPort& origin, |
| 122 ServerNetworkStats stats) override; | 123 ServerNetworkStats stats) override; |
| 123 const ServerNetworkStats* GetServerNetworkStats( | 124 const ServerNetworkStats* GetServerNetworkStats( |
| 124 const HostPortPair& host_port_pair) override; | 125 const url::SchemeHostPort& origin) override; |
| 125 const ServerNetworkStatsMap& server_network_stats_map() const override; | 126 const ServerNetworkStatsMap& server_network_stats_map() const override; |
| 126 bool SetQuicServerInfo(const QuicServerId& server_id, | 127 bool SetQuicServerInfo(const QuicServerId& server_id, |
| 127 const std::string& server_info) override; | 128 const std::string& server_info) override; |
| 128 const std::string* GetQuicServerInfo(const QuicServerId& server_id) override; | 129 const std::string* GetQuicServerInfo(const QuicServerId& server_id) override; |
| 129 const QuicServerInfoMap& quic_server_info_map() const override; | 130 const QuicServerInfoMap& quic_server_info_map() const override; |
| 130 size_t max_server_configs_stored_in_properties() const override; | 131 size_t max_server_configs_stored_in_properties() const override; |
| 131 void SetMaxServerConfigsStoredInProperties( | 132 void SetMaxServerConfigsStoredInProperties( |
| 132 size_t max_server_configs_stored_in_properties) override; | 133 size_t max_server_configs_stored_in_properties) override; |
| 133 | 134 |
| 134 private: | 135 private: |
| 135 friend class HttpServerPropertiesImplPeer; | 136 friend class HttpServerPropertiesImplPeer; |
| 136 | 137 |
| 137 // |spdy_servers_map_| has flattened representation of servers (host, port) | 138 // |spdy_servers_map_| has flattened representation of servers |
| 138 // that either support or not support SPDY protocol. | 139 // (scheme, host, port) that either support or not support SPDY protocol. |
| 139 typedef base::MRUCache<std::string, bool> SpdyServerHostPortMap; | 140 typedef base::MRUCache<std::string, bool> SpdyServerHostPortMap; |
| 140 typedef std::map<url::SchemeHostPort, url::SchemeHostPort> CanonicalHostMap; | 141 typedef std::map<url::SchemeHostPort, url::SchemeHostPort> CanonicalHostMap; |
| 141 typedef std::vector<std::string> CanonicalSufficList; | 142 typedef std::vector<std::string> CanonicalSufficList; |
| 142 typedef std::set<HostPortPair> Http11ServerHostPortSet; | 143 typedef std::set<HostPortPair> Http11ServerHostPortSet; |
| 143 | 144 |
| 144 // Linked hash map from AlternativeService to expiration time. This container | 145 // Linked hash map from AlternativeService to expiration time. This container |
| 145 // is a queue with O(1) enqueue and dequeue, and a hash_map with O(1) lookup | 146 // is a queue with O(1) enqueue and dequeue, and a hash_map with O(1) lookup |
| 146 // at the same time. | 147 // at the same time. |
| 147 typedef linked_hash_map<AlternativeService, | 148 typedef linked_hash_map<AlternativeService, |
| 148 base::TimeTicks, | 149 base::TimeTicks, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 size_t max_server_configs_stored_in_properties_; | 188 size_t max_server_configs_stored_in_properties_; |
| 188 | 189 |
| 189 base::WeakPtrFactory<HttpServerPropertiesImpl> weak_ptr_factory_; | 190 base::WeakPtrFactory<HttpServerPropertiesImpl> weak_ptr_factory_; |
| 190 | 191 |
| 191 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesImpl); | 192 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesImpl); |
| 192 }; | 193 }; |
| 193 | 194 |
| 194 } // namespace net | 195 } // namespace net |
| 195 | 196 |
| 196 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ | 197 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ |
| OLD | NEW |