| 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_CHROMIUM_QUIC_CHROMIUM_PACKET_READER_H_ | 6 #ifndef NET_QUIC_CHROMIUM_QUIC_CHROMIUM_PACKET_READER_H_ |
| 7 #define NET_QUIC_CHROMIUM_QUIC_CHROMIUM_PACKET_READER_H_ | 7 #define NET_QUIC_CHROMIUM_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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 NetLogWithSource& 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 // Returns the estimated memory usage in bytes. |
| 53 size_t EstimateMemoryUsage() const; |
| 54 |
| 52 private: | 55 private: |
| 53 // A completion callback invoked when a read completes. | 56 // A completion callback invoked when a read completes. |
| 54 void OnReadComplete(int result); | 57 void OnReadComplete(int result); |
| 55 | 58 |
| 56 DatagramClientSocket* socket_; | 59 DatagramClientSocket* socket_; |
| 57 Visitor* visitor_; | 60 Visitor* visitor_; |
| 58 bool read_pending_; | 61 bool read_pending_; |
| 59 int num_packets_read_; | 62 int num_packets_read_; |
| 60 QuicClock* clock_; // Owned by QuicStreamFactory | 63 QuicClock* clock_; // Owned by QuicStreamFactory |
| 61 int yield_after_packets_; | 64 int yield_after_packets_; |
| 62 QuicTime::Delta yield_after_duration_; | 65 QuicTime::Delta yield_after_duration_; |
| 63 QuicTime yield_after_; | 66 QuicTime yield_after_; |
| 64 scoped_refptr<IOBufferWithSize> read_buffer_; | 67 scoped_refptr<IOBufferWithSize> read_buffer_; |
| 65 NetLogWithSource net_log_; | 68 NetLogWithSource net_log_; |
| 66 | 69 |
| 67 base::WeakPtrFactory<QuicChromiumPacketReader> weak_factory_; | 70 base::WeakPtrFactory<QuicChromiumPacketReader> weak_factory_; |
| 68 | 71 |
| 69 DISALLOW_COPY_AND_ASSIGN(QuicChromiumPacketReader); | 72 DISALLOW_COPY_AND_ASSIGN(QuicChromiumPacketReader); |
| 70 }; | 73 }; |
| 71 | 74 |
| 72 } // namespace net | 75 } // namespace net |
| 73 | 76 |
| 74 #endif // NET_QUIC_CHROMIUM_QUIC_CHROMIUM_PACKET_READER_H_ | 77 #endif // NET_QUIC_CHROMIUM_QUIC_CHROMIUM_PACKET_READER_H_ |
| OLD | NEW |