Chromium Code Reviews| Index: net/http/http_server_properties.h |
| =================================================================== |
| --- net/http/http_server_properties.h (revision 0) |
| +++ net/http/http_server_properties.h (revision 0) |
| @@ -0,0 +1,63 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
| +#define NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |
| +#pragma once |
| + |
| +#include <string> |
| + |
| +#include "base/basictypes.h" |
| +#include "base/hash_tables.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "base/string_piece.h" |
| +#include "base/values.h" |
| +#include "net/base/host_port_pair.h" |
| +#include "net/base/net_export.h" |
| + |
| +namespace base { |
| +class ListValue; |
| +} |
| + |
| +namespace net { |
| + |
| +// The interface for retrieving the HTTP server properties. |
| +class NET_EXPORT HttpServerProperties { |
| + public: |
| + HttpServerProperties(); |
| + |
| + // Returns true if |server| supports SPDY. |
| + 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.
|
| + |
| + // 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.
|
| + // thread. |
| + 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.
|
| + bool support_spdy); |
| + |
| + protected: |
| + typedef std::vector<std::string> StringVector; |
| + |
| + virtual ~HttpServerProperties(); |
| + |
| + // Initializes |spdy_servers_table_| with the servers (host/port) from |
| + // |spdy_servers| that either support SPDY or not. |
| + void Initialize(StringVector* spdy_servers, bool support_spdy); |
| + |
| + // Get the list of servers (host/port) that support SPDY. |
| + void GetSpdyServerList(base::ListValue* spdy_server_list); |
| + |
| + private: |
| + // Flattens the |host_port_pair| into the |spdy_server| string. |
| + 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.
|
| + 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.
|
| + |
| + // |spdy_servers_table_| has flattened representation of servers (host/port |
| + // pair) that either support or not support SPDY protocol. |
| + 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.
|
| + SpdyServerHostPortTable spdy_servers_table_; |
| +}; |
|
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.
|
| + |
| +} // namespace net |
| + |
| +#endif // NET_HTTP_HTTP_SERVER_PROPERTIES_H_ |