spdy_settings_storage.h revision c407dc5cd9bdc5668497f21b26b09d988ab439de
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
3// found in the LICENSE file.
4
5#ifndef NET_SPDY_SPDY_SETTING_STORAGE_H_
6#define NET_SPDY_SPDY_SETTING_STORAGE_H_
7
8#include <map>
9#include "base/basictypes.h"
10#include "net/base/host_port_pair.h"
11#include "net/spdy/spdy_framer.h"
12
13namespace net {
14
15// SpdySettingsStorage stores SpdySettings which have been transmitted between
16// endpoints for the SPDY SETTINGS frame.
17class SpdySettingsStorage {
18 public:
19  SpdySettingsStorage();
20
21  // Get a copy of the SpdySettings stored for a host.
22  // If no settings are stored, returns an empty set of settings.
23  const spdy::SpdySettings& Get(const HostPortPair& host_port_pair) const;
24
25  // Save settings for a host.
26  void Set(const HostPortPair& host_port_pair,
27           const spdy::SpdySettings& settings);
28
29 private:
30  typedef std::map<HostPortPair, spdy::SpdySettings> SettingsMap;
31
32  SettingsMap settings_map_;
33
34  DISALLOW_COPY_AND_ASSIGN(SpdySettingsStorage);
35};
36
37}  // namespace net
38
39#endif  // NET_SPDY_SPDY_SETTING_STORAGE_H_
40
41