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 "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "net/quic/crypto/crypto_framer.h" | 8 #include "net/quic/crypto/crypto_framer.h" |
9 #include "net/quic/crypto/quic_decrypter.h" | 9 #include "net/quic/crypto/quic_decrypter.h" |
10 #include "net/quic/crypto/quic_encrypter.h" | 10 #include "net/quic/crypto/quic_encrypter.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 vector<QuicGoAwayFrame> goaway_frames_; | 158 vector<QuicGoAwayFrame> goaway_frames_; |
159 vector<QuicConnectionCloseFrame> connection_close_frames_; | 159 vector<QuicConnectionCloseFrame> connection_close_frames_; |
160 vector<QuicWindowUpdateFrame> window_update_frames_; | 160 vector<QuicWindowUpdateFrame> window_update_frames_; |
161 vector<QuicBlockedFrame> blocked_frames_; | 161 vector<QuicBlockedFrame> blocked_frames_; |
162 vector<string*> stream_data_; | 162 vector<string*> stream_data_; |
163 | 163 |
164 DISALLOW_COPY_AND_ASSIGN(SimpleFramerVisitor); | 164 DISALLOW_COPY_AND_ASSIGN(SimpleFramerVisitor); |
165 }; | 165 }; |
166 | 166 |
167 SimpleQuicFramer::SimpleQuicFramer() | 167 SimpleQuicFramer::SimpleQuicFramer() |
168 : framer_(QuicSupportedVersions(), QuicTime::Zero(), true) { | 168 : framer_(QuicSupportedVersions(), |
| 169 QuicTime::Zero(), |
| 170 Perspective::IS_SERVER) { |
169 } | 171 } |
170 | 172 |
171 SimpleQuicFramer::SimpleQuicFramer(const QuicVersionVector& supported_versions) | 173 SimpleQuicFramer::SimpleQuicFramer(const QuicVersionVector& supported_versions) |
172 : framer_(supported_versions, QuicTime::Zero(), true) { | 174 : framer_(supported_versions, QuicTime::Zero(), Perspective::IS_SERVER) { |
173 } | 175 } |
174 | 176 |
175 SimpleQuicFramer::~SimpleQuicFramer() { | 177 SimpleQuicFramer::~SimpleQuicFramer() { |
176 } | 178 } |
177 | 179 |
178 bool SimpleQuicFramer::ProcessPacket(const QuicEncryptedPacket& packet) { | 180 bool SimpleQuicFramer::ProcessPacket(const QuicEncryptedPacket& packet) { |
179 visitor_.reset(new SimpleFramerVisitor); | 181 visitor_.reset(new SimpleFramerVisitor); |
180 framer_.set_visitor(visitor_.get()); | 182 framer_.set_visitor(visitor_.get()); |
181 return framer_.ProcessPacket(packet); | 183 return framer_.ProcessPacket(packet); |
182 } | 184 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 return visitor_->goaway_frames(); | 241 return visitor_->goaway_frames(); |
240 } | 242 } |
241 | 243 |
242 const vector<QuicConnectionCloseFrame>& | 244 const vector<QuicConnectionCloseFrame>& |
243 SimpleQuicFramer::connection_close_frames() const { | 245 SimpleQuicFramer::connection_close_frames() const { |
244 return visitor_->connection_close_frames(); | 246 return visitor_->connection_close_frames(); |
245 } | 247 } |
246 | 248 |
247 } // namespace test | 249 } // namespace test |
248 } // namespace net | 250 } // namespace net |
OLD | NEW |