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

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

Issue 2675593002: Spdy{RstStream,GoAway}Status -> SpdyErrorCode. (Closed)
Patch Set: Merged master, which includes 145087791. Created 3 years, 10 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 size_t length, 206 size_t length,
207 bool fin) override {} 207 bool fin) override {}
208 void OnStreamFrameData(SpdyStreamId stream_id, 208 void OnStreamFrameData(SpdyStreamId stream_id,
209 const char* data, 209 const char* data,
210 size_t len) override {} 210 size_t len) override {}
211 void OnStreamEnd(SpdyStreamId stream_id) override {} 211 void OnStreamEnd(SpdyStreamId stream_id) override {}
212 void OnStreamPadding(SpdyStreamId stream_id, size_t len) override {} 212 void OnStreamPadding(SpdyStreamId stream_id, size_t len) override {}
213 void OnSettings() override {} 213 void OnSettings() override {}
214 void OnSetting(SpdySettingsIds id, uint32_t value) override {} 214 void OnSetting(SpdySettingsIds id, uint32_t value) override {}
215 void OnPing(SpdyPingId unique_id, bool is_ack) override {} 215 void OnPing(SpdyPingId unique_id, bool is_ack) override {}
216 void OnRstStream(SpdyStreamId stream_id, 216 void OnRstStream(SpdyStreamId stream_id, SpdyErrorCode error_code) override {}
217 SpdyRstStreamStatus status) override {}
218 void OnGoAway(SpdyStreamId last_accepted_stream_id, 217 void OnGoAway(SpdyStreamId last_accepted_stream_id,
219 SpdyGoAwayStatus status, 218 SpdyErrorCode error_code,
220 base::StringPiece debug_data) override {} 219 base::StringPiece debug_data) override {}
221 void OnWindowUpdate(SpdyStreamId stream_id, int delta_window_size) override {} 220 void OnWindowUpdate(SpdyStreamId stream_id, int delta_window_size) override {}
222 void OnPushPromise(SpdyStreamId stream_id, 221 void OnPushPromise(SpdyStreamId stream_id,
223 SpdyStreamId promised_stream_id, 222 SpdyStreamId promised_stream_id,
224 SpdyHeaderBlock headers) override {} 223 SpdyHeaderBlock headers) override {}
225 void OnAltSvc(SpdyStreamId stream_id, 224 void OnAltSvc(SpdyStreamId stream_id,
226 base::StringPiece origin, 225 base::StringPiece origin,
227 const SpdyAltSvcWireFormat::AlternativeServiceVector& 226 const SpdyAltSvcWireFormat::AlternativeServiceVector&
228 altsvc_vector) override {} 227 altsvc_vector) override {}
229 bool OnUnknownFrame(SpdyStreamId stream_id, uint8_t frame_type) override { 228 bool OnUnknownFrame(SpdyStreamId stream_id, uint8_t frame_type) override {
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 ping_ir.set_is_ack(is_ack); 755 ping_ir.set_is_ack(is_ack);
757 return SpdySerializedFrame(headerless_spdy_framer_.SerializeFrame(ping_ir)); 756 return SpdySerializedFrame(headerless_spdy_framer_.SerializeFrame(ping_ir));
758 } 757 }
759 758
760 SpdySerializedFrame SpdyTestUtil::ConstructSpdyGoAway() { 759 SpdySerializedFrame SpdyTestUtil::ConstructSpdyGoAway() {
761 return ConstructSpdyGoAway(0); 760 return ConstructSpdyGoAway(0);
762 } 761 }
763 762
764 SpdySerializedFrame SpdyTestUtil::ConstructSpdyGoAway( 763 SpdySerializedFrame SpdyTestUtil::ConstructSpdyGoAway(
765 SpdyStreamId last_good_stream_id) { 764 SpdyStreamId last_good_stream_id) {
766 SpdyGoAwayIR go_ir(last_good_stream_id, GOAWAY_NO_ERROR, "go away"); 765 SpdyGoAwayIR go_ir(last_good_stream_id, ERROR_CODE_NO_ERROR, "go away");
767 return SpdySerializedFrame(headerless_spdy_framer_.SerializeFrame(go_ir)); 766 return SpdySerializedFrame(headerless_spdy_framer_.SerializeFrame(go_ir));
768 } 767 }
769 768
770 SpdySerializedFrame SpdyTestUtil::ConstructSpdyGoAway( 769 SpdySerializedFrame SpdyTestUtil::ConstructSpdyGoAway(
771 SpdyStreamId last_good_stream_id, 770 SpdyStreamId last_good_stream_id,
772 SpdyGoAwayStatus status, 771 SpdyErrorCode error_code,
773 const std::string& desc) { 772 const std::string& desc) {
774 SpdyGoAwayIR go_ir(last_good_stream_id, status, desc); 773 SpdyGoAwayIR go_ir(last_good_stream_id, error_code, desc);
775 return SpdySerializedFrame(headerless_spdy_framer_.SerializeFrame(go_ir)); 774 return SpdySerializedFrame(headerless_spdy_framer_.SerializeFrame(go_ir));
776 } 775 }
777 776
778 SpdySerializedFrame SpdyTestUtil::ConstructSpdyWindowUpdate( 777 SpdySerializedFrame SpdyTestUtil::ConstructSpdyWindowUpdate(
779 const SpdyStreamId stream_id, 778 const SpdyStreamId stream_id,
780 uint32_t delta_window_size) { 779 uint32_t delta_window_size) {
781 SpdyWindowUpdateIR update_ir(stream_id, delta_window_size); 780 SpdyWindowUpdateIR update_ir(stream_id, delta_window_size);
782 return SpdySerializedFrame(headerless_spdy_framer_.SerializeFrame(update_ir)); 781 return SpdySerializedFrame(headerless_spdy_framer_.SerializeFrame(update_ir));
783 } 782 }
784 783
785 // TODO(jgraettinger): Eliminate uses of this method in tests (prefer 784 // TODO(jgraettinger): Eliminate uses of this method in tests (prefer
786 // SpdyRstStreamIR). 785 // SpdyRstStreamIR).
787 SpdySerializedFrame SpdyTestUtil::ConstructSpdyRstStream( 786 SpdySerializedFrame SpdyTestUtil::ConstructSpdyRstStream(
788 SpdyStreamId stream_id, 787 SpdyStreamId stream_id,
789 SpdyRstStreamStatus status) { 788 SpdyErrorCode error_code) {
790 SpdyRstStreamIR rst_ir(stream_id, status); 789 SpdyRstStreamIR rst_ir(stream_id, error_code);
791 return SpdySerializedFrame( 790 return SpdySerializedFrame(
792 headerless_spdy_framer_.SerializeRstStream(rst_ir)); 791 headerless_spdy_framer_.SerializeRstStream(rst_ir));
793 } 792 }
794 793
795 // TODO(jgraettinger): Eliminate uses of this method in tests (prefer 794 // TODO(jgraettinger): Eliminate uses of this method in tests (prefer
796 // SpdyPriorityIR). 795 // SpdyPriorityIR).
797 SpdySerializedFrame SpdyTestUtil::ConstructSpdyPriority( 796 SpdySerializedFrame SpdyTestUtil::ConstructSpdyPriority(
798 SpdyStreamId stream_id, 797 SpdyStreamId stream_id,
799 SpdyStreamId parent_stream_id, 798 SpdyStreamId parent_stream_id,
800 RequestPriority request_priority, 799 RequestPriority request_priority,
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
1127 headers[GetSchemeKey()] = scheme.c_str(); 1126 headers[GetSchemeKey()] = scheme.c_str();
1128 headers[GetPathKey()] = path.c_str(); 1127 headers[GetPathKey()] = path.c_str();
1129 if (content_length) { 1128 if (content_length) {
1130 std::string length_str = base::Int64ToString(*content_length); 1129 std::string length_str = base::Int64ToString(*content_length);
1131 headers["content-length"] = length_str; 1130 headers["content-length"] = length_str;
1132 } 1131 }
1133 return headers; 1132 return headers;
1134 } 1133 }
1135 1134
1136 } // namespace net 1135 } // 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