Index: net/tools/quic/quic_client.h |
diff --git a/net/tools/quic/quic_client.h b/net/tools/quic/quic_client.h |
index d2fdd21cdcec7598aed44d5d1a0550692f53fba8..186164e78f0547a7cfc50455ba37ddf8706e138c 100644 |
--- a/net/tools/quic/quic_client.h |
+++ b/net/tools/quic/quic_client.h |
@@ -20,6 +20,7 @@ |
#include "net/tools/balsa/balsa_headers.h" |
#include "net/tools/epoll_server/epoll_server.h" |
#include "net/tools/quic/quic_client_base.h" |
+#include "net/tools/quic/quic_packet_reader.h" |
namespace net { |
@@ -35,7 +36,8 @@ class QuicClientPeer; |
class QuicClient : public QuicClientBase, |
public EpollCallbackInterface, |
- public QuicDataStream::Visitor { |
+ public QuicDataStream::Visitor, |
+ public ProcessPacketInterface { |
public: |
class ResponseListener { |
public: |
@@ -165,9 +167,16 @@ class QuicClient : public QuicClientBase, |
const std::string& latest_response_headers() const; |
const std::string& latest_response_body() const; |
+ // Implements ProcessPacketInterface. This will be called for each received |
+ // packet. |
+ void ProcessPacket(const IPEndPoint& self_address, |
+ const IPEndPoint& peer_address, |
+ const QuicEncryptedPacket& packet) override; |
+ |
protected: |
virtual QuicEpollConnectionHelper* CreateQuicConnectionHelper(); |
virtual QuicPacketWriter* CreateQuicPacketWriter(); |
+ virtual QuicPacketReader* CreateQuicPacketReader(); |
virtual int ReadPacket(char* buffer, |
int buffer_len, |
@@ -215,6 +224,10 @@ class QuicClient : public QuicClientBase, |
// Read a UDP packet and hand it to the framer. |
bool ReadAndProcessPacket(); |
+ // Read available UDP packets up to kNumPacketsPerReadCall |
+ // and hand them to the connection. |
+ bool ReadAndProcessPackets(); |
+ |
// Address of the server. |
const IPEndPoint server_address_; |
@@ -264,6 +277,10 @@ class QuicClient : public QuicClientBase, |
// must be resent upon a subsequent successful connection. |
std::vector<QuicDataToResend*> data_to_resend_on_connect_; |
+ // Point to a QuicPacketReader object on the heap. The reader allocates more |
+ // space than allowed on the stack. |
+ scoped_ptr<QuicPacketReader> packet_reader_; |
+ |
DISALLOW_COPY_AND_ASSIGN(QuicClient); |
}; |