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

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

Issue 2596703002: http2: Update priorities of pushed streams (Closed)
Patch Set: actually rebase Created 3 years, 11 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') | 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 <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
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
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
OLDNEW
« no previous file with comments | « 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