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

Unified Diff: net/spdy/hpack_encoder.cc

Issue 822713002: Update from https://crrev.com/309415 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years 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
Index: net/spdy/hpack_encoder.cc
diff --git a/net/spdy/hpack_encoder.cc b/net/spdy/hpack_encoder.cc
index 0ba353782c56b4f369e279bc848f4c93ee532d7b..bc56efefbc883b040054e7f6416f4b24f97899dc 100644
--- a/net/spdy/hpack_encoder.cc
+++ b/net/spdy/hpack_encoder.cc
@@ -64,10 +64,7 @@ bool HpackEncoder::EncodeHeaderSet(const std::map<string, string>& header_set,
}
}
- // Encode regular headers that are already in the header table first,
- // save the rest into another vector. This way we avoid evicting an entry
- // from the header table before it can be used.
- Representations literal_headers;
+ // Encode regular headers.
for (Representations::const_iterator it = regular_headers.begin();
it != regular_headers.end(); ++it) {
const HpackEntry* entry =
@@ -75,17 +72,10 @@ bool HpackEncoder::EncodeHeaderSet(const std::map<string, string>& header_set,
if (entry != NULL) {
EmitIndex(entry);
} else {
- literal_headers.push_back(*it);
+ EmitIndexedLiteral(*it);
}
}
- // Encode the remaining header fields, while inserting them in the header
- // table.
- for (Representations::const_iterator it = literal_headers.begin();
- it != literal_headers.end(); ++it) {
- EmitIndexedLiteral(*it);
- }
-
output_stream_.TakeString(output);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698