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

Unified Diff: net/quic/quic_stream_factory.cc

Issue 1793273004: Revert of Implement QUIC-based net::BidirectionalStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@basecl
Patch Set: Created 4 years, 9 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/quic_stream_factory.h ('k') | net/quic/quic_stream_factory_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_stream_factory.cc
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index 03fb2cc213e8d2904166cd9a5e9b465c21ad5c01..9f633d5aa8f12b4d4ea34a1ef339f8b598a6ed21 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -61,11 +61,6 @@
#include "base/cpu.h"
#endif
-#if BUILDFLAG(ENABLE_BIDIRECTIONAL_STREAM)
-#include "net/http/bidirectional_stream_job.h"
-#include "net/quic/bidirectional_stream_quic_impl.h"
-#endif
-
using std::min;
using NetworkHandle = net::NetworkChangeNotifier::NetworkHandle;
@@ -518,11 +513,11 @@
base::StringPiece method,
const BoundNetLog& net_log,
const CompletionCallback& callback) {
+ DCHECK(!stream_);
DCHECK(callback_.is_null());
DCHECK(factory_);
origin_host_ = url.host();
privacy_mode_ = privacy_mode;
-
int rv = factory_->Create(host_port_pair, privacy_mode, cert_verify_flags,
url, method, net_log, this);
if (rv == ERR_IO_PENDING) {
@@ -533,13 +528,13 @@
factory_ = nullptr;
}
if (rv == OK)
- DCHECK(session_);
+ DCHECK(stream_);
return rv;
}
-void QuicStreamRequest::SetSession(QuicChromiumClientSession* session) {
- DCHECK(session);
- session_ = session->GetWeakPtr();
+void QuicStreamRequest::set_stream(scoped_ptr<QuicHttpStream> stream) {
+ DCHECK(stream);
+ stream_ = std::move(stream);
}
void QuicStreamRequest::OnRequestComplete(int rv) {
@@ -554,20 +549,10 @@
QuicServerId(host_port_pair_, privacy_mode_));
}
-scoped_ptr<QuicHttpStream> QuicStreamRequest::CreateStream() {
- if (!session_)
- return nullptr;
- return make_scoped_ptr(new QuicHttpStream(session_));
-}
-
-#if BUILDFLAG(ENABLE_BIDIRECTIONAL_STREAM)
-scoped_ptr<BidirectionalStreamJob>
-QuicStreamRequest::CreateBidirectionalStreamJob() {
- if (!session_)
- return nullptr;
- return make_scoped_ptr(new BidirectionalStreamQuicImpl(session_));
-}
-#endif
+scoped_ptr<QuicHttpStream> QuicStreamRequest::ReleaseStream() {
+ DCHECK(stream_);
+ return std::move(stream_);
+}
QuicStreamFactory::QuicStreamFactory(
HostResolver* host_resolver,
@@ -795,7 +780,7 @@
static_cast<QuicChromiumClientSession*>(promised->session());
DCHECK(session);
if (session->server_id().privacy_mode() == privacy_mode) {
- request->SetSession(session);
+ request->set_stream(CreateFromSession(session));
++num_push_streams_created_;
return OK;
}
@@ -813,7 +798,7 @@
QuicChromiumClientSession* session = it->second;
if (!session->CanPool(url.host(), privacy_mode))
return ERR_ALTERNATIVE_CERT_NOT_VALID_FOR_ORIGIN;
- request->SetSession(session);
+ request->set_stream(CreateFromSession(session));
return OK;
}
}
@@ -869,7 +854,7 @@
QuicChromiumClientSession* session = it->second;
if (!session->CanPool(url.host(), privacy_mode))
return ERR_ALTERNATIVE_CERT_NOT_VALID_FOR_ORIGIN;
- request->SetSession(session);
+ request->set_stream(CreateFromSession(session));
}
return rv;
}
@@ -947,7 +932,7 @@
request->OnRequestComplete(ERR_ALTERNATIVE_CERT_NOT_VALID_FOR_ORIGIN);
continue;
}
- request->SetSession(session);
+ request->set_stream(CreateFromSession(session));
++request_it;
}
}
« no previous file with comments | « net/quic/quic_stream_factory.h ('k') | net/quic/quic_stream_factory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698