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

Unified Diff: net/spdy/hpack_encoder.cc

Issue 549583003: Make HPACK static table static and immutable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/hpack_encoder.h ('k') | net/spdy/hpack_encoder_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/hpack_encoder.cc
diff --git a/net/spdy/hpack_encoder.cc b/net/spdy/hpack_encoder.cc
index 6cb8fad954161470b543eb8ddfc4e2ea194d27a7..0f57abb54a79a7b45a768219b703502131ddb72e 100644
--- a/net/spdy/hpack_encoder.cc
+++ b/net/spdy/hpack_encoder.cc
@@ -48,7 +48,8 @@ bool HpackEncoder::EncodeHeaderSet(const std::map<string, string>& header_set,
// Encode pseudo-headers.
for (Representations::const_iterator it = pseudo_headers.begin();
it != pseudo_headers.end(); ++it) {
- HpackEntry* entry = header_table_.GetByNameAndValue(it->first, it->second);
+ const HpackEntry* entry =
+ header_table_.GetByNameAndValue(it->first, it->second);
if (entry != NULL) {
EmitIndex(entry);
} else {
@@ -71,7 +72,8 @@ bool HpackEncoder::EncodeHeaderSet(const std::map<string, string>& header_set,
Representations literal_headers;
for (Representations::const_iterator it = regular_headers.begin();
it != regular_headers.end(); ++it) {
- HpackEntry* entry = header_table_.GetByNameAndValue(it->first, it->second);
+ const HpackEntry* entry =
+ header_table_.GetByNameAndValue(it->first, it->second);
if (entry != NULL) {
EmitIndex(entry);
} else {
@@ -105,7 +107,7 @@ bool HpackEncoder::EncodeHeaderSetWithoutCompression(
return true;
}
-void HpackEncoder::EmitIndex(HpackEntry* entry) {
+void HpackEncoder::EmitIndex(const HpackEntry* entry) {
output_stream_.AppendPrefix(kIndexedOpcode);
output_stream_.AppendUint32(header_table_.IndexOf(entry));
}
« no previous file with comments | « net/spdy/hpack_encoder.h ('k') | net/spdy/hpack_encoder_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698