OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_SPDY_SPDY_SETTING_STORAGE_H_ | 5 #ifndef NET_SPDY_SPDY_SETTING_STORAGE_H_ |
6 #define NET_SPDY_SPDY_SETTING_STORAGE_H_ | 6 #define NET_SPDY_SPDY_SETTING_STORAGE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "net/base/host_port_pair.h" | 11 #include "net/base/host_port_pair.h" |
12 #include "net/spdy/spdy_framer.h" | 12 #include "net/spdy/spdy_framer.h" |
13 | 13 |
14 namespace net { | 14 namespace net { |
15 | 15 |
16 // SpdySettingsStorage stores SpdySettings which have been transmitted between | 16 // SpdySettingsStorage stores SpdySettings which have been transmitted between |
17 // endpoints for the SPDY SETTINGS frame. | 17 // endpoints for the SPDY SETTINGS frame. |
18 class SpdySettingsStorage { | 18 class SpdySettingsStorage { |
19 public: | 19 public: |
20 SpdySettingsStorage(); | 20 SpdySettingsStorage(); |
21 ~SpdySettingsStorage(); | 21 ~SpdySettingsStorage(); |
22 | 22 |
23 // Get a copy of the SpdySettings stored for a host. | 23 // Get a copy of the SpdySettings stored for a host. |
24 // If no settings are stored, returns an empty set of settings. | 24 // If no settings are stored, returns an empty set of settings. |
25 // Since settings_map_ may be cleared, don't remember the address of the | |
26 // return value. | |
27 | |
wtc
2011/05/19 22:54:37
Nit: don't add this blank line.
willchan: since G
willchan no longer on Chromium
2011/05/19 22:59:44
Adding a comment is indeed the right solution here
| |
25 const spdy::SpdySettings& Get(const HostPortPair& host_port_pair) const; | 28 const spdy::SpdySettings& Get(const HostPortPair& host_port_pair) const; |
26 | 29 |
27 // Save settings for a host. | 30 // Save settings for a host. |
28 void Set(const HostPortPair& host_port_pair, | 31 void Set(const HostPortPair& host_port_pair, |
29 const spdy::SpdySettings& settings); | 32 const spdy::SpdySettings& settings); |
30 | 33 |
34 // Flush structure | |
wtc
2011/05/19 22:54:37
Nit: this comment should say a little more.
| |
35 void Clear(); | |
36 | |
31 private: | 37 private: |
32 typedef std::map<HostPortPair, spdy::SpdySettings> SettingsMap; | 38 typedef std::map<HostPortPair, spdy::SpdySettings> SettingsMap; |
33 | 39 |
34 SettingsMap settings_map_; | 40 SettingsMap settings_map_; |
35 | 41 |
36 DISALLOW_COPY_AND_ASSIGN(SpdySettingsStorage); | 42 DISALLOW_COPY_AND_ASSIGN(SpdySettingsStorage); |
37 }; | 43 }; |
38 | 44 |
39 } // namespace net | 45 } // namespace net |
40 | 46 |
41 #endif // NET_SPDY_SPDY_SETTING_STORAGE_H_ | 47 #endif // NET_SPDY_SPDY_SETTING_STORAGE_H_ |
42 | 48 |
OLD | NEW |