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_session.h" | 5 #include "net/spdy/spdy_session.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1788 DoDrainSession(err, description); | 1788 DoDrainSession(err, description); |
1789 } | 1789 } |
1790 | 1790 |
1791 void SpdySession::MakeUnavailable() { | 1791 void SpdySession::MakeUnavailable() { |
1792 if (availability_state_ == STATE_AVAILABLE) { | 1792 if (availability_state_ == STATE_AVAILABLE) { |
1793 availability_state_ = STATE_GOING_AWAY; | 1793 availability_state_ = STATE_GOING_AWAY; |
1794 pool_->MakeSessionUnavailable(GetWeakPtr()); | 1794 pool_->MakeSessionUnavailable(GetWeakPtr()); |
1795 } | 1795 } |
1796 } | 1796 } |
1797 | 1797 |
1798 base::Value* SpdySession::GetInfoAsValue() const { | 1798 scoped_ptr<base::Value> SpdySession::GetInfoAsValue() const { |
1799 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 1799 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
1800 | 1800 |
1801 dict->SetInteger("source_id", net_log_.source().id); | 1801 dict->SetInteger("source_id", net_log_.source().id); |
1802 | 1802 |
1803 dict->SetString("host_port_pair", host_port_pair().ToString()); | 1803 dict->SetString("host_port_pair", host_port_pair().ToString()); |
1804 if (!pooled_aliases_.empty()) { | 1804 if (!pooled_aliases_.empty()) { |
1805 scoped_ptr<base::ListValue> alias_list(new base::ListValue()); | 1805 scoped_ptr<base::ListValue> alias_list(new base::ListValue()); |
1806 for (const auto& alias : pooled_aliases_) { | 1806 for (const auto& alias : pooled_aliases_) { |
1807 alias_list->AppendString(alias.host_port_pair().ToString()); | 1807 alias_list->AppendString(alias.host_port_pair().ToString()); |
1808 } | 1808 } |
(...skipping 23 matching lines...) Expand all Loading... |
1832 DCHECK(buffered_spdy_framer_.get()); | 1832 DCHECK(buffered_spdy_framer_.get()); |
1833 dict->SetInteger("frames_received", buffered_spdy_framer_->frames_received()); | 1833 dict->SetInteger("frames_received", buffered_spdy_framer_->frames_received()); |
1834 | 1834 |
1835 dict->SetBoolean("sent_settings", sent_settings_); | 1835 dict->SetBoolean("sent_settings", sent_settings_); |
1836 dict->SetBoolean("received_settings", received_settings_); | 1836 dict->SetBoolean("received_settings", received_settings_); |
1837 | 1837 |
1838 dict->SetInteger("send_window_size", session_send_window_size_); | 1838 dict->SetInteger("send_window_size", session_send_window_size_); |
1839 dict->SetInteger("recv_window_size", session_recv_window_size_); | 1839 dict->SetInteger("recv_window_size", session_recv_window_size_); |
1840 dict->SetInteger("unacked_recv_window_bytes", | 1840 dict->SetInteger("unacked_recv_window_bytes", |
1841 session_unacked_recv_window_bytes_); | 1841 session_unacked_recv_window_bytes_); |
1842 return dict.release(); | 1842 return dict.Pass(); |
1843 } | 1843 } |
1844 | 1844 |
1845 bool SpdySession::IsReused() const { | 1845 bool SpdySession::IsReused() const { |
1846 return buffered_spdy_framer_->frames_received() > 0 || | 1846 return buffered_spdy_framer_->frames_received() > 0 || |
1847 connection_->reuse_type() == ClientSocketHandle::UNUSED_IDLE; | 1847 connection_->reuse_type() == ClientSocketHandle::UNUSED_IDLE; |
1848 } | 1848 } |
1849 | 1849 |
1850 bool SpdySession::GetLoadTimingInfo(SpdyStreamId stream_id, | 1850 bool SpdySession::GetLoadTimingInfo(SpdyStreamId stream_id, |
1851 LoadTimingInfo* load_timing_info) const { | 1851 LoadTimingInfo* load_timing_info) const { |
1852 return connection_->GetLoadTimingInfo(stream_id != kFirstStreamId, | 1852 return connection_->GetLoadTimingInfo(stream_id != kFirstStreamId, |
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3258 if (!queue->empty()) { | 3258 if (!queue->empty()) { |
3259 SpdyStreamId stream_id = queue->front(); | 3259 SpdyStreamId stream_id = queue->front(); |
3260 queue->pop_front(); | 3260 queue->pop_front(); |
3261 return stream_id; | 3261 return stream_id; |
3262 } | 3262 } |
3263 } | 3263 } |
3264 return 0; | 3264 return 0; |
3265 } | 3265 } |
3266 | 3266 |
3267 } // namespace net | 3267 } // namespace net |
OLD | NEW |