Chromium Code Reviews| 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 // The entity that handles framing writes for a Quic client or server. | 5 // The entity that handles framing writes for a Quic client or server. |
| 6 // Each QuicSession will have a connection associated with it. | 6 // Each QuicSession will have a connection associated with it. |
| 7 // | 7 // |
| 8 // On the server side, the Dispatcher handles the raw reads, and hands off | 8 // On the server side, the Dispatcher handles the raw reads, and hands off |
| 9 // packets via ProcessUdpPacket for framing and processing. | 9 // packets via ProcessUdpPacket for framing and processing. |
| 10 // | 10 // |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 299 | 299 |
| 300 // Called when a packet has been finally sent to the network. | 300 // Called when a packet has been finally sent to the network. |
| 301 bool OnPacketSent(WriteResult result); | 301 bool OnPacketSent(WriteResult result); |
| 302 | 302 |
| 303 // If the socket is not blocked, writes queued packets. | 303 // If the socket is not blocked, writes queued packets. |
| 304 void WriteIfNotBlocked(); | 304 void WriteIfNotBlocked(); |
| 305 | 305 |
| 306 // Do any work which logically would be done in OnPacket but can not be | 306 // Do any work which logically would be done in OnPacket but can not be |
| 307 // safely done until the packet is validated. Returns true if the packet | 307 // safely done until the packet is validated. Returns true if the packet |
| 308 // can be handled, false otherwise. | 308 // can be handled, false otherwise. |
| 309 bool ProcessValidatedPacket(); | 309 virtual bool ProcessValidatedPacket(); |
|
wtc
2014/07/02 22:56:48
Why does this method need to be virtual? I don't s
ramant (doing other things)
2014/07/16 19:43:35
Our internal code override's this method. It is no
| |
| 310 | 310 |
| 311 // The version of the protocol this connection is using. | 311 // The version of the protocol this connection is using. |
| 312 QuicVersion version() const { return framer_.version(); } | 312 QuicVersion version() const { return framer_.version(); } |
| 313 | 313 |
| 314 // The versions of the protocol that this connection supports. | 314 // The versions of the protocol that this connection supports. |
| 315 const QuicVersionVector& supported_versions() const { | 315 const QuicVersionVector& supported_versions() const { |
| 316 return framer_.supported_versions(); | 316 return framer_.supported_versions(); |
| 317 } | 317 } |
| 318 | 318 |
| 319 // From QuicFramerVisitorInterface | 319 // From QuicFramerVisitorInterface |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 505 | 505 |
| 506 QuicConnectionHelperInterface* helper() { return helper_; } | 506 QuicConnectionHelperInterface* helper() { return helper_; } |
| 507 | 507 |
| 508 // Selects and updates the version of the protocol being used by selecting a | 508 // Selects and updates the version of the protocol being used by selecting a |
| 509 // version from |available_versions| which is also supported. Returns true if | 509 // version from |available_versions| which is also supported. Returns true if |
| 510 // such a version exists, false otherwise. | 510 // such a version exists, false otherwise. |
| 511 bool SelectMutualVersion(const QuicVersionVector& available_versions); | 511 bool SelectMutualVersion(const QuicVersionVector& available_versions); |
| 512 | 512 |
| 513 QuicPacketWriter* writer() { return writer_; } | 513 QuicPacketWriter* writer() { return writer_; } |
| 514 | 514 |
| 515 bool peer_port_changed() const { return peer_port_changed_; } | |
| 516 | |
| 517 const QuicReceivedPacketManager& received_packet_manager() { | |
|
wtc
2014/07/02 22:56:48
Mark this method const?
ramant (doing other things)
2014/07/16 19:43:35
Done.
| |
| 518 return received_packet_manager_; | |
| 519 } | |
| 520 | |
| 521 QuicPacketSequenceNumber sequence_number_of_last_sent_packet() const { | |
| 522 return sequence_number_of_last_sent_packet_; | |
| 523 } | |
| 524 | |
| 515 private: | 525 private: |
| 516 friend class test::QuicConnectionPeer; | 526 friend class test::QuicConnectionPeer; |
| 517 | 527 |
| 518 // Packets which have not been written to the wire. | 528 // Packets which have not been written to the wire. |
| 519 // Owns the QuicPacket* packet. | 529 // Owns the QuicPacket* packet. |
| 520 struct QueuedPacket { | 530 struct QueuedPacket { |
| 521 QueuedPacket(SerializedPacket packet, | 531 QueuedPacket(SerializedPacket packet, |
| 522 EncryptionLevel level, | 532 EncryptionLevel level, |
| 523 TransmissionType transmission_type); | 533 TransmissionType transmission_type); |
| 524 | 534 |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 763 // If non-empty this contains the set of versions received in a | 773 // If non-empty this contains the set of versions received in a |
| 764 // version negotiation packet. | 774 // version negotiation packet. |
| 765 QuicVersionVector server_supported_versions_; | 775 QuicVersionVector server_supported_versions_; |
| 766 | 776 |
| 767 DISALLOW_COPY_AND_ASSIGN(QuicConnection); | 777 DISALLOW_COPY_AND_ASSIGN(QuicConnection); |
| 768 }; | 778 }; |
| 769 | 779 |
| 770 } // namespace net | 780 } // namespace net |
| 771 | 781 |
| 772 #endif // NET_QUIC_QUIC_CONNECTION_H_ | 782 #endif // NET_QUIC_QUIC_CONNECTION_H_ |
| OLD | NEW |