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 #ifndef NET_QUIC_QUIC_FRAMER_H_ | 5 #ifndef NET_QUIC_QUIC_FRAMER_H_ |
6 #define NET_QUIC_QUIC_FRAMER_H_ | 6 #define NET_QUIC_QUIC_FRAMER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // QuicFramerVisitorInterface that is called when packets are parsed. | 88 // QuicFramerVisitorInterface that is called when packets are parsed. |
89 // It also has a QuicFecBuilder that is called when packets are constructed | 89 // It also has a QuicFecBuilder that is called when packets are constructed |
90 // in order to generate FEC data for subsequently building FEC packets. | 90 // in order to generate FEC data for subsequently building FEC packets. |
91 class NET_EXPORT_PRIVATE QuicFramer { | 91 class NET_EXPORT_PRIVATE QuicFramer { |
92 public: | 92 public: |
93 // Constructs a new framer that will own |decrypter| and |encrypter|. | 93 // Constructs a new framer that will own |decrypter| and |encrypter|. |
94 QuicFramer(QuicDecrypter* decrypter, QuicEncrypter* encrypter); | 94 QuicFramer(QuicDecrypter* decrypter, QuicEncrypter* encrypter); |
95 | 95 |
96 virtual ~QuicFramer(); | 96 virtual ~QuicFramer(); |
97 | 97 |
98 // Calculates the largest received packet to advertise in the case an Ack | 98 // Calculates the largest observed packet to advertise in the case an Ack |
99 // Frame was truncated. last_written in this case is the iterator for the | 99 // Frame was truncated. last_written in this case is the iterator for the |
100 // last missing packet which fit in the outgoing ack. | 100 // last missing packet which fit in the outgoing ack. |
101 static QuicPacketSequenceNumber CalculateLargestReceived( | 101 static QuicPacketSequenceNumber CalculateLargestObserved( |
102 const SequenceSet& missing_packets, | 102 const SequenceSet& missing_packets, |
103 SequenceSet::const_iterator last_written); | 103 SequenceSet::const_iterator last_written); |
104 | 104 |
105 // Set callbacks to be called from the framer. A visitor must be set, or | 105 // Set callbacks to be called from the framer. A visitor must be set, or |
106 // else the framer will likely crash. It is acceptable for the visitor | 106 // else the framer will likely crash. It is acceptable for the visitor |
107 // to do nothing. If this is called multiple times, only the last visitor | 107 // to do nothing. If this is called multiple times, only the last visitor |
108 // will be used. | 108 // will be used. |
109 void set_visitor(QuicFramerVisitorInterface* visitor) { | 109 void set_visitor(QuicFramerVisitorInterface* visitor) { |
110 visitor_ = visitor; | 110 visitor_ = visitor; |
111 } | 111 } |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 scoped_ptr<QuicDecrypter> decrypter_; | 224 scoped_ptr<QuicDecrypter> decrypter_; |
225 // Encrypter used to encrypt packets via EncryptPacket(). | 225 // Encrypter used to encrypt packets via EncryptPacket(). |
226 scoped_ptr<QuicEncrypter> encrypter_; | 226 scoped_ptr<QuicEncrypter> encrypter_; |
227 | 227 |
228 DISALLOW_COPY_AND_ASSIGN(QuicFramer); | 228 DISALLOW_COPY_AND_ASSIGN(QuicFramer); |
229 }; | 229 }; |
230 | 230 |
231 } // namespace net | 231 } // namespace net |
232 | 232 |
233 #endif // NET_QUIC_QUIC_FRAMER_H_ | 233 #endif // NET_QUIC_QUIC_FRAMER_H_ |
OLD | NEW |