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

Unified Diff: net/quic/chromium/quic_http_stream_test.cc

Issue 2334943002: Add a new QuicChromiumClientSession::Handle class (Closed)
Patch Set: cleanup Created 3 years, 8 months 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
Index: net/quic/chromium/quic_http_stream_test.cc
diff --git a/net/quic/chromium/quic_http_stream_test.cc b/net/quic/chromium/quic_http_stream_test.cc
index a35bbb957aedefebcea4496a22163e56a2d4c7cb..e7f805ba67039a93d88c08ffdd6de0a8241ed352 100644
--- a/net/quic/chromium/quic_http_stream_test.cc
+++ b/net/quic/chromium/quic_http_stream_test.cc
@@ -101,9 +101,8 @@ class TestQuicConnection : public QuicConnection {
// is received.
class AutoClosingStream : public QuicHttpStream {
public:
- explicit AutoClosingStream(
- const base::WeakPtr<QuicChromiumClientSession>& session,
- HttpServerProperties* http_server_properties)
+ explicit AutoClosingStream(QuicChromiumClientSession::Handle session,
+ HttpServerProperties* http_server_properties)
: QuicHttpStream(session, http_server_properties) {}
void OnHeadersAvailable(const SpdyHeaderBlock& headers,
@@ -321,17 +320,18 @@ class QuicHttpStreamTest : public ::testing::TestWithParam<QuicVersion> {
/*socket_performance_watcher=*/nullptr, net_log_.bound().net_log()));
session_->Initialize();
TestCompletionCallback callback;
+
session_->CryptoConnect(callback.callback());
stream_.reset(use_closing_stream_
- ? new AutoClosingStream(session_->GetWeakPtr(),
+ ? new AutoClosingStream(session_->GetHandle(),
&http_server_properties_)
- : new QuicHttpStream(session_->GetWeakPtr(),
+ : new QuicHttpStream(session_->GetHandle(),
&http_server_properties_));
promised_stream_.reset(use_closing_stream_
- ? new AutoClosingStream(session_->GetWeakPtr(),
+ ? new AutoClosingStream(session_->GetHandle(),
&http_server_properties_)
- : new QuicHttpStream(session_->GetWeakPtr(),
+ : new QuicHttpStream(session_->GetHandle(),
&http_server_properties_));
push_promise_[":path"] = "/bar";
@@ -711,7 +711,7 @@ TEST_P(QuicHttpStreamTest, LoadTimingTwoRequests) {
stream_->SendRequest(headers_, &response_, callback_.callback()));
// Start a second request.
- QuicHttpStream stream2(session_->GetWeakPtr(), &http_server_properties_);
+ QuicHttpStream stream2(session_->GetHandle(), &http_server_properties_);
TestCompletionCallback callback2;
EXPECT_EQ(OK,
stream2.InitializeStream(&request_, DEFAULT_PRIORITY,

Powered by Google App Engine
This is Rietveld 408576698