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/http/http_network_session.h" | 5 #include "net/http/http_network_session.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 enable_spdy_ip_pooling(true), | 75 enable_spdy_ip_pooling(true), |
76 enable_spdy_credential_frames(false), | 76 enable_spdy_credential_frames(false), |
77 enable_spdy_compression(true), | 77 enable_spdy_compression(true), |
78 enable_spdy_ping_based_connection_checking(true), | 78 enable_spdy_ping_based_connection_checking(true), |
79 spdy_default_protocol(kProtoUnknown), | 79 spdy_default_protocol(kProtoUnknown), |
80 spdy_stream_initial_recv_window_size(0), | 80 spdy_stream_initial_recv_window_size(0), |
81 spdy_initial_max_concurrent_streams(0), | 81 spdy_initial_max_concurrent_streams(0), |
82 spdy_max_concurrent_streams_limit(0), | 82 spdy_max_concurrent_streams_limit(0), |
83 time_func(&base::TimeTicks::Now), | 83 time_func(&base::TimeTicks::Now), |
84 enable_quic(false), | 84 enable_quic(false), |
85 origin_port_to_force_quic_on(0), | |
86 quic_clock(NULL), | 85 quic_clock(NULL), |
87 quic_random(NULL), | 86 quic_random(NULL), |
88 enable_user_alternate_protocol_ports(false), | 87 enable_user_alternate_protocol_ports(false), |
89 quic_crypto_client_stream_factory(NULL) { | 88 quic_crypto_client_stream_factory(NULL) { |
90 } | 89 } |
91 | 90 |
92 // TODO(mbelshe): Move the socket factories into HttpStreamFactory. | 91 // TODO(mbelshe): Move the socket factories into HttpStreamFactory. |
93 HttpNetworkSession::HttpNetworkSession(const Params& params) | 92 HttpNetworkSession::HttpNetworkSession(const Params& params) |
94 : net_log_(params.net_log), | 93 : net_log_(params.net_log), |
95 network_delegate_(params.network_delegate), | 94 network_delegate_(params.network_delegate), |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 } | 185 } |
187 | 186 |
188 Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { | 187 Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { |
189 return spdy_session_pool_.SpdySessionPoolInfoToValue(); | 188 return spdy_session_pool_.SpdySessionPoolInfoToValue(); |
190 } | 189 } |
191 | 190 |
192 Value* HttpNetworkSession::QuicInfoToValue() const { | 191 Value* HttpNetworkSession::QuicInfoToValue() const { |
193 base::DictionaryValue* dict = new base::DictionaryValue(); | 192 base::DictionaryValue* dict = new base::DictionaryValue(); |
194 dict->Set("sessions", quic_stream_factory_.QuicStreamFactoryInfoToValue()); | 193 dict->Set("sessions", quic_stream_factory_.QuicStreamFactoryInfoToValue()); |
195 dict->SetBoolean("quic_enabled", params_.enable_quic); | 194 dict->SetBoolean("quic_enabled", params_.enable_quic); |
196 dict->SetInteger("origin_port_to_force_quic_on", | 195 dict->SetString("origin_to_force_quic_on", |
197 params_.origin_port_to_force_quic_on); | 196 params_.origin_to_force_quic_on.ToString()); |
198 return dict; | 197 return dict; |
199 } | 198 } |
200 | 199 |
201 void HttpNetworkSession::CloseAllConnections() { | 200 void HttpNetworkSession::CloseAllConnections() { |
202 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 201 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
203 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); | 202 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); |
204 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); | 203 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); |
205 quic_stream_factory_.CloseAllSessions(ERR_ABORTED); | 204 quic_stream_factory_.CloseAllSessions(ERR_ABORTED); |
206 } | 205 } |
207 | 206 |
(...skipping 11 matching lines...) Expand all Loading... |
219 case WEBSOCKET_SOCKET_POOL: | 218 case WEBSOCKET_SOCKET_POOL: |
220 return websocket_socket_pool_manager_.get(); | 219 return websocket_socket_pool_manager_.get(); |
221 default: | 220 default: |
222 NOTREACHED(); | 221 NOTREACHED(); |
223 break; | 222 break; |
224 } | 223 } |
225 return NULL; | 224 return NULL; |
226 } | 225 } |
227 | 226 |
228 } // namespace net | 227 } // namespace net |
OLD | NEW |