| 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/spdy/spdy_http_stream.h" | 5 #include "net/spdy/spdy_http_stream.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <list> | 8 #include <list> |
| 9 #include <memory> |
| 10 #include <string> |
| 9 #include <utility> | 11 #include <utility> |
| 10 | 12 |
| 11 #include "base/bind.h" | 13 #include "base/bind.h" |
| 12 #include "base/callback_helpers.h" | 14 #include "base/callback_helpers.h" |
| 13 #include "base/location.h" | 15 #include "base/location.h" |
| 14 #include "base/logging.h" | 16 #include "base/logging.h" |
| 15 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
| 16 #include "base/threading/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
| 17 #include "base/values.h" | 19 #include "base/values.h" |
| 18 #include "net/base/host_port_pair.h" | 20 #include "net/base/host_port_pair.h" |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 if (rv != ERR_IO_PENDING) | 431 if (rv != ERR_IO_PENDING) |
| 430 OnRequestBodyReadCompleted(rv); | 432 OnRequestBodyReadCompleted(rv); |
| 431 } | 433 } |
| 432 | 434 |
| 433 void SpdyHttpStream::InitializeStreamHelper() { | 435 void SpdyHttpStream::InitializeStreamHelper() { |
| 434 stream_->SetDelegate(this); | 436 stream_->SetDelegate(this); |
| 435 was_alpn_negotiated_ = stream_->WasAlpnNegotiated(); | 437 was_alpn_negotiated_ = stream_->WasAlpnNegotiated(); |
| 436 } | 438 } |
| 437 | 439 |
| 438 void SpdyHttpStream::ResetStreamInternal() { | 440 void SpdyHttpStream::ResetStreamInternal() { |
| 439 spdy_session_->ResetStream(stream()->stream_id(), RST_STREAM_INTERNAL_ERROR, | 441 spdy_session_->ResetStream(stream()->stream_id(), ERROR_CODE_INTERNAL_ERROR, |
| 440 std::string()); | 442 std::string()); |
| 441 } | 443 } |
| 442 | 444 |
| 443 void SpdyHttpStream::OnRequestBodyReadCompleted(int status) { | 445 void SpdyHttpStream::OnRequestBodyReadCompleted(int status) { |
| 444 if (status < 0) { | 446 if (status < 0) { |
| 445 DCHECK_NE(ERR_IO_PENDING, status); | 447 DCHECK_NE(ERR_IO_PENDING, status); |
| 446 // Post |request_callback_| with received error. This should be posted | 448 // Post |request_callback_| with received error. This should be posted |
| 447 // before ResetStreamInternal, because the latter would call | 449 // before ResetStreamInternal, because the latter would call |
| 448 // |request_callback_| via OnClose with an error code potentially different | 450 // |request_callback_| via OnClose with an error code potentially different |
| 449 // from |status|. | 451 // from |status|. |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 573 details->connection_info = HttpResponseInfo::CONNECTION_INFO_HTTP2; | 575 details->connection_info = HttpResponseInfo::CONNECTION_INFO_HTTP2; |
| 574 return; | 576 return; |
| 575 } | 577 } |
| 576 | 578 |
| 577 void SpdyHttpStream::SetPriority(RequestPriority priority) { | 579 void SpdyHttpStream::SetPriority(RequestPriority priority) { |
| 578 // TODO(akalin): Plumb this through to |stream_request_| and | 580 // TODO(akalin): Plumb this through to |stream_request_| and |
| 579 // |stream_|. | 581 // |stream_|. |
| 580 } | 582 } |
| 581 | 583 |
| 582 } // namespace net | 584 } // namespace net |
| OLD | NEW |