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

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

Issue 959743002: Account for HTTP/2 padding in receive windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit. Created 5 years, 9 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
« net/spdy/spdy_framer.cc ('K') | « net/spdy/spdy_test_util_common.h ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/spdy_test_util_common.h" 5 #include "net/spdy/spdy_test_util_common.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 SpdyFrame* SpdyTestUtil::ConstructSpdyBodyFrame(int stream_id, 1217 SpdyFrame* SpdyTestUtil::ConstructSpdyBodyFrame(int stream_id,
1218 const char* data, 1218 const char* data,
1219 uint32 len, 1219 uint32 len,
1220 bool fin) { 1220 bool fin) {
1221 SpdyFramer framer(spdy_version_); 1221 SpdyFramer framer(spdy_version_);
1222 SpdyDataIR data_ir(stream_id, base::StringPiece(data, len)); 1222 SpdyDataIR data_ir(stream_id, base::StringPiece(data, len));
1223 data_ir.set_fin(fin); 1223 data_ir.set_fin(fin);
1224 return framer.SerializeData(data_ir); 1224 return framer.SerializeData(data_ir);
1225 } 1225 }
1226 1226
1227 SpdyFrame* SpdyTestUtil::ConstructSpdyBodyFrame(int stream_id,
1228 const char* data,
1229 uint32 len,
1230 bool fin,
1231 int padding_length) {
1232 SpdyFramer framer(spdy_version_);
1233 SpdyDataIR data_ir(stream_id, base::StringPiece(data, len));
1234 data_ir.set_fin(fin);
1235 data_ir.set_padding_len(padding_length);
1236 return framer.SerializeData(data_ir);
1237 }
1238
1227 SpdyFrame* SpdyTestUtil::ConstructWrappedSpdyFrame( 1239 SpdyFrame* SpdyTestUtil::ConstructWrappedSpdyFrame(
1228 const scoped_ptr<SpdyFrame>& frame, 1240 const scoped_ptr<SpdyFrame>& frame,
1229 int stream_id) { 1241 int stream_id) {
1230 return ConstructSpdyBodyFrame(stream_id, frame->data(), 1242 return ConstructSpdyBodyFrame(stream_id, frame->data(),
1231 frame->size(), false); 1243 frame->size(), false);
1232 } 1244 }
1233 1245
1234 const SpdyHeaderInfo SpdyTestUtil::MakeSpdyHeader(SpdyFrameType type) { 1246 const SpdyHeaderInfo SpdyTestUtil::MakeSpdyHeader(SpdyFrameType type) {
1235 const SpdyHeaderInfo kHeader = { 1247 const SpdyHeaderInfo kHeader = {
1236 type, 1248 type,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 } 1327 }
1316 } 1328 }
1317 1329
1318 void SpdyTestUtil::SetPriority(RequestPriority priority, 1330 void SpdyTestUtil::SetPriority(RequestPriority priority,
1319 SpdySynStreamIR* ir) const { 1331 SpdySynStreamIR* ir) const {
1320 ir->set_priority(ConvertRequestPriorityToSpdyPriority( 1332 ir->set_priority(ConvertRequestPriorityToSpdyPriority(
1321 priority, spdy_version())); 1333 priority, spdy_version()));
1322 } 1334 }
1323 1335
1324 } // namespace net 1336 } // namespace net
OLDNEW
« net/spdy/spdy_framer.cc ('K') | « net/spdy/spdy_test_util_common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698