| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 | 5 |
| 6 #ifndef NET_QUIC_QUIC_CHROMIUM_PACKET_READER_H_ | 6 #ifndef NET_QUIC_QUIC_CHROMIUM_PACKET_READER_H_ |
| 7 #define NET_QUIC_QUIC_CHROMIUM_PACKET_READER_H_ | 7 #define NET_QUIC_QUIC_CHROMIUM_PACKET_READER_H_ |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 virtual bool OnPacket(const QuicReceivedPacket& packet, | 35 virtual bool OnPacket(const QuicReceivedPacket& packet, |
| 36 IPEndPoint local_address, | 36 IPEndPoint local_address, |
| 37 IPEndPoint peer_address) = 0; | 37 IPEndPoint peer_address) = 0; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 QuicChromiumPacketReader(DatagramClientSocket* socket, | 40 QuicChromiumPacketReader(DatagramClientSocket* socket, |
| 41 QuicClock* clock, | 41 QuicClock* clock, |
| 42 Visitor* visitor, | 42 Visitor* visitor, |
| 43 int yield_after_packets, | 43 int yield_after_packets, |
| 44 QuicTime::Delta yield_after_duration, | 44 QuicTime::Delta yield_after_duration, |
| 45 const BoundNetLog& net_log); | 45 const NetLogWithSource& net_log); |
| 46 virtual ~QuicChromiumPacketReader(); | 46 virtual ~QuicChromiumPacketReader(); |
| 47 | 47 |
| 48 // Causes the QuicConnectionHelper to start reading from the socket | 48 // Causes the QuicConnectionHelper to start reading from the socket |
| 49 // and passing the data along to the QuicConnection. | 49 // and passing the data along to the QuicConnection. |
| 50 void StartReading(); | 50 void StartReading(); |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 // A completion callback invoked when a read completes. | 53 // A completion callback invoked when a read completes. |
| 54 void OnReadComplete(int result); | 54 void OnReadComplete(int result); |
| 55 | 55 |
| 56 DatagramClientSocket* socket_; | 56 DatagramClientSocket* socket_; |
| 57 Visitor* visitor_; | 57 Visitor* visitor_; |
| 58 bool read_pending_; | 58 bool read_pending_; |
| 59 int num_packets_read_; | 59 int num_packets_read_; |
| 60 QuicClock* clock_; // Owned by QuicStreamFactory | 60 QuicClock* clock_; // Owned by QuicStreamFactory |
| 61 int yield_after_packets_; | 61 int yield_after_packets_; |
| 62 QuicTime::Delta yield_after_duration_; | 62 QuicTime::Delta yield_after_duration_; |
| 63 QuicTime yield_after_; | 63 QuicTime yield_after_; |
| 64 scoped_refptr<IOBufferWithSize> read_buffer_; | 64 scoped_refptr<IOBufferWithSize> read_buffer_; |
| 65 BoundNetLog net_log_; | 65 NetLogWithSource net_log_; |
| 66 | 66 |
| 67 base::WeakPtrFactory<QuicChromiumPacketReader> weak_factory_; | 67 base::WeakPtrFactory<QuicChromiumPacketReader> weak_factory_; |
| 68 | 68 |
| 69 DISALLOW_COPY_AND_ASSIGN(QuicChromiumPacketReader); | 69 DISALLOW_COPY_AND_ASSIGN(QuicChromiumPacketReader); |
| 70 }; | 70 }; |
| 71 | 71 |
| 72 } // namespace net | 72 } // namespace net |
| 73 | 73 |
| 74 #endif // NET_QUIC_QUIC_CHROMIUM_PACKET_READER_H_ | 74 #endif // NET_QUIC_QUIC_CHROMIUM_PACKET_READER_H_ |
| OLD | NEW |