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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 }; | 78 }; |
79 | 79 |
80 SpdyStream::SpdyStream(SpdyStreamType type, | 80 SpdyStream::SpdyStream(SpdyStreamType type, |
81 const base::WeakPtr<SpdySession>& session, | 81 const base::WeakPtr<SpdySession>& session, |
82 const GURL& url, | 82 const GURL& url, |
83 RequestPriority priority, | 83 RequestPriority priority, |
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), | |
89 stream_id_(0), | 88 stream_id_(0), |
90 url_(url), | 89 url_(url), |
91 priority_(priority), | 90 priority_(priority), |
92 send_stalled_by_flow_control_(false), | 91 send_stalled_by_flow_control_(false), |
93 send_window_size_(initial_send_window_size), | 92 send_window_size_(initial_send_window_size), |
94 recv_window_size_(initial_recv_window_size), | 93 recv_window_size_(initial_recv_window_size), |
95 unacked_recv_window_bytes_(0), | 94 unacked_recv_window_bytes_(0), |
96 session_(session), | 95 session_(session), |
97 delegate_(NULL), | 96 delegate_(NULL), |
98 pending_send_status_(MORE_DATA_TO_SEND), | 97 pending_send_status_(MORE_DATA_TO_SEND), |
99 request_time_(base::Time::Now()), | 98 request_time_(base::Time::Now()), |
100 response_headers_status_(RESPONSE_HEADERS_ARE_INCOMPLETE), | 99 response_headers_status_(RESPONSE_HEADERS_ARE_INCOMPLETE), |
101 io_state_(STATE_IDLE), | 100 io_state_(STATE_IDLE), |
102 response_status_(OK), | 101 response_status_(OK), |
103 net_log_(net_log), | 102 net_log_(net_log), |
104 raw_received_bytes_(0), | 103 raw_received_bytes_(0), |
105 send_bytes_(0), | 104 send_bytes_(0), |
106 recv_bytes_(0), | 105 recv_bytes_(0), |
107 write_handler_guard_(false) { | 106 write_handler_guard_(false), |
| 107 weak_ptr_factory_(this) { |
108 CHECK(type_ == SPDY_BIDIRECTIONAL_STREAM || | 108 CHECK(type_ == SPDY_BIDIRECTIONAL_STREAM || |
109 type_ == SPDY_REQUEST_RESPONSE_STREAM || | 109 type_ == SPDY_REQUEST_RESPONSE_STREAM || |
110 type_ == SPDY_PUSH_STREAM); | 110 type_ == SPDY_PUSH_STREAM); |
111 CHECK_GE(priority_, MINIMUM_PRIORITY); | 111 CHECK_GE(priority_, MINIMUM_PRIORITY); |
112 CHECK_LE(priority_, MAXIMUM_PRIORITY); | 112 CHECK_LE(priority_, MAXIMUM_PRIORITY); |
113 } | 113 } |
114 | 114 |
115 SpdyStream::~SpdyStream() { | 115 SpdyStream::~SpdyStream() { |
116 CHECK(!write_handler_guard_); | 116 CHECK(!write_handler_guard_); |
117 UpdateHistograms(); | 117 UpdateHistograms(); |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, | 889 description = base::StringPrintf("Unknown state 0x%08X (%u)", state, |
890 state); | 890 state); |
891 break; | 891 break; |
892 } | 892 } |
893 return description; | 893 return description; |
894 } | 894 } |
895 | 895 |
896 #undef STATE_CASE | 896 #undef STATE_CASE |
897 | 897 |
898 } // namespace net | 898 } // namespace net |
OLD | NEW |