OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef NET_SPDY_SPDY_SETTING_STORAGE_H_ | |
6 #define NET_SPDY_SPDY_SETTING_STORAGE_H_ | |
7 #pragma once | |
8 | |
9 #include <map> | |
10 #include "base/basictypes.h" | |
11 #include "net/base/host_port_pair.h" | |
12 #include "net/base/net_export.h" | |
13 #include "net/spdy/spdy_framer.h" | |
14 | |
15 namespace net { | |
16 | |
17 // SpdySettingsStorage stores SpdySettings which have been transmitted between | |
18 // endpoints for the SPDY SETTINGS frame. | |
19 class NET_EXPORT_PRIVATE SpdySettingsStorage { | |
20 public: | |
21 SpdySettingsStorage(); | |
22 ~SpdySettingsStorage(); | |
23 | |
24 // Gets a copy of the SpdySettings stored for a host. | |
25 // If no settings are stored, returns an empty set of settings. | |
26 // NOTE: Since settings_map_ may be cleared, don't store the address of the | |
27 // return value. | |
28 const SpdySettings& Get(const HostPortPair& host_port_pair) const; | |
29 | |
30 // Saves settings for a host. | |
31 void Set(const HostPortPair& host_port_pair, | |
32 const SpdySettings& settings); | |
33 | |
34 // Clears out the settings_map_ object. | |
35 void Clear(); | |
36 | |
37 private: | |
38 typedef std::map<HostPortPair, SpdySettings> SettingsMap; | |
39 | |
40 SettingsMap settings_map_; | |
41 | |
42 DISALLOW_COPY_AND_ASSIGN(SpdySettingsStorage); | |
43 }; | |
44 | |
45 } // namespace net | |
46 | |
47 #endif // NET_SPDY_SPDY_SETTING_STORAGE_H_ | |
48 | |
OLD | NEW |