OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/quic/test_tools/simple_quic_framer.h" | 5 #include "net/quic/test_tools/simple_quic_framer.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "net/quic/core/crypto/quic_decrypter.h" | 10 #include "net/quic/core/crypto/quic_decrypter.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override { | 99 bool OnWindowUpdateFrame(const QuicWindowUpdateFrame& frame) override { |
100 window_update_frames_.push_back(frame); | 100 window_update_frames_.push_back(frame); |
101 return true; | 101 return true; |
102 } | 102 } |
103 | 103 |
104 bool OnBlockedFrame(const QuicBlockedFrame& frame) override { | 104 bool OnBlockedFrame(const QuicBlockedFrame& frame) override { |
105 blocked_frames_.push_back(frame); | 105 blocked_frames_.push_back(frame); |
106 return true; | 106 return true; |
107 } | 107 } |
108 | 108 |
109 bool OnPathCloseFrame(const QuicPathCloseFrame& frame) override { | |
110 path_close_frames_.push_back(frame); | |
111 return true; | |
112 } | |
113 | |
114 void OnPacketComplete() override {} | 109 void OnPacketComplete() override {} |
115 | 110 |
116 const QuicPacketHeader& header() const { return header_; } | 111 const QuicPacketHeader& header() const { return header_; } |
117 const std::vector<QuicAckFrame>& ack_frames() const { return ack_frames_; } | 112 const std::vector<QuicAckFrame>& ack_frames() const { return ack_frames_; } |
118 const std::vector<QuicConnectionCloseFrame>& connection_close_frames() const { | 113 const std::vector<QuicConnectionCloseFrame>& connection_close_frames() const { |
119 return connection_close_frames_; | 114 return connection_close_frames_; |
120 } | 115 } |
121 const std::vector<QuicGoAwayFrame>& goaway_frames() const { | 116 const std::vector<QuicGoAwayFrame>& goaway_frames() const { |
122 return goaway_frames_; | 117 return goaway_frames_; |
123 } | 118 } |
(...skipping 20 matching lines...) Expand all Loading... |
144 std::vector<QuicAckFrame> ack_frames_; | 139 std::vector<QuicAckFrame> ack_frames_; |
145 std::vector<QuicStopWaitingFrame> stop_waiting_frames_; | 140 std::vector<QuicStopWaitingFrame> stop_waiting_frames_; |
146 std::vector<QuicPaddingFrame> padding_frames_; | 141 std::vector<QuicPaddingFrame> padding_frames_; |
147 std::vector<QuicPingFrame> ping_frames_; | 142 std::vector<QuicPingFrame> ping_frames_; |
148 std::vector<std::unique_ptr<QuicStreamFrame>> stream_frames_; | 143 std::vector<std::unique_ptr<QuicStreamFrame>> stream_frames_; |
149 std::vector<QuicRstStreamFrame> rst_stream_frames_; | 144 std::vector<QuicRstStreamFrame> rst_stream_frames_; |
150 std::vector<QuicGoAwayFrame> goaway_frames_; | 145 std::vector<QuicGoAwayFrame> goaway_frames_; |
151 std::vector<QuicConnectionCloseFrame> connection_close_frames_; | 146 std::vector<QuicConnectionCloseFrame> connection_close_frames_; |
152 std::vector<QuicWindowUpdateFrame> window_update_frames_; | 147 std::vector<QuicWindowUpdateFrame> window_update_frames_; |
153 std::vector<QuicBlockedFrame> blocked_frames_; | 148 std::vector<QuicBlockedFrame> blocked_frames_; |
154 std::vector<QuicPathCloseFrame> path_close_frames_; | |
155 std::vector<std::unique_ptr<string>> stream_data_; | 149 std::vector<std::unique_ptr<string>> stream_data_; |
156 | 150 |
157 DISALLOW_COPY_AND_ASSIGN(SimpleFramerVisitor); | 151 DISALLOW_COPY_AND_ASSIGN(SimpleFramerVisitor); |
158 }; | 152 }; |
159 | 153 |
160 SimpleQuicFramer::SimpleQuicFramer() | 154 SimpleQuicFramer::SimpleQuicFramer() |
161 : framer_(AllSupportedVersions(), | 155 : framer_(AllSupportedVersions(), |
162 QuicTime::Zero(), | 156 QuicTime::Zero(), |
163 Perspective::IS_SERVER) {} | 157 Perspective::IS_SERVER) {} |
164 | 158 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 return visitor_->goaway_frames(); | 222 return visitor_->goaway_frames(); |
229 } | 223 } |
230 | 224 |
231 const std::vector<QuicConnectionCloseFrame>& | 225 const std::vector<QuicConnectionCloseFrame>& |
232 SimpleQuicFramer::connection_close_frames() const { | 226 SimpleQuicFramer::connection_close_frames() const { |
233 return visitor_->connection_close_frames(); | 227 return visitor_->connection_close_frames(); |
234 } | 228 } |
235 | 229 |
236 } // namespace test | 230 } // namespace test |
237 } // namespace net | 231 } // namespace net |
OLD | NEW |