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

Side by Side Diff: net/spdy/hpack_decoder.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 unified diff | Download patch
« no previous file with comments | « net/spdy/hpack_constants.cc ('k') | net/spdy/hpack_decoder_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/spdy/hpack_decoder.h" 5 #include "net/spdy/hpack_decoder.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "net/spdy/hpack_constants.h" 9 #include "net/spdy/hpack_constants.h"
10 #include "net/spdy/hpack_output_stream.h" 10 #include "net/spdy/hpack_output_stream.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 header_table_.SetMaxSize(size); 121 header_table_.SetMaxSize(size);
122 return true; 122 return true;
123 } 123 }
124 124
125 bool HpackDecoder::DecodeNextIndexedHeader(HpackInputStream* input_stream) { 125 bool HpackDecoder::DecodeNextIndexedHeader(HpackInputStream* input_stream) {
126 uint32 index = 0; 126 uint32 index = 0;
127 if (!input_stream->DecodeNextUint32(&index)) 127 if (!input_stream->DecodeNextUint32(&index))
128 return false; 128 return false;
129 129
130 HpackEntry* entry = header_table_.GetByIndex(index); 130 const HpackEntry* entry = header_table_.GetByIndex(index);
131 if (entry == NULL) 131 if (entry == NULL)
132 return false; 132 return false;
133 133
134 HandleHeaderRepresentation(entry->name(), entry->value()); 134 HandleHeaderRepresentation(entry->name(), entry->value());
135 return true; 135 return true;
136 } 136 }
137 137
138 bool HpackDecoder::DecodeNextLiteralHeader(HpackInputStream* input_stream, 138 bool HpackDecoder::DecodeNextLiteralHeader(HpackInputStream* input_stream,
139 bool should_index) { 139 bool should_index) {
140 StringPiece name; 140 StringPiece name;
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 return result; 186 return result;
187 } else if (input_stream->MatchPrefixAndConsume( 187 } else if (input_stream->MatchPrefixAndConsume(
188 kStringLiteralIdentityEncoded)) { 188 kStringLiteralIdentityEncoded)) {
189 return input_stream->DecodeNextIdentityString(output); 189 return input_stream->DecodeNextIdentityString(output);
190 } else { 190 } else {
191 return false; 191 return false;
192 } 192 }
193 } 193 }
194 194
195 } // namespace net 195 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/hpack_constants.cc ('k') | net/spdy/hpack_decoder_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698