| Index: net/tools/quic/quic_client.h
|
| diff --git a/net/tools/quic/quic_client.h b/net/tools/quic/quic_client.h
|
| index c77b60c45e64edeb5cb96d2efabcdcc09ac3fcc4..a90da7c81c57d7f45924320acb5b4085207165ad 100644
|
| --- a/net/tools/quic/quic_client.h
|
| +++ b/net/tools/quic/quic_client.h
|
| @@ -22,6 +22,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 {
|
|
|
| @@ -37,7 +38,8 @@ class QuicClientPeer;
|
|
|
| class QuicClient : public QuicClientBase,
|
| public EpollCallbackInterface,
|
| - public QuicSpdyStream::Visitor {
|
| + public QuicSpdyStream::Visitor,
|
| + public ProcessPacketInterface {
|
| public:
|
| class ResponseListener {
|
| public:
|
| @@ -174,8 +176,15 @@ class QuicClient : public QuicClientBase,
|
| const std::string& latest_response_body() const;
|
| const std::string& latest_response_trailers() 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 QuicPacketWriter* CreateQuicPacketWriter();
|
| + virtual QuicPacketReader* CreateQuicPacketReader();
|
|
|
| virtual int ReadPacket(char* buffer,
|
| int buffer_len,
|
| @@ -231,6 +240,11 @@ 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.
|
| + // TODO(rtenneti): Add support for ReadAndProcessPackets().
|
| + // bool ReadAndProcessPackets();
|
| +
|
| // Address of the server.
|
| const IPEndPoint server_address_;
|
|
|
| @@ -278,6 +292,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);
|
| };
|
|
|
|
|