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

Side by Side Diff: net/socket/client_socket_pool_base.h

Issue 657013003: Use scoped_ptr::Pass instead of scoped_ptr::PassAs<T>. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « net/quic/quic_end_to_end_unittest.cc ('k') | net/socket/socket_test_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // A ClientSocketPoolBase is used to restrict the number of sockets open at 5 // A ClientSocketPoolBase is used to restrict the number of sockets open at
6 // a time. It also maintains a list of idle persistent sockets for reuse. 6 // a time. It also maintains a list of idle persistent sockets for reuse.
7 // Subclasses of ClientSocketPool should compose ClientSocketPoolBase to handle 7 // Subclasses of ClientSocketPool should compose ClientSocketPoolBase to handle
8 // the core logic of (1) restricting the number of active (connected or 8 // the core logic of (1) restricting the number of active (connected or
9 // connecting) sockets per "group" (generally speaking, the hostname), (2) 9 // connecting) sockets per "group" (generally speaking, the hostname), (2)
10 // maintaining a per-group list of idle, persistent sockets for reuse, and (3) 10 // maintaining a per-group list of idle, persistent sockets for reuse, and (3)
(...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 const scoped_refptr<SocketParams>& params, 734 const scoped_refptr<SocketParams>& params,
735 RequestPriority priority, 735 RequestPriority priority,
736 ClientSocketHandle* handle, 736 ClientSocketHandle* handle,
737 const CompletionCallback& callback, 737 const CompletionCallback& callback,
738 const BoundNetLog& net_log) { 738 const BoundNetLog& net_log) {
739 scoped_ptr<const Request> request( 739 scoped_ptr<const Request> request(
740 new Request(handle, callback, priority, 740 new Request(handle, callback, priority,
741 internal::ClientSocketPoolBaseHelper::NORMAL, 741 internal::ClientSocketPoolBaseHelper::NORMAL,
742 params->ignore_limits(), 742 params->ignore_limits(),
743 params, net_log)); 743 params, net_log));
744 return helper_.RequestSocket( 744 return helper_.RequestSocket(group_name, request.Pass());
745 group_name,
746 request.template PassAs<
747 const internal::ClientSocketPoolBaseHelper::Request>());
748 } 745 }
749 746
750 // RequestSockets bundles up the parameters into a Request and then forwards 747 // RequestSockets bundles up the parameters into a Request and then forwards
751 // to ClientSocketPoolBaseHelper::RequestSockets(). Note that it assigns the 748 // to ClientSocketPoolBaseHelper::RequestSockets(). Note that it assigns the
752 // priority to DEFAULT_PRIORITY and specifies the NO_IDLE_SOCKETS flag. 749 // priority to DEFAULT_PRIORITY and specifies the NO_IDLE_SOCKETS flag.
753 void RequestSockets(const std::string& group_name, 750 void RequestSockets(const std::string& group_name,
754 const scoped_refptr<SocketParams>& params, 751 const scoped_refptr<SocketParams>& params,
755 int num_sockets, 752 int num_sockets,
756 const BoundNetLog& net_log) { 753 const BoundNetLog& net_log) {
757 const Request request(NULL /* no handle */, 754 const Request request(NULL /* no handle */,
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 // Histograms for the pool 869 // Histograms for the pool
873 ClientSocketPoolHistograms* const histograms_; 870 ClientSocketPoolHistograms* const histograms_;
874 internal::ClientSocketPoolBaseHelper helper_; 871 internal::ClientSocketPoolBaseHelper helper_;
875 872
876 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase); 873 DISALLOW_COPY_AND_ASSIGN(ClientSocketPoolBase);
877 }; 874 };
878 875
879 } // namespace net 876 } // namespace net
880 877
881 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_ 878 #endif // NET_SOCKET_CLIENT_SOCKET_POOL_BASE_H_
OLDNEW
« no previous file with comments | « net/quic/quic_end_to_end_unittest.cc ('k') | net/socket/socket_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698