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

Unified Diff: net/spdy/spdy_framer.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_framer.h ('k') | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_framer.cc
===================================================================
--- net/spdy/spdy_framer.cc (revision 132592)
+++ net/spdy/spdy_framer.cc (working copy)
@@ -1001,7 +1001,7 @@
/* static */
bool SpdyFramer::ParseSettings(const SpdySettingsControlFrame* frame,
- SpdySettings* settings) {
+ SettingsMap* settings) {
DCHECK_EQ(frame->type(), SETTINGS);
DCHECK(settings);
@@ -1016,9 +1016,12 @@
}
if (!parser.ReadUInt32(&value))
return false;
- SettingsFlagsAndId id_and_flags =
+ SettingsFlagsAndId flags_and_id =
SettingsFlagsAndId::FromWireFormat(frame->version(), id_and_flags_wire);
- settings->insert(settings->end(), std::make_pair(id_and_flags, value));
+ SpdySettingsIds id = static_cast<SpdySettingsIds>(flags_and_id.id());
+ SpdySettingsFlags flags =
+ static_cast<SpdySettingsFlags>(flags_and_id.flags());
+ settings->insert(std::make_pair(id, SettingsFlagsAndValue(flags, value)));
}
return true;
}
@@ -1139,16 +1142,17 @@
}
SpdySettingsControlFrame* SpdyFramer::CreateSettings(
- const SpdySettings& values) const {
+ const SettingsMap& values) const {
size_t frame_size = SpdySettingsControlFrame::size() + 8 * values.size();
SpdyFrameBuilder frame(SETTINGS, CONTROL_FLAG_NONE, spdy_version_,
frame_size);
frame.WriteUInt32(values.size());
- SpdySettings::const_iterator it = values.begin();
+ SettingsMap::const_iterator it = values.begin();
while (it != values.end()) {
- uint32 id_and_flags_wire = it->first.GetWireFormat(spdy_version_);
+ SettingsFlagsAndId flags_and_id(it->second.first, it->first);
+ uint32 id_and_flags_wire = flags_and_id.GetWireFormat(spdy_version_);
frame.WriteBytes(&id_and_flags_wire, 4);
- frame.WriteUInt32(it->second);
+ frame.WriteUInt32(it->second.second);
++it;
}
DCHECK_EQ(static_cast<size_t>(frame.length()), frame_size);
« no previous file with comments | « net/spdy/spdy_framer.h ('k') | net/spdy/spdy_framer_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698