Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1494)

Unified Diff: net/spdy/spdy_settings_storage.cc

Issue 10054034: SPDY - replaced SpdySettings (list) with SettingsMap (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/spdy/spdy_settings_storage.h ('k') | net/spdy/spdy_test_util_spdy2.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_settings_storage.cc
===================================================================
--- net/spdy/spdy_settings_storage.cc (revision 132592)
+++ net/spdy/spdy_settings_storage.cc (working copy)
@@ -1,54 +0,0 @@
-// Copyright (c) 2012 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.
-
-#include "net/spdy/spdy_settings_storage.h"
-
-#include <utility>
-
-namespace net {
-
-SpdySettingsStorage::SpdySettingsStorage() {
-}
-
-SpdySettingsStorage::~SpdySettingsStorage() {
-}
-
-const SpdySettings& SpdySettingsStorage::Get(
- const HostPortPair& host_port_pair) const {
- SettingsMap::const_iterator it = settings_map_.find(host_port_pair);
- if (it == settings_map_.end()) {
- CR_DEFINE_STATIC_LOCAL(SpdySettings, kEmpty, ());
- return kEmpty;
- }
- return it->second;
-}
-
-void SpdySettingsStorage::Set(const HostPortPair& host_port_pair,
- const SpdySettings& settings) {
- SpdySettings persistent_settings;
-
- // Iterate through the list, and only copy those settings which are marked
- // for persistence.
- SpdySettings::const_iterator it;
- for (it = settings.begin(); it != settings.end(); ++it) {
- SettingsFlagsAndId id = it->first;
- if (id.flags() & SETTINGS_FLAG_PLEASE_PERSIST) {
- SettingsFlagsAndId new_id(SETTINGS_FLAG_PERSISTED, id.id());
- persistent_settings.push_back(std::make_pair(new_id, it->second));
- }
- }
-
- // If we didn't persist anything, then we are done.
- if (persistent_settings.empty())
- return;
-
- settings_map_[host_port_pair] = persistent_settings;
-}
-
-void SpdySettingsStorage::Clear() {
- settings_map_.clear();
-}
-
-} // namespace net
-
« no previous file with comments | « net/spdy/spdy_settings_storage.h ('k') | net/spdy/spdy_test_util_spdy2.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698