| 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_stream.h" | 5 #include "net/spdy/spdy_stream.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 int32 initial_send_window_size, | 84 int32 initial_send_window_size, |
| 85 int32 initial_recv_window_size, | 85 int32 initial_recv_window_size, |
| 86 const BoundNetLog& net_log) | 86 const BoundNetLog& net_log) |
| 87 : type_(type), | 87 : type_(type), |
| 88 weak_ptr_factory_(this), | 88 weak_ptr_factory_(this), |
| 89 in_do_loop_(false), | 89 in_do_loop_(false), |
| 90 continue_buffering_data_(type_ == SPDY_PUSH_STREAM), | 90 continue_buffering_data_(type_ == SPDY_PUSH_STREAM), |
| 91 stream_id_(0), | 91 stream_id_(0), |
| 92 url_(url), | 92 url_(url), |
| 93 priority_(priority), | 93 priority_(priority), |
| 94 slot_(0), | |
| 95 send_stalled_by_flow_control_(false), | 94 send_stalled_by_flow_control_(false), |
| 96 send_window_size_(initial_send_window_size), | 95 send_window_size_(initial_send_window_size), |
| 97 recv_window_size_(initial_recv_window_size), | 96 recv_window_size_(initial_recv_window_size), |
| 98 unacked_recv_window_bytes_(0), | 97 unacked_recv_window_bytes_(0), |
| 99 session_(session), | 98 session_(session), |
| 100 delegate_(NULL), | 99 delegate_(NULL), |
| 101 send_status_( | 100 send_status_( |
| 102 (type_ == SPDY_PUSH_STREAM) ? | 101 (type_ == SPDY_PUSH_STREAM) ? |
| 103 NO_MORE_DATA_TO_SEND : MORE_DATA_TO_SEND), | 102 NO_MORE_DATA_TO_SEND : MORE_DATA_TO_SEND), |
| 104 request_time_(base::Time::Now()), | 103 request_time_(base::Time::Now()), |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 | 195 |
| 197 scoped_ptr<SpdyFrame> SpdyStream::ProduceSynStreamFrame() { | 196 scoped_ptr<SpdyFrame> SpdyStream::ProduceSynStreamFrame() { |
| 198 CHECK_EQ(io_state_, STATE_SEND_REQUEST_HEADERS_COMPLETE); | 197 CHECK_EQ(io_state_, STATE_SEND_REQUEST_HEADERS_COMPLETE); |
| 199 CHECK(request_headers_); | 198 CHECK(request_headers_); |
| 200 CHECK_GT(stream_id_, 0u); | 199 CHECK_GT(stream_id_, 0u); |
| 201 | 200 |
| 202 SpdyControlFlags flags = | 201 SpdyControlFlags flags = |
| 203 (send_status_ == NO_MORE_DATA_TO_SEND) ? | 202 (send_status_ == NO_MORE_DATA_TO_SEND) ? |
| 204 CONTROL_FLAG_FIN : CONTROL_FLAG_NONE; | 203 CONTROL_FLAG_FIN : CONTROL_FLAG_NONE; |
| 205 scoped_ptr<SpdyFrame> frame(session_->CreateSynStream( | 204 scoped_ptr<SpdyFrame> frame(session_->CreateSynStream( |
| 206 stream_id_, priority_, slot_, flags, *request_headers_)); | 205 stream_id_, priority_, flags, *request_headers_)); |
| 207 send_time_ = base::TimeTicks::Now(); | 206 send_time_ = base::TimeTicks::Now(); |
| 208 return frame.Pass(); | 207 return frame.Pass(); |
| 209 } | 208 } |
| 210 | 209 |
| 211 void SpdyStream::DetachDelegate() { | 210 void SpdyStream::DetachDelegate() { |
| 212 CHECK(!in_do_loop_); | 211 CHECK(!in_do_loop_); |
| 213 DCHECK(!IsClosed()); | 212 DCHECK(!IsClosed()); |
| 214 delegate_ = NULL; | 213 delegate_ = NULL; |
| 215 Cancel(); | 214 Cancel(); |
| 216 } | 215 } |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 925 } | 924 } |
| 926 } else if (weak_this) { | 925 } else if (weak_this) { |
| 927 response_headers_status_ = RESPONSE_HEADERS_ARE_COMPLETE; | 926 response_headers_status_ = RESPONSE_HEADERS_ARE_COMPLETE; |
| 928 } | 927 } |
| 929 } | 928 } |
| 930 | 929 |
| 931 return OK; | 930 return OK; |
| 932 } | 931 } |
| 933 | 932 |
| 934 } // namespace net | 933 } // namespace net |
| OLD | NEW |