Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ | |
| 6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/hash_tables.h" | |
| 12 #include "base/values.h" | |
| 13 #include "net/base/host_port_pair.h" | |
| 14 #include "net/base/net_export.h" | |
| 15 #include "net/http/http_server_properties.h" | |
| 16 | |
| 17 namespace base { | |
| 18 class ListValue; | |
| 19 } | |
| 20 | |
| 21 namespace net { | |
| 22 | |
| 23 // The implementation for setting/retrieving the HTTP server properties. | |
|
willchan no longer on Chromium
2011/10/04 05:55:02
You should add a test for this class that tests th
ramant (doing other things)
2011/10/06 06:17:52
Done.
| |
| 24 class NET_EXPORT HttpServerPropertiesImpl : public HttpServerProperties { | |
| 25 public: | |
| 26 HttpServerPropertiesImpl(); | |
| 27 virtual ~HttpServerPropertiesImpl(); | |
| 28 | |
| 29 // Returns true if |server| supports SPDY. | |
| 30 virtual bool SupportsSpdy(const HostPortPair& server) const OVERRIDE; | |
| 31 | |
| 32 // Add |server| into the persistent store. Should only be called from IO | |
| 33 // thread. | |
| 34 virtual void SetSupportsSpdy(const HostPortPair& server, | |
| 35 bool support_spdy) OVERRIDE; | |
| 36 | |
| 37 // Initializes |spdy_servers_table_| with the servers (host/port) from | |
| 38 // |spdy_servers| that either support SPDY or not. | |
| 39 void Initialize(StringVector* spdy_servers, bool support_spdy); | |
| 40 | |
| 41 // Get the list of servers (host/port) that support SPDY. | |
| 42 void GetSpdyServerList(base::ListValue* spdy_server_list); | |
| 43 | |
| 44 private: | |
| 45 // |spdy_servers_table_| has flattened representation of servers (host/port | |
| 46 // pair) that either support or not support SPDY protocol. | |
| 47 typedef base::hash_map<std::string, bool> SpdyServerHostPortTable; | |
| 48 SpdyServerHostPortTable spdy_servers_table_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(HttpServerPropertiesImpl); | |
| 51 }; | |
| 52 | |
| 53 } // namespace net | |
| 54 | |
| 55 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_IMPL_H_ | |
| OLD | NEW |