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

Side by Side Diff: net/tools/quic/spdy_utils.cc

Issue 246013002: SPDY: Headers & Push-Promise now use Continuations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase only Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « net/spdy/spdy_protocol.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/tools/quic/spdy_utils.h" 5 #include "net/tools/quic/spdy_utils.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 string SpdyUtils::SerializeResponseHeaders( 151 string SpdyUtils::SerializeResponseHeaders(
152 const BalsaHeaders& response_headers) { 152 const BalsaHeaders& response_headers) {
153 SpdyHeaderBlock block = ResponseHeadersToSpdyHeaders(response_headers); 153 SpdyHeaderBlock block = ResponseHeadersToSpdyHeaders(response_headers);
154 154
155 return SerializeUncompressedHeaders(block); 155 return SerializeUncompressedHeaders(block);
156 } 156 }
157 157
158 // static 158 // static
159 string SpdyUtils::SerializeUncompressedHeaders(const SpdyHeaderBlock& headers) { 159 string SpdyUtils::SerializeUncompressedHeaders(const SpdyHeaderBlock& headers) {
160 int length = SpdyFramer::GetSerializedLength(SPDY3, &headers); 160 int length = SpdyFramer::GetSerializedLength(SPDY3, &headers);
161 SpdyFrameBuilder builder(length); 161 SpdyFrameBuilder builder(length, SPDY3);
162 SpdyFramer::WriteHeaderBlock(&builder, SPDY3, &headers); 162 SpdyFramer::WriteHeaderBlock(&builder, SPDY3, &headers);
163 scoped_ptr<SpdyFrame> block(builder.take()); 163 scoped_ptr<SpdyFrame> block(builder.take());
164 return string(block->data(), length); 164 return string(block->data(), length);
165 } 165 }
166 166
167 bool IsSpecialSpdyHeader(SpdyHeaderBlock::const_iterator header, 167 bool IsSpecialSpdyHeader(SpdyHeaderBlock::const_iterator header,
168 BalsaHeaders* headers) { 168 BalsaHeaders* headers) {
169 if (header->first.empty() || header->second.empty()) { 169 if (header->first.empty() || header->second.empty()) {
170 return true; 170 return true;
171 } 171 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 for (BlockIt it = header_block.begin(); it != header_block.end(); ++it) { 257 for (BlockIt it = header_block.begin(); it != header_block.end(); ++it) {
258 if (!IsSpecialSpdyHeader(it, request_headers)) { 258 if (!IsSpecialSpdyHeader(it, request_headers)) {
259 request_headers->AppendHeader(it->first, it->second); 259 request_headers->AppendHeader(it->first, it->second);
260 } 260 }
261 } 261 }
262 return true; 262 return true;
263 } 263 }
264 264
265 } // namespace tools 265 } // namespace tools
266 } // namespace net 266 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_protocol.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698