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 <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <cstddef> | 9 #include <cstddef> |
10 #include <utility> | 10 #include <utility> |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 // TODO(jgraettinger): Eliminate uses of this method in tests (prefer | 780 // TODO(jgraettinger): Eliminate uses of this method in tests (prefer |
781 // SpdyRstStreamIR). | 781 // SpdyRstStreamIR). |
782 SpdySerializedFrame SpdyTestUtil::ConstructSpdyRstStream( | 782 SpdySerializedFrame SpdyTestUtil::ConstructSpdyRstStream( |
783 SpdyStreamId stream_id, | 783 SpdyStreamId stream_id, |
784 SpdyRstStreamStatus status) { | 784 SpdyRstStreamStatus status) { |
785 SpdyRstStreamIR rst_ir(stream_id, status); | 785 SpdyRstStreamIR rst_ir(stream_id, status); |
786 return SpdySerializedFrame( | 786 return SpdySerializedFrame( |
787 headerless_spdy_framer_.SerializeRstStream(rst_ir)); | 787 headerless_spdy_framer_.SerializeRstStream(rst_ir)); |
788 } | 788 } |
789 | 789 |
| 790 // TODO(jgraettinger): Eliminate uses of this method in tests (prefer |
| 791 // SpdyPriorityIR). |
| 792 SpdySerializedFrame SpdyTestUtil::ConstructSpdyPriority( |
| 793 SpdyStreamId stream_id, |
| 794 SpdyStreamId parent_stream_id, |
| 795 RequestPriority request_priority, |
| 796 bool exclusive) { |
| 797 int weight = Spdy3PriorityToHttp2Weight( |
| 798 ConvertRequestPriorityToSpdyPriority(request_priority)); |
| 799 SpdyPriorityIR ir(stream_id, parent_stream_id, weight, exclusive); |
| 800 return SpdySerializedFrame(headerless_spdy_framer_.SerializePriority(ir)); |
| 801 } |
| 802 |
790 SpdySerializedFrame SpdyTestUtil::ConstructSpdyGet( | 803 SpdySerializedFrame SpdyTestUtil::ConstructSpdyGet( |
791 const char* const url, | 804 const char* const url, |
792 SpdyStreamId stream_id, | 805 SpdyStreamId stream_id, |
793 RequestPriority request_priority) { | 806 RequestPriority request_priority) { |
794 SpdyHeaderBlock block(ConstructGetHeaderBlock(url)); | 807 SpdyHeaderBlock block(ConstructGetHeaderBlock(url)); |
795 return ConstructSpdyHeaders(stream_id, std::move(block), request_priority, | 808 return ConstructSpdyHeaders(stream_id, std::move(block), request_priority, |
796 true); | 809 true); |
797 } | 810 } |
798 | 811 |
799 SpdySerializedFrame SpdyTestUtil::ConstructSpdyGet( | 812 SpdySerializedFrame SpdyTestUtil::ConstructSpdyGet( |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1109 headers[GetSchemeKey()] = scheme.c_str(); | 1122 headers[GetSchemeKey()] = scheme.c_str(); |
1110 headers[GetPathKey()] = path.c_str(); | 1123 headers[GetPathKey()] = path.c_str(); |
1111 if (content_length) { | 1124 if (content_length) { |
1112 std::string length_str = base::Int64ToString(*content_length); | 1125 std::string length_str = base::Int64ToString(*content_length); |
1113 headers["content-length"] = length_str; | 1126 headers["content-length"] = length_str; |
1114 } | 1127 } |
1115 return headers; | 1128 return headers; |
1116 } | 1129 } |
1117 | 1130 |
1118 } // namespace net | 1131 } // namespace net |
OLD | NEW |