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

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

Issue 2918663002: Clean up error handling in BidirectionalStreamQuicImpl::Start (Closed)
Patch Set: 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 | « no previous file | net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/chromium/bidirectional_stream_quic_impl.cc
diff --git a/net/quic/chromium/bidirectional_stream_quic_impl.cc b/net/quic/chromium/bidirectional_stream_quic_impl.cc
index c3864fce8561b7ad838f3baef728c3a58ca391ac..96c880783b16efac96f36ccdc2cc495422b91d7f 100644
--- a/net/quic/chromium/bidirectional_stream_quic_impl.cc
+++ b/net/quic/chromium/bidirectional_stream_quic_impl.cc
@@ -53,15 +53,10 @@ void BidirectionalStreamQuicImpl::Start(
std::unique_ptr<base::Timer> /* timer */) {
DCHECK(!stream_);
CHECK(delegate);
+ DLOG_IF(WARNING, !session_->IsConnected())
+ << "Trying to start request headers after session has been closed.";
send_request_headers_automatically_ = send_request_headers_automatically;
- if (!session_->IsConnected()) {
- NotifyError(session_->IsCryptoHandshakeConfirmed()
- ? ERR_QUIC_PROTOCOL_ERROR
- : ERR_QUIC_HANDSHAKE_FAILED);
- return;
- }
Ryan Hamilton 2017/05/31 21:51:59 Since both the handle's RequestStream and the sess
xunjieli 2017/05/31 23:40:12 Acknowledged.
-
delegate_ = delegate;
request_info_ = request_info;
@@ -72,11 +67,17 @@ void BidirectionalStreamQuicImpl::Start(
if (rv == ERR_IO_PENDING)
return;
- if (rv == OK) {
- OnStreamReady(rv);
- } else if (!session_->IsCryptoHandshakeConfirmed()) {
- NotifyError(ERR_QUIC_HANDSHAKE_FAILED);
+ if (rv != OK) {
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&BidirectionalStreamQuicImpl::NotifyError,
Ryan Hamilton 2017/05/31 21:51:59 I'm pretty sure we need to do a PostTask here, oth
xunjieli 2017/05/31 23:40:12 Per offline discussion, I think the PostTask is no
Ryan Hamilton 2017/06/01 02:15:36 I'm not worried about the delegate calling back in
xunjieli 2017/06/01 11:57:54 I thought about this some more yesterday. I think
+ weak_factory_.GetWeakPtr(),
+ session_->IsCryptoHandshakeConfirmed()
+ ? ERR_QUIC_PROTOCOL_ERROR
Ryan Hamilton 2017/05/31 21:51:59 We could use |rv| instead of ERR_QUIC_PROTOCOL_ERR
xunjieli 2017/05/31 23:40:12 SG. Let's use |rv| here.
Ryan Hamilton 2017/06/01 02:15:36 Done.
+ : ERR_QUIC_HANDSHAKE_FAILED));
+ return;
}
+
+ OnStreamReady(rv);
}
void BidirectionalStreamQuicImpl::SendRequestHeaders() {
« no previous file with comments | « no previous file | net/quic/chromium/bidirectional_stream_quic_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698