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_H_ | |
6 #define NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | |
7 #pragma once | |
8 | |
9 #include <string> | |
10 | |
11 #include "base/basictypes.h" | |
12 #include "base/hash_tables.h" | |
13 #include "base/memory/scoped_ptr.h" | |
14 #include "base/string_piece.h" | |
15 #include "base/values.h" | |
16 #include "net/base/host_port_pair.h" | |
17 #include "net/base/net_export.h" | |
18 | |
19 namespace base { | |
20 class ListValue; | |
21 } | |
22 | |
23 namespace net { | |
24 | |
25 // The interface for retrieving the HTTP server properties. | |
26 class NET_EXPORT HttpServerProperties { | |
27 public: | |
28 HttpServerProperties(); | |
29 | |
30 // Returns true if |server| supports SPDY. | |
31 virtual bool SupportsSpdy(const HostPortPair& server); | |
willchan no longer on Chromium
2011/10/02 18:33:13
Member function should be const.
ramant (doing other things)
2011/10/04 05:23:24
Done.
| |
32 | |
33 // Add |server| into the persisitent store. Should only be called from IO | |
willchan no longer on Chromium
2011/10/02 18:33:13
persistent
ramant (doing other things)
2011/10/04 05:23:24
Done.
| |
34 // thread. | |
35 virtual void SetSupportsSpdy(const HostPortPair& server, | |
willchan no longer on Chromium
2011/10/02 18:33:13
Can you make these virtuals be pure virtuals? Also
ramant (doing other things)
2011/10/04 05:23:24
Done.
| |
36 bool support_spdy); | |
37 | |
38 protected: | |
39 typedef std::vector<std::string> StringVector; | |
40 | |
41 virtual ~HttpServerProperties(); | |
42 | |
43 // Initializes |spdy_servers_table_| with the servers (host/port) from | |
44 // |spdy_servers| that either support SPDY or not. | |
45 void Initialize(StringVector* spdy_servers, bool support_spdy); | |
46 | |
47 // Get the list of servers (host/port) that support SPDY. | |
48 void GetSpdyServerList(base::ListValue* spdy_server_list); | |
49 | |
50 private: | |
51 // Flattens the |host_port_pair| into the |spdy_server| string. | |
52 void GetFlattenedSpdyServer(const net::HostPortPair& host_port_pair, | |
willchan no longer on Chromium
2011/10/02 18:33:13
Does this need to be in the .h file? It seems like
ramant (doing other things)
2011/10/04 05:23:24
Done.
| |
53 std::string& spdy_server); | |
willchan no longer on Chromium
2011/10/02 18:33:13
http://google-styleguide.googlecode.com/svn/trunk/
ramant (doing other things)
2011/10/04 05:23:24
Done.
| |
54 | |
55 // |spdy_servers_table_| has flattened representation of servers (host/port | |
56 // pair) that either support or not support SPDY protocol. | |
57 typedef base::hash_map<std::string, bool> SpdyServerHostPortTable; | |
willchan no longer on Chromium
2011/10/02 18:33:13
types go first in the section
ramant (doing other things)
2011/10/04 05:23:24
Done.
| |
58 SpdyServerHostPortTable spdy_servers_table_; | |
59 }; | |
willchan no longer on Chromium
2011/10/02 18:33:13
DISALLOW_COPY_AND_ASSIGN
ramant (doing other things)
2011/10/04 05:23:24
Done.
| |
60 | |
61 } // namespace net | |
62 | |
63 #endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ | |
OLD | NEW |