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> | 9 #include <memory> |
10 #include <string> | 10 #include <string> |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "net/spdy/spdy_header_block.h" | 27 #include "net/spdy/spdy_header_block.h" |
28 #include "net/spdy/spdy_http_utils.h" | 28 #include "net/spdy/spdy_http_utils.h" |
29 #include "net/spdy/spdy_protocol.h" | 29 #include "net/spdy/spdy_protocol.h" |
30 #include "net/spdy/spdy_session.h" | 30 #include "net/spdy/spdy_session.h" |
31 | 31 |
32 namespace net { | 32 namespace net { |
33 | 33 |
34 const size_t SpdyHttpStream::kRequestBodyBufferSize = 1 << 14; // 16KB | 34 const size_t SpdyHttpStream::kRequestBodyBufferSize = 1 << 14; // 16KB |
35 | 35 |
36 SpdyHttpStream::SpdyHttpStream(const base::WeakPtr<SpdySession>& spdy_session, | 36 SpdyHttpStream::SpdyHttpStream(const base::WeakPtr<SpdySession>& spdy_session, |
37 bool direct) | 37 bool direct, |
| 38 NetLogSource source_dependency) |
38 : MultiplexedHttpStream(MultiplexedSessionHandle(spdy_session)), | 39 : MultiplexedHttpStream(MultiplexedSessionHandle(spdy_session)), |
39 spdy_session_(spdy_session), | 40 spdy_session_(spdy_session), |
40 is_reused_(spdy_session_->IsReused()), | 41 is_reused_(spdy_session_->IsReused()), |
| 42 source_dependency_(source_dependency), |
41 stream_(nullptr), | 43 stream_(nullptr), |
42 stream_closed_(false), | 44 stream_closed_(false), |
43 closed_stream_status_(ERR_FAILED), | 45 closed_stream_status_(ERR_FAILED), |
44 closed_stream_id_(0), | 46 closed_stream_id_(0), |
45 closed_stream_received_bytes_(0), | 47 closed_stream_received_bytes_(0), |
46 closed_stream_sent_bytes_(0), | 48 closed_stream_sent_bytes_(0), |
47 request_info_(NULL), | 49 request_info_(NULL), |
48 response_info_(NULL), | 50 response_info_(NULL), |
49 response_headers_complete_(false), | 51 response_headers_complete_(false), |
50 user_buffer_len_(0), | 52 user_buffer_len_(0), |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 DoBufferedReadCallback(); | 390 DoBufferedReadCallback(); |
389 if (!self) | 391 if (!self) |
390 return; | 392 return; |
391 } | 393 } |
392 | 394 |
393 if (!response_callback_.is_null()) { | 395 if (!response_callback_.is_null()) { |
394 DoResponseCallback(status); | 396 DoResponseCallback(status); |
395 } | 397 } |
396 } | 398 } |
397 | 399 |
| 400 NetLogSource SpdyHttpStream::source_dependency() const { |
| 401 return source_dependency_; |
| 402 } |
| 403 |
398 bool SpdyHttpStream::HasUploadData() const { | 404 bool SpdyHttpStream::HasUploadData() const { |
399 CHECK(request_info_); | 405 CHECK(request_info_); |
400 return | 406 return |
401 request_info_->upload_data_stream && | 407 request_info_->upload_data_stream && |
402 ((request_info_->upload_data_stream->size() > 0) || | 408 ((request_info_->upload_data_stream->size() > 0) || |
403 request_info_->upload_data_stream->is_chunked()); | 409 request_info_->upload_data_stream->is_chunked()); |
404 } | 410 } |
405 | 411 |
406 void SpdyHttpStream::OnStreamCreated( | 412 void SpdyHttpStream::OnStreamCreated( |
407 const CompletionCallback& callback, | 413 const CompletionCallback& callback, |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 details->connection_info = HttpResponseInfo::CONNECTION_INFO_HTTP2; | 581 details->connection_info = HttpResponseInfo::CONNECTION_INFO_HTTP2; |
576 return; | 582 return; |
577 } | 583 } |
578 | 584 |
579 void SpdyHttpStream::SetPriority(RequestPriority priority) { | 585 void SpdyHttpStream::SetPriority(RequestPriority priority) { |
580 // TODO(akalin): Plumb this through to |stream_request_| and | 586 // TODO(akalin): Plumb this through to |stream_request_| and |
581 // |stream_|. | 587 // |stream_|. |
582 } | 588 } |
583 | 589 |
584 } // namespace net | 590 } // namespace net |
OLD | NEW |