Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(949)

Unified Diff: net/tools/quic/test_tools/quic_test_client.h

Issue 2580393003: Replace QuicAckListenerInterface* with scoped_refptr<QuicAckListenerInterface>. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/tools/quic/quic_simple_server_stream_test.cc ('k') | net/tools/quic/test_tools/quic_test_client.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/tools/quic/test_tools/quic_test_client.h
diff --git a/net/tools/quic/test_tools/quic_test_client.h b/net/tools/quic/test_tools/quic_test_client.h
index d2b9c8d0e65ffc8022a91dc88e5a926b1f7c2566..04cc791bc1e7e9d821d1a8a74f98d97e219df2dd 100644
--- a/net/tools/quic/test_tools/quic_test_client.h
+++ b/net/tools/quic/test_tools/quic_test_client.h
@@ -115,7 +115,7 @@ class QuicTestClient : public QuicSpdyStream::Visitor,
// As above, but |delegate| will be notified when |data| is ACKed.
ssize_t SendData(const std::string& data,
bool last_data,
- QuicAckListenerInterface* delegate);
+ const scoped_refptr<QuicAckListenerInterface>& delegate);
// Clears any outstanding state and sends a simple GET of 'uri' to the
// server. Returns 0 if the request failed and no bytes were written.
@@ -215,10 +215,11 @@ class QuicTestClient : public QuicSpdyStream::Visitor,
// Calls GetOrCreateStream(), sends the request on the stream, and
// stores the request in case it needs to be resent. If |headers| is
// null, only the body will be sent on the stream.
- ssize_t GetOrCreateStreamAndSendRequest(const SpdyHeaderBlock* headers,
- base::StringPiece body,
- bool fin,
- QuicAckListenerInterface* delegate);
+ ssize_t GetOrCreateStreamAndSendRequest(
+ const SpdyHeaderBlock* headers,
+ base::StringPiece body,
+ bool fin,
+ const scoped_refptr<QuicAckListenerInterface>& delegate);
QuicRstStreamErrorCode stream_error() { return stream_error_; }
QuicErrorCode connection_error();
@@ -275,22 +276,20 @@ class QuicTestClient : public QuicSpdyStream::Visitor,
private:
class TestClientDataToResend : public QuicClient::QuicDataToResend {
public:
- TestClientDataToResend(std::unique_ptr<SpdyHeaderBlock> headers,
- base::StringPiece body,
- bool fin,
- QuicTestClient* test_client,
- QuicAckListenerInterface* delegate)
- : QuicClient::QuicDataToResend(std::move(headers), body, fin),
- test_client_(test_client),
- delegate_(delegate) {}
+ TestClientDataToResend(
+ std::unique_ptr<SpdyHeaderBlock> headers,
+ base::StringPiece body,
+ bool fin,
+ QuicTestClient* test_client,
+ const scoped_refptr<QuicAckListenerInterface>& delegate);
- ~TestClientDataToResend() override {}
+ ~TestClientDataToResend() override;
void Resend() override;
protected:
QuicTestClient* test_client_;
- QuicAckListenerInterface* delegate_;
+ scoped_refptr<QuicAckListenerInterface> delegate_;
};
// Given |uri|, populates the fields in |headers| for a simple GET
« no previous file with comments | « net/tools/quic/quic_simple_server_stream_test.cc ('k') | net/tools/quic/test_tools/quic_test_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698