Chromium Code Reviews| 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/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "net/base/io_buffer.h" | 10 #include "net/base/io_buffer.h" |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 549 response_info_->was_npn_negotiated = true; | 549 response_info_->was_npn_negotiated = true; |
| 550 response_info_->npn_negotiated_protocol = "quic/1+spdy/3"; | 550 response_info_->npn_negotiated_protocol = "quic/1+spdy/3"; |
| 551 response_info_->response_time = base::Time::Now(); | 551 response_info_->response_time = base::Time::Now(); |
| 552 response_info_->request_time = request_time_; | 552 response_info_->request_time = request_time_; |
| 553 response_headers_received_ = true; | 553 response_headers_received_ = true; |
| 554 | 554 |
| 555 return OK; | 555 return OK; |
| 556 } | 556 } |
| 557 | 557 |
| 558 int QuicHttpStream::ReadAvailableData(IOBuffer* buf, int buf_len) { | 558 int QuicHttpStream::ReadAvailableData(IOBuffer* buf, int buf_len) { |
| 559 // TODO(rtenneti): Temporary until crbug.com/585591 is solved. | |
| 560 stream_->CrashIfInvalid(); | |
| 559 int rv = stream_->Read(buf, buf_len); | 561 int rv = stream_->Read(buf, buf_len); |
| 562 // TODO(rtenneti): Temporary until crbug.com/585591 is solved. | |
| 563 stream_->CrashIfInvalid(); | |
|
eroman
2016/02/11 02:16:33
Driveby comments:
According to the crash data for
ramant (doing other things)
2016/02/11 19:45:46
Acknowledged.
Thanks Eric. Added more instrumenta
| |
| 560 if (stream_->IsDoneReading()) { | 564 if (stream_->IsDoneReading()) { |
| 561 stream_->SetDelegate(nullptr); | 565 stream_->SetDelegate(nullptr); |
| 562 stream_->OnFinRead(); | 566 stream_->OnFinRead(); |
| 563 ResetStream(); | 567 ResetStream(); |
| 564 } | 568 } |
| 565 return rv; | 569 return rv; |
| 566 } | 570 } |
| 567 | 571 |
| 568 void QuicHttpStream::ResetStream() { | 572 void QuicHttpStream::ResetStream() { |
| 569 if (!stream_) | 573 if (!stream_) |
| 570 return; | 574 return; |
| 571 closed_stream_received_bytes_ = stream_->stream_bytes_read(); | 575 closed_stream_received_bytes_ = stream_->stream_bytes_read(); |
| 572 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); | 576 closed_stream_sent_bytes_ = stream_->stream_bytes_written(); |
| 573 stream_ = nullptr; | 577 stream_ = nullptr; |
| 574 | 578 |
| 575 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress | 579 // If |request_body_stream_| is non-NULL, Reset it, to abort any in progress |
| 576 // read. | 580 // read. |
| 577 if (request_body_stream_) | 581 if (request_body_stream_) |
| 578 request_body_stream_->Reset(); | 582 request_body_stream_->Reset(); |
| 579 } | 583 } |
| 580 | 584 |
| 581 } // namespace net | 585 } // namespace net |
| OLD | NEW |