OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "net/quic/quic_http_stream.h" | 5 #include "net/quic/quic_http_stream.h" |
6 | 6 |
7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 next_state_ = STATE_REQUEST_STREAM; | 169 next_state_ = STATE_REQUEST_STREAM; |
170 int rv = DoLoop(OK); | 170 int rv = DoLoop(OK); |
171 if (rv == ERR_IO_PENDING) | 171 if (rv == ERR_IO_PENDING) |
172 callback_ = callback; | 172 callback_ = callback; |
173 | 173 |
174 return rv; | 174 return rv; |
175 } | 175 } |
176 | 176 |
177 int QuicHttpStream::DoStreamRequest() { | 177 int QuicHttpStream::DoStreamRequest() { |
178 if (session_.get() == nullptr) { | 178 // TODO(rtenneti) Bug: b/28676259 - a temporary fix until we find out why |
179 // TODO(rtenneti) Bug: b/28676259 - a temporary fix until we find out why | 179 // |session_| could be a nullptr. Delete |null_session| check and histogram if |
180 // |session_| could be a nullptr. | 180 // session is never a nullptr. |
| 181 bool null_session = session_ == nullptr; |
| 182 if (null_session) { |
| 183 UMA_HISTOGRAM_BOOLEAN("Net.QuicHttpStream::DoStreamRequest.NullSession", |
| 184 null_session); |
181 return was_handshake_confirmed_ ? ERR_CONNECTION_CLOSED | 185 return was_handshake_confirmed_ ? ERR_CONNECTION_CLOSED |
182 : ERR_QUIC_HANDSHAKE_FAILED; | 186 : ERR_QUIC_HANDSHAKE_FAILED; |
183 } | 187 } |
184 int rv = stream_request_.StartRequest( | 188 int rv = stream_request_.StartRequest( |
185 session_, &stream_, | 189 session_, &stream_, |
186 base::Bind(&QuicHttpStream::OnStreamReady, weak_factory_.GetWeakPtr())); | 190 base::Bind(&QuicHttpStream::OnStreamReady, weak_factory_.GetWeakPtr())); |
187 if (rv == OK) { | 191 if (rv == OK) { |
188 stream_->SetDelegate(this); | 192 stream_->SetDelegate(this); |
189 if (request_info_->load_flags & LOAD_DISABLE_CONNECTION_MIGRATION) { | 193 if (request_info_->load_flags & LOAD_DISABLE_CONNECTION_MIGRATION) { |
190 stream_->DisableConnectionMigration(); | 194 stream_->DisableConnectionMigration(); |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
778 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); | 782 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); |
779 stream_ = nullptr; | 783 stream_ = nullptr; |
780 | 784 |
781 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress | 785 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress |
782 // read. | 786 // read. |
783 if (request_body_stream_) | 787 if (request_body_stream_) |
784 request_body_stream_->Reset(); | 788 request_body_stream_->Reset(); |
785 } | 789 } |
786 | 790 |
787 } // namespace net | 791 } // namespace net |
OLD | NEW |