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

Side by Side Diff: net/spdy/hpack_decoder.cc

Issue 1263803002: Replace SpdyNameValueBlock typedef with SpdyHeaderBlock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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_decoder.h ('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 <utility>
8
7 #include "base/basictypes.h" 9 #include "base/basictypes.h"
8 #include "base/logging.h" 10 #include "base/logging.h"
9 #include "net/spdy/hpack_constants.h" 11 #include "net/spdy/hpack_constants.h"
10 #include "net/spdy/hpack_output_stream.h" 12 #include "net/spdy/hpack_output_stream.h"
11 13
12 namespace net { 14 namespace net {
13 15
14 using base::StringPiece; 16 using base::StringPiece;
15 using std::string; 17 using std::string;
16 18
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 // Emit the Cookie header, if any crumbles were encountered. 59 // Emit the Cookie header, if any crumbles were encountered.
58 if (!cookie_value_.empty()) { 60 if (!cookie_value_.empty()) {
59 decoded_block_[kCookieKey] = cookie_value_; 61 decoded_block_[kCookieKey] = cookie_value_;
60 cookie_value_.clear(); 62 cookie_value_.clear();
61 } 63 }
62 return true; 64 return true;
63 } 65 }
64 66
65 bool HpackDecoder::HandleHeaderRepresentation(StringPiece name, 67 bool HpackDecoder::HandleHeaderRepresentation(StringPiece name,
66 StringPiece value) { 68 StringPiece value) {
67 typedef std::pair<std::map<string, string>::iterator, bool> InsertResult; 69 typedef std::pair<SpdyHeaderBlock::iterator, bool> InsertResult;
68 70
69 // Fail if pseudo-header follows regular header. 71 // Fail if pseudo-header follows regular header.
70 if (name.size() > 0) { 72 if (name.size() > 0) {
71 if (name[0] == kPseudoHeaderPrefix) { 73 if (name[0] == kPseudoHeaderPrefix) {
72 if (regular_header_seen_) return false; 74 if (regular_header_seen_) return false;
73 } else { 75 } else {
74 regular_header_seen_ = true; 76 regular_header_seen_ = true;
75 } 77 }
76 } 78 }
77 79
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 return result; 199 return result;
198 } else if (input_stream->MatchPrefixAndConsume( 200 } else if (input_stream->MatchPrefixAndConsume(
199 kStringLiteralIdentityEncoded)) { 201 kStringLiteralIdentityEncoded)) {
200 return input_stream->DecodeNextIdentityString(output); 202 return input_stream->DecodeNextIdentityString(output);
201 } else { 203 } else {
202 return false; 204 return false;
203 } 205 }
204 } 206 }
205 207
206 } // namespace net 208 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/hpack_decoder.h ('k') | net/spdy/hpack_decoder_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698