Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Side by Side Diff: net/http/http_network_session.cc

Issue 1149243003: Returning scoped_ptr instead of raw pointer in QuicInfoToValue in net/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 252
253 base::Value* HttpNetworkSession::SocketPoolInfoToValue() const { 253 base::Value* HttpNetworkSession::SocketPoolInfoToValue() const {
254 // TODO(yutak): Should merge values from normal pools and WebSocket pools. 254 // TODO(yutak): Should merge values from normal pools and WebSocket pools.
255 return normal_socket_pool_manager_->SocketPoolInfoToValue(); 255 return normal_socket_pool_manager_->SocketPoolInfoToValue();
256 } 256 }
257 257
258 base::Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const { 258 base::Value* HttpNetworkSession::SpdySessionPoolInfoToValue() const {
259 return spdy_session_pool_.SpdySessionPoolInfoToValue(); 259 return spdy_session_pool_.SpdySessionPoolInfoToValue();
260 } 260 }
261 261
262 base::Value* HttpNetworkSession::QuicInfoToValue() const { 262 scoped_ptr<base::Value> HttpNetworkSession::QuicInfoToValue() const {
263 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); 263 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
264 dict->Set("sessions", quic_stream_factory_.QuicStreamFactoryInfoToValue()); 264 dict->Set("sessions",
265 quic_stream_factory_.QuicStreamFactoryInfoToValue().Pass());
eroman 2015/05/25 17:48:56 Remove .Pass()
payal.pandey 2015/05/26 06:24:15 Done.
265 dict->SetBoolean("quic_enabled", params_.enable_quic); 266 dict->SetBoolean("quic_enabled", params_.enable_quic);
266 dict->SetBoolean("quic_enabled_for_proxies", params_.enable_quic_for_proxies); 267 dict->SetBoolean("quic_enabled_for_proxies", params_.enable_quic_for_proxies);
267 dict->SetBoolean("enable_quic_port_selection", 268 dict->SetBoolean("enable_quic_port_selection",
268 params_.enable_quic_port_selection); 269 params_.enable_quic_port_selection);
269 base::ListValue* connection_options = new base::ListValue; 270 scoped_ptr<base::ListValue> connection_options(new base::ListValue);
270 for (QuicTagVector::const_iterator it = 271 for (QuicTagVector::const_iterator it =
271 params_.quic_connection_options.begin(); 272 params_.quic_connection_options.begin();
272 it != params_.quic_connection_options.end(); ++it) { 273 it != params_.quic_connection_options.end(); ++it) {
273 connection_options->AppendString("'" + QuicUtils::TagToString(*it) + "'"); 274 connection_options->AppendString("'" + QuicUtils::TagToString(*it) + "'");
274 } 275 }
275 dict->Set("connection_options", connection_options); 276 dict->Set("connection_options", connection_options.Pass());
276 dict->SetString("origin_to_force_quic_on", 277 dict->SetString("origin_to_force_quic_on",
277 params_.origin_to_force_quic_on.ToString()); 278 params_.origin_to_force_quic_on.ToString());
278 dict->SetDouble("alternative_service_probability_threshold", 279 dict->SetDouble("alternative_service_probability_threshold",
279 params_.alternative_service_probability_threshold); 280 params_.alternative_service_probability_threshold);
280 return dict.release(); 281 return dict.Pass();
281 } 282 }
282 283
283 void HttpNetworkSession::CloseAllConnections() { 284 void HttpNetworkSession::CloseAllConnections() {
284 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); 285 normal_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED);
285 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED); 286 websocket_socket_pool_manager_->FlushSocketPoolsWithError(ERR_ABORTED);
286 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED); 287 spdy_session_pool_.CloseCurrentSessions(ERR_ABORTED);
287 quic_stream_factory_.CloseAllSessions(ERR_ABORTED); 288 quic_stream_factory_.CloseAllSessions(ERR_ABORTED);
288 } 289 }
289 290
290 void HttpNetworkSession::CloseIdleConnections() { 291 void HttpNetworkSession::CloseIdleConnections() {
(...skipping 30 matching lines...) Expand all
321 case WEBSOCKET_SOCKET_POOL: 322 case WEBSOCKET_SOCKET_POOL:
322 return websocket_socket_pool_manager_.get(); 323 return websocket_socket_pool_manager_.get();
323 default: 324 default:
324 NOTREACHED(); 325 NOTREACHED();
325 break; 326 break;
326 } 327 }
327 return NULL; 328 return NULL;
328 } 329 }
329 330
330 } // namespace net 331 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698