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 <limits> | 8 #include <limits> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 return std::move(dict); | 119 return std::move(dict); |
120 } | 120 } |
121 | 121 |
122 std::unique_ptr<base::Value> NetLogSpdyInitializedCallback( | 122 std::unique_ptr<base::Value> NetLogSpdyInitializedCallback( |
123 NetLogSource source, | 123 NetLogSource source, |
124 NetLogCaptureMode /* capture_mode */) { | 124 NetLogCaptureMode /* capture_mode */) { |
125 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 125 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
126 if (source.IsValid()) { | 126 if (source.IsValid()) { |
127 source.AddToEventParameters(dict.get()); | 127 source.AddToEventParameters(dict.get()); |
128 } | 128 } |
129 dict->SetString("protocol", SSLClientSocket::NextProtoToString(kProtoHTTP2)); | 129 dict->SetString("protocol", NextProtoToString(kProtoHTTP2)); |
130 return std::move(dict); | 130 return std::move(dict); |
131 } | 131 } |
132 | 132 |
133 std::unique_ptr<base::Value> NetLogSpdySettingsCallback( | 133 std::unique_ptr<base::Value> NetLogSpdySettingsCallback( |
134 const HostPortPair& host_port_pair, | 134 const HostPortPair& host_port_pair, |
135 bool clear_persisted, | 135 bool clear_persisted, |
136 NetLogCaptureMode /* capture_mode */) { | 136 NetLogCaptureMode /* capture_mode */) { |
137 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 137 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
138 dict->SetString("host", host_port_pair.ToString()); | 138 dict->SetString("host", host_port_pair.ToString()); |
139 dict->SetBoolean("clear_persisted", clear_persisted); | 139 dict->SetBoolean("clear_persisted", clear_persisted); |
(...skipping 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1706 } | 1706 } |
1707 dict->SetString("proxy", host_port_proxy_pair().second.ToURI()); | 1707 dict->SetString("proxy", host_port_proxy_pair().second.ToURI()); |
1708 | 1708 |
1709 dict->SetInteger("active_streams", active_streams_.size()); | 1709 dict->SetInteger("active_streams", active_streams_.size()); |
1710 | 1710 |
1711 dict->SetInteger("unclaimed_pushed_streams", | 1711 dict->SetInteger("unclaimed_pushed_streams", |
1712 unclaimed_pushed_streams_.size()); | 1712 unclaimed_pushed_streams_.size()); |
1713 | 1713 |
1714 dict->SetBoolean("is_secure", is_secure_); | 1714 dict->SetBoolean("is_secure", is_secure_); |
1715 | 1715 |
1716 dict->SetString("negotiated_protocol", | 1716 dict->SetString( |
1717 SSLClientSocket::NextProtoToString( | 1717 "negotiated_protocol", |
1718 connection_->socket()->GetNegotiatedProtocol())); | 1718 NextProtoToString(connection_->socket()->GetNegotiatedProtocol())); |
1719 | 1719 |
1720 dict->SetInteger("error", error_on_close_); | 1720 dict->SetInteger("error", error_on_close_); |
1721 dict->SetInteger("max_concurrent_streams", max_concurrent_streams_); | 1721 dict->SetInteger("max_concurrent_streams", max_concurrent_streams_); |
1722 | 1722 |
1723 dict->SetInteger("streams_initiated_count", streams_initiated_count_); | 1723 dict->SetInteger("streams_initiated_count", streams_initiated_count_); |
1724 dict->SetInteger("streams_pushed_count", streams_pushed_count_); | 1724 dict->SetInteger("streams_pushed_count", streams_pushed_count_); |
1725 dict->SetInteger("streams_pushed_and_claimed_count", | 1725 dict->SetInteger("streams_pushed_and_claimed_count", |
1726 streams_pushed_and_claimed_count_); | 1726 streams_pushed_and_claimed_count_); |
1727 dict->SetInteger("streams_abandoned_count", streams_abandoned_count_); | 1727 dict->SetInteger("streams_abandoned_count", streams_abandoned_count_); |
1728 DCHECK(buffered_spdy_framer_.get()); | 1728 DCHECK(buffered_spdy_framer_.get()); |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2277 const GURL& gurl(it->second.stream->url()); | 2277 const GURL& gurl(it->second.stream->url()); |
2278 if (!gurl.SchemeIs("https")) | 2278 if (!gurl.SchemeIs("https")) |
2279 return; | 2279 return; |
2280 scheme_host_port = url::SchemeHostPort(gurl); | 2280 scheme_host_port = url::SchemeHostPort(gurl); |
2281 } | 2281 } |
2282 | 2282 |
2283 AlternativeServiceInfoVector alternative_service_info_vector; | 2283 AlternativeServiceInfoVector alternative_service_info_vector; |
2284 alternative_service_info_vector.reserve(altsvc_vector.size()); | 2284 alternative_service_info_vector.reserve(altsvc_vector.size()); |
2285 const base::Time now(base::Time::Now()); | 2285 const base::Time now(base::Time::Now()); |
2286 for (const SpdyAltSvcWireFormat::AlternativeService& altsvc : altsvc_vector) { | 2286 for (const SpdyAltSvcWireFormat::AlternativeService& altsvc : altsvc_vector) { |
2287 const AlternateProtocol protocol = | 2287 const NextProto protocol = NextProtoFromString(altsvc.protocol_id); |
2288 AlternateProtocolFromString(altsvc.protocol_id); | 2288 if (protocol == kProtoUnknown) |
2289 if (protocol == UNINITIALIZED_ALTERNATE_PROTOCOL) | |
2290 continue; | 2289 continue; |
2291 const AlternativeService alternative_service(protocol, altsvc.host, | 2290 const AlternativeService alternative_service(protocol, altsvc.host, |
2292 altsvc.port); | 2291 altsvc.port); |
2293 const base::Time expiration = | 2292 const base::Time expiration = |
2294 now + base::TimeDelta::FromSeconds(altsvc.max_age); | 2293 now + base::TimeDelta::FromSeconds(altsvc.max_age); |
2295 alternative_service_info_vector.push_back( | 2294 alternative_service_info_vector.push_back( |
2296 AlternativeServiceInfo(alternative_service, expiration)); | 2295 AlternativeServiceInfo(alternative_service, expiration)); |
2297 } | 2296 } |
2298 http_server_properties_->SetAlternativeServices( | 2297 http_server_properties_->SetAlternativeServices( |
2299 scheme_host_port, alternative_service_info_vector); | 2298 scheme_host_port, alternative_service_info_vector); |
(...skipping 833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3133 if (!queue->empty()) { | 3132 if (!queue->empty()) { |
3134 SpdyStreamId stream_id = queue->front(); | 3133 SpdyStreamId stream_id = queue->front(); |
3135 queue->pop_front(); | 3134 queue->pop_front(); |
3136 return stream_id; | 3135 return stream_id; |
3137 } | 3136 } |
3138 } | 3137 } |
3139 return 0; | 3138 return 0; |
3140 } | 3139 } |
3141 | 3140 |
3142 } // namespace net | 3141 } // namespace net |
OLD | NEW |