| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |