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

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

Issue 1326503003: Added a net::BidirectionalStream to expose a bidirectional streaming interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 headers.SetHeader(GetStatusKey(), "200 OK"); 1103 headers.SetHeader(GetStatusKey(), "200 OK");
1104 MaybeAddVersionHeader(&headers); 1104 MaybeAddVersionHeader(&headers);
1105 AppendToHeaderBlock(extra_headers, extra_header_count, 1105 AppendToHeaderBlock(extra_headers, extra_header_count,
1106 headers.mutable_header_block()); 1106 headers.mutable_header_block());
1107 return CreateFramer(false)->SerializeFrame(headers); 1107 return CreateFramer(false)->SerializeFrame(headers);
1108 } 1108 }
1109 1109
1110 SpdyFrame* SpdyTestUtil::ConstructSpdyHeaderFrame(int stream_id, 1110 SpdyFrame* SpdyTestUtil::ConstructSpdyHeaderFrame(int stream_id,
1111 const char* const headers[], 1111 const char* const headers[],
1112 int header_count) { 1112 int header_count) {
1113 return ConstructSpdyHeaderFrame(stream_id, headers, header_count, false);
1114 }
1115
1116 SpdyFrame* SpdyTestUtil::ConstructSpdyHeaderFrame(int stream_id,
1117 const char* const headers[],
1118 int header_count,
1119 bool fin) {
1113 SpdyHeadersIR spdy_headers(stream_id); 1120 SpdyHeadersIR spdy_headers(stream_id);
1121 spdy_headers.set_fin(fin);
1114 AppendToHeaderBlock(headers, header_count, 1122 AppendToHeaderBlock(headers, header_count,
1115 spdy_headers.mutable_header_block()); 1123 spdy_headers.mutable_header_block());
1116 return CreateFramer(false)->SerializeFrame(spdy_headers); 1124 return CreateFramer(false)->SerializeFrame(spdy_headers);
1117 } 1125 }
1118 1126
1119 SpdyFrame* SpdyTestUtil::ConstructSpdySyn(int stream_id, 1127 SpdyFrame* SpdyTestUtil::ConstructSpdySyn(int stream_id,
1120 const SpdyHeaderBlock& block, 1128 const SpdyHeaderBlock& block,
1121 RequestPriority priority, 1129 RequestPriority priority,
1122 bool compressed, 1130 bool compressed,
1123 bool fin) const { 1131 bool fin) const {
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
1342 } 1350 }
1343 } 1351 }
1344 1352
1345 void SpdyTestUtil::SetPriority(RequestPriority priority, 1353 void SpdyTestUtil::SetPriority(RequestPriority priority,
1346 SpdySynStreamIR* ir) const { 1354 SpdySynStreamIR* ir) const {
1347 ir->set_priority(ConvertRequestPriorityToSpdyPriority( 1355 ir->set_priority(ConvertRequestPriorityToSpdyPriority(
1348 priority, spdy_version())); 1356 priority, spdy_version()));
1349 } 1357 }
1350 1358
1351 } // namespace net 1359 } // namespace net
OLDNEW
« net/http/http_stream_factory_impl_unittest.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