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

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: One more mock implementation. 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
« no previous file with comments | « net/spdy/spdy_test_util_common.h ('k') | net/tools/flip_server/spdy_interface.h » ('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 (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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 priority_ = priority; 236 priority_ = priority;
237 } 237 }
238 } 238 }
239 void OnDataFrameHeader(SpdyStreamId stream_id, 239 void OnDataFrameHeader(SpdyStreamId stream_id,
240 size_t length, 240 size_t length,
241 bool fin) override {} 241 bool fin) override {}
242 void OnStreamFrameData(SpdyStreamId stream_id, 242 void OnStreamFrameData(SpdyStreamId stream_id,
243 const char* data, 243 const char* data,
244 size_t len, 244 size_t len,
245 bool fin) override {} 245 bool fin) override {}
246 void OnStreamPadding(SpdyStreamId stream_id, size_t len) override {}
246 void OnSettings(bool clear_persisted) override {} 247 void OnSettings(bool clear_persisted) override {}
247 void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override {} 248 void OnSetting(SpdySettingsIds id, uint8 flags, uint32 value) override {}
248 void OnPing(SpdyPingId unique_id, bool is_ack) override {} 249 void OnPing(SpdyPingId unique_id, bool is_ack) override {}
249 void OnRstStream(SpdyStreamId stream_id, 250 void OnRstStream(SpdyStreamId stream_id,
250 SpdyRstStreamStatus status) override {} 251 SpdyRstStreamStatus status) override {}
251 void OnGoAway(SpdyStreamId last_accepted_stream_id, 252 void OnGoAway(SpdyStreamId last_accepted_stream_id,
252 SpdyGoAwayStatus status) override {} 253 SpdyGoAwayStatus status) override {}
253 void OnWindowUpdate(SpdyStreamId stream_id, 254 void OnWindowUpdate(SpdyStreamId stream_id,
254 uint32 delta_window_size) override {} 255 uint32 delta_window_size) override {}
255 void OnPushPromise(SpdyStreamId stream_id, 256 void OnPushPromise(SpdyStreamId stream_id,
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 SpdyFrame* SpdyTestUtil::ConstructSpdyBodyFrame(int stream_id, 1218 SpdyFrame* SpdyTestUtil::ConstructSpdyBodyFrame(int stream_id,
1218 const char* data, 1219 const char* data,
1219 uint32 len, 1220 uint32 len,
1220 bool fin) { 1221 bool fin) {
1221 SpdyFramer framer(spdy_version_); 1222 SpdyFramer framer(spdy_version_);
1222 SpdyDataIR data_ir(stream_id, base::StringPiece(data, len)); 1223 SpdyDataIR data_ir(stream_id, base::StringPiece(data, len));
1223 data_ir.set_fin(fin); 1224 data_ir.set_fin(fin);
1224 return framer.SerializeData(data_ir); 1225 return framer.SerializeData(data_ir);
1225 } 1226 }
1226 1227
1228 SpdyFrame* SpdyTestUtil::ConstructSpdyBodyFrame(int stream_id,
1229 const char* data,
1230 uint32 len,
1231 bool fin,
1232 int padding_length) {
1233 SpdyFramer framer(spdy_version_);
1234 SpdyDataIR data_ir(stream_id, base::StringPiece(data, len));
1235 data_ir.set_fin(fin);
1236 data_ir.set_padding_len(padding_length);
1237 return framer.SerializeData(data_ir);
1238 }
1239
1227 SpdyFrame* SpdyTestUtil::ConstructWrappedSpdyFrame( 1240 SpdyFrame* SpdyTestUtil::ConstructWrappedSpdyFrame(
1228 const scoped_ptr<SpdyFrame>& frame, 1241 const scoped_ptr<SpdyFrame>& frame,
1229 int stream_id) { 1242 int stream_id) {
1230 return ConstructSpdyBodyFrame(stream_id, frame->data(), 1243 return ConstructSpdyBodyFrame(stream_id, frame->data(),
1231 frame->size(), false); 1244 frame->size(), false);
1232 } 1245 }
1233 1246
1234 const SpdyHeaderInfo SpdyTestUtil::MakeSpdyHeader(SpdyFrameType type) { 1247 const SpdyHeaderInfo SpdyTestUtil::MakeSpdyHeader(SpdyFrameType type) {
1235 const SpdyHeaderInfo kHeader = { 1248 const SpdyHeaderInfo kHeader = {
1236 type, 1249 type,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 } 1328 }
1316 } 1329 }
1317 1330
1318 void SpdyTestUtil::SetPriority(RequestPriority priority, 1331 void SpdyTestUtil::SetPriority(RequestPriority priority,
1319 SpdySynStreamIR* ir) const { 1332 SpdySynStreamIR* ir) const {
1320 ir->set_priority(ConvertRequestPriorityToSpdyPriority( 1333 ir->set_priority(ConvertRequestPriorityToSpdyPriority(
1321 priority, spdy_version())); 1334 priority, spdy_version()));
1322 } 1335 }
1323 1336
1324 } // namespace net 1337 } // namespace net
OLDNEW
« no previous file with comments | « net/spdy/spdy_test_util_common.h ('k') | net/tools/flip_server/spdy_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698