OLD | NEW |
---|---|
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 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1095 const char* const extra_headers[], | 1095 const char* const extra_headers[], |
1096 int extra_header_count) { | 1096 int extra_header_count) { |
1097 SpdyHeadersIR headers(stream_id); | 1097 SpdyHeadersIR headers(stream_id); |
1098 headers.SetHeader(GetStatusKey(), "200 OK"); | 1098 headers.SetHeader(GetStatusKey(), "200 OK"); |
1099 MaybeAddVersionHeader(&headers); | 1099 MaybeAddVersionHeader(&headers); |
1100 AppendToHeaderBlock(extra_headers, extra_header_count, | 1100 AppendToHeaderBlock(extra_headers, extra_header_count, |
1101 headers.mutable_name_value_block()); | 1101 headers.mutable_name_value_block()); |
1102 return CreateFramer(false)->SerializeFrame(headers); | 1102 return CreateFramer(false)->SerializeFrame(headers); |
1103 } | 1103 } |
1104 | 1104 |
1105 SpdyFrame* SpdyTestUtil::ConstructSpdyHeaderFrame(int stream_id, | |
1106 const char* const headers[], | |
1107 int header_count) { | |
1108 SpdyHeadersIR spdy_headers(stream_id); | |
1109 AppendToHeaderBlock(headers, header_count, | |
1110 spdy_headers.mutable_name_value_block()); | |
Bence
2015/08/06 18:26:25
You'll need to rebase on https://crrev.com/1263803
xunjieli
2015/08/06 21:02:00
Done.
| |
1111 return CreateFramer(false)->SerializeFrame(spdy_headers); | |
1112 } | |
1113 | |
1105 SpdyFrame* SpdyTestUtil::ConstructSpdySyn(int stream_id, | 1114 SpdyFrame* SpdyTestUtil::ConstructSpdySyn(int stream_id, |
1106 const SpdyHeaderBlock& block, | 1115 const SpdyHeaderBlock& block, |
1107 RequestPriority priority, | 1116 RequestPriority priority, |
1108 bool compressed, | 1117 bool compressed, |
1109 bool fin) const { | 1118 bool fin) const { |
1110 if (protocol_ < kProtoHTTP2MinimumVersion) { | 1119 if (protocol_ < kProtoHTTP2MinimumVersion) { |
1111 SpdySynStreamIR syn_stream(stream_id); | 1120 SpdySynStreamIR syn_stream(stream_id); |
1112 syn_stream.set_name_value_block(block); | 1121 syn_stream.set_name_value_block(block); |
1113 syn_stream.set_priority( | 1122 syn_stream.set_priority( |
1114 ConvertRequestPriorityToSpdyPriority(priority, spdy_version())); | 1123 ConvertRequestPriorityToSpdyPriority(priority, spdy_version())); |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1328 } | 1337 } |
1329 } | 1338 } |
1330 | 1339 |
1331 void SpdyTestUtil::SetPriority(RequestPriority priority, | 1340 void SpdyTestUtil::SetPriority(RequestPriority priority, |
1332 SpdySynStreamIR* ir) const { | 1341 SpdySynStreamIR* ir) const { |
1333 ir->set_priority(ConvertRequestPriorityToSpdyPriority( | 1342 ir->set_priority(ConvertRequestPriorityToSpdyPriority( |
1334 priority, spdy_version())); | 1343 priority, spdy_version())); |
1335 } | 1344 } |
1336 | 1345 |
1337 } // namespace net | 1346 } // namespace net |
OLD | NEW |