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 <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 weak_factory_.GetWeakPtr(), callback)); | 92 weak_factory_.GetWeakPtr(), callback)); |
93 | 93 |
94 if (rv == OK) { | 94 if (rv == OK) { |
95 stream_ = stream_request_.ReleaseStream(); | 95 stream_ = stream_request_.ReleaseStream(); |
96 InitializeStreamHelper(); | 96 InitializeStreamHelper(); |
97 } | 97 } |
98 | 98 |
99 return rv; | 99 return rv; |
100 } | 100 } |
101 | 101 |
102 UploadProgress SpdyHttpStream::GetUploadProgress() const { | |
103 if (!request_info_ || !HasUploadData()) | |
104 return UploadProgress(); | |
105 | |
106 return UploadProgress(request_info_->upload_data_stream->position(), | |
107 request_info_->upload_data_stream->size()); | |
108 } | |
109 | |
110 int SpdyHttpStream::ReadResponseHeaders(const CompletionCallback& callback) { | 102 int SpdyHttpStream::ReadResponseHeaders(const CompletionCallback& callback) { |
111 CHECK(!callback.is_null()); | 103 CHECK(!callback.is_null()); |
112 if (stream_closed_) | 104 if (stream_closed_) |
113 return closed_stream_status_; | 105 return closed_stream_status_; |
114 | 106 |
115 CHECK(stream_.get()); | 107 CHECK(stream_.get()); |
116 | 108 |
117 // Check if we already have the response headers. If so, return synchronously. | 109 // Check if we already have the response headers. If so, return synchronously. |
118 if (response_headers_status_ == RESPONSE_HEADERS_ARE_COMPLETE) { | 110 if (response_headers_status_ == RESPONSE_HEADERS_ARE_COMPLETE) { |
119 CHECK(!stream_->IsIdle()); | 111 CHECK(!stream_->IsIdle()); |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 details->connection_info = HttpResponseInfo::CONNECTION_INFO_HTTP2; | 606 details->connection_info = HttpResponseInfo::CONNECTION_INFO_HTTP2; |
615 return; | 607 return; |
616 } | 608 } |
617 | 609 |
618 void SpdyHttpStream::SetPriority(RequestPriority priority) { | 610 void SpdyHttpStream::SetPriority(RequestPriority priority) { |
619 // TODO(akalin): Plumb this through to |stream_request_| and | 611 // TODO(akalin): Plumb this through to |stream_request_| and |
620 // |stream_|. | 612 // |stream_|. |
621 } | 613 } |
622 | 614 |
623 } // namespace net | 615 } // namespace net |
OLD | NEW |