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

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

Issue 2334943002: Add a new QuicChromiumClientSession::Handle class (Closed)
Patch Set: fixes Created 3 years, 7 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
« no previous file with comments | « net/quic/chromium/quic_http_stream.cc ('k') | net/quic/chromium/quic_stream_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..54eebc09064e126911811b3ebba370b71f8dd27d 100644
--- a/net/quic/chromium/quic_http_stream_test.cc
+++ b/net/quic/chromium/quic_http_stream_test.cc
@@ -102,9 +102,9 @@ class TestQuicConnection : public QuicConnection {
class AutoClosingStream : public QuicHttpStream {
public:
explicit AutoClosingStream(
- const base::WeakPtr<QuicChromiumClientSession>& session,
+ std::unique_ptr<QuicChromiumClientSession::Handle> session,
HttpServerProperties* http_server_properties)
- : QuicHttpStream(session, http_server_properties) {}
+ : QuicHttpStream(std::move(session), http_server_properties) {}
void OnHeadersAvailable(const SpdyHeaderBlock& headers,
size_t frame_len) override {
@@ -321,17 +321,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_->CreateHandle(),
&http_server_properties_)
- : new QuicHttpStream(session_->GetWeakPtr(),
+ : new QuicHttpStream(session_->CreateHandle(),
&http_server_properties_));
promised_stream_.reset(use_closing_stream_
- ? new AutoClosingStream(session_->GetWeakPtr(),
+ ? new AutoClosingStream(session_->CreateHandle(),
&http_server_properties_)
- : new QuicHttpStream(session_->GetWeakPtr(),
+ : new QuicHttpStream(session_->CreateHandle(),
&http_server_properties_));
push_promise_[":path"] = "/bar";
@@ -711,7 +712,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_->CreateHandle(), &http_server_properties_);
TestCompletionCallback callback2;
EXPECT_EQ(OK,
stream2.InitializeStream(&request_, DEFAULT_PRIORITY,
« no previous file with comments | « net/quic/chromium/quic_http_stream.cc ('k') | net/quic/chromium/quic_stream_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698