summaryrefslogtreecommitdiffstats
path: root/net/socket/client_socket_pool.h
Commit message (Collapse)AuthorAgeFilesLines
* Attempting to re-land a small portion of this change... Simply add links from rch@chromium.org2012-04-101-0/+21
| | | | | | | | | | | | | | | | | | | | | | | lower layer pools to higher layer pool. Revert 10006036 - Revert 130129 - Revert 129034 - Revert 127893 - Revert 127730 - Revert 127717 - Revert 118788 - Revert 113405 - Revert 113305 - Revert 113300 - Revert 112134 - Revert 112130 - Close idle connections / SPDY sessions when needed Due to the idle connection state being held by different socket pools, it's possible for one socket pool to hold an idle socket in a lower layer socket pool. From the lower level socket pool's perspective, the socket is being "actively" used. From the higher socket pool's (including SpdySession, which is more of a connection manager) perspective, the connection is idle and can be closed if we have hit a limit. Normally this isn't a big deal, except when we have a lot of idle SPDY connections and are connecting via a proxy, so we have low connection limits through the proxy server. We address this problem by allowing lower-level socket pools to tell higher level socket pools to close a socket. Fixed ASAN test failures by removing .Times(1) and .Times(2) from CloseMultipleIdleSocketsHeldByLayeredPoolWhenNeeded unittest (this removes the tests relying on the order of std::set in CloseOneIdleConnectionInLayeredPool). ASAN is prob ably causing the memory allocator to allocate the pools differently. The std::set is ordered by LayeredPool* which is the address of the LayeredPool (willchan). Added NET_EXPORT for layered_pool class defintion to fix windows shared compile. BUG=62364, 92244, 109876, 110368, 119847 TEST= Review URL: http://codereview.chromium.org/10026024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131604 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting again ... More crashes, and the instrumentation did not appear to helprch@chromium.org2012-04-061-37/+0
| | | | | | | | | | | | | | | | | | | | | | | | Revert 130129 - Revert 129034 - Revert 127893 - Revert 127730 - Revert 127717 - Revert 118788 - Revert 113405 - Revert 113305 - Revert 113300 - Revert 112134 - Revert 112130 - Close idle connections / SPDY sessions when needed Due to the idle connection state being held by different socket pools, it's possible for one socket pool to hold an idle socket in a lower layer socket pool. From the lower level socket pool's perspective, the socket is being "actively" used. From the higher socket pool's (including SpdySession, which is more of a connection manager) perspective, the connection is idle and can be closed if we have hit a limit. Normally this isn't a big deal, except when we have a lot of idle SPDY connections and are connecting via a proxy, so we have low connection limits through the proxy server. We address this problem by allowing lower-level socket pools to tell higher level socket pools to close a socket. Fixed ASAN test failures by removing .Times(1) and .Times(2) from CloseMultipleIdleSocketsHeldByLayeredPoolWhenNeeded unittest (this removes the tests relying on the order of std::set in CloseOneIdleConnectionInLayeredPool). ASAN is prob ably causing the memory allocator to allocate the pools differently. The std::set is ordered by LayeredPool* which is the address of the LayeredPool (willchan). Added NET_EXPORT for layered_pool class defintion to fix windows shared compile. BUG=62364, 92244, 109876, 110368, 119847 TEST= Review URL: http://codereview.chromium.org/9861032 TBR=rch@chromium.org Review URL: https://chromiumcodereview.appspot.com/10006036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131145 0039d316-1c4b-4281-b951-d872f2087c98
* Attempting to re-land this feature with instrumentation to track down the ↵rch@chromium.org2012-04-021-0/+37
| | | | | | | | | | | | | | | | | | | | | | | use-after-free. Revert 129034 - Revert 127893 - Revert 127730 - Revert 127717 - Revert 118788 - Revert 113405 - Revert 113305 - Revert 113300 - Revert 112134 - Revert 112130 - Close idle connections / SPDY sessions when needed Due to the idle connection state being held by different socket pools, it's possible for one socket pool to hold an idle socket in a lower layer socket pool. From the lower level socket pool's perspective, the socket is being "actively" used. From the higher socket pool's (including SpdySession, which is more of a connection manager) perspective, the connection is idle and can be closed if we have hit a limit. Normally this isn't a big deal, except when we have a lot of idle SPDY connections and are connecting via a proxy, so we have low connection limits through the proxy server. We address this problem by allowing lower-level socket pools to tell higher level socket pools to close a socket. Fixed ASAN test failures by removing .Times(1) and .Times(2) from CloseMultipleIdleSocketsHeldByLayeredPoolWhenNeeded unittest (this removes the tests relying on the order of std::set in CloseOneIdleConnectionInLayeredPool). ASAN is prob ably causing the memory allocator to allocate the pools differently. The std::set is ordered by LayeredPool* which is the address of the LayeredPool (willchan). Added NET_EXPORT for layered_pool class defintion to fix windows shared compile. BUG=62364, 92244, 109876, 110368, 119847 TEST= Review URL: http://codereview.chromium.org/9861032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130129 0039d316-1c4b-4281-b951-d872f2087c98
* Reverting this feature, once again. *sigh*rch@chromium.org2012-03-261-21/+0
| | | | | | | | | | | | | | | | | | | | Revert 127893 -Revert 127730 - Revert 127717 - Revert 118788 - Revert 113405 - Revert 113305 - Revert 113300 - Revert 112134 - Revert 112130 - Close idle connections / SPDY sessions when needed Due to the idle connection state being held by different socket pools, it's possible for one socket pool to hold an idle socket in a lower layer socket pool. From the lower level socket pool's perspective, the socket is being "actively" used. From the higher socket pool's (including SpdySession, which is more of a connection manager) perspective, the connection is idle and can be closed if we have hit a limit. Normally this isn't a big deal, except when we have a lot of idle SPDY connections and are connecting via a proxy, so we have low connection limits through the proxy server. We address this problem by allowing lower-level socket pools to tell higher level socket pools to close a socket. Fixed ASAN test failures by removing .Times(1) and .Times(2) from CloseMultipleIdleSocketsHeldByLayeredPoolWhenNeeded unittest (this removes the tests relying on the order of std::set in CloseOneIdleConnectionInLayeredPool). ASAN is prob ably causing the memory allocator to allocate the pools differently. The std::set is ordered by LayeredPool* which is the address of the LayeredPool (willchan). Added NET_EXPORT for layered_pool class defintion to fix windows shared compile. BUG=62364, 92244, 109876, 110368, 119847 TEST= Review URL: http://codereview.chromium.org/9809033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129034 0039d316-1c4b-4281-b951-d872f2087c98
* Attempting to re-land the feature.rch@chromium.org2012-03-211-0/+21
| | | | | | | | | | | | | | | | | | | | | | | Revert 127730 - Revert 127717 - Revert 118788 - Revert 113405 - Revert 113305 - Revert 113300 - Revert 112134 - Revert 112130 - Close idle connections / SPDY sessions when needed Due to the idle connection state being held by different socket pools, it's possible for one socket pool to hold an idle socket in a lower layer socket pool. From the lower level socket pool's perspective, the socket is being "actively" used. From the higher socket pool's (including SpdySession, which is more of a connection manager) perspective, the connection is idle and can be closed if we have hit a limit. Normally this isn't a big deal, except when we have a lot of idle SPDY connections and are connecting via a proxy, so we have low connection limits through the proxy server. We address this problem by allowing lower-level socket pools to tell higher level socket pools to close a socket. Fixed ASAN test failures by removing .Times(1) and .Times(2) from CloseMultipleIdleSocketsHeldByLayeredPoolWhenNeeded unittest (this removes the tests relying on the order of std::set in CloseOneIdleConnectionInLayeredPool). ASAN is prob ably causing the memory allocator to allocate the pools differently. The std::set is ordered by LayeredPool* which is the address of the LayeredPool (willchan). Added NET_EXPORT for layered_pool class defintion to fix windows shared compile. BUG=62364, 92244, 109876, 110368 TEST= Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=127717 Review URL: https://chromiumcodereview.appspot.com/9667016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127893 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 127717 - Revert 118788 - Revert 113405 - Revert 113305 - Revert ↵rch@chromium.org2012-03-201-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | 113300 - Revert 112134 - Revert 112130 - Close idle connections / SPDY sessions when needed Due to the idle connection state being held by different socket pools, it's possible for one socket pool to hold an idle socket in a lower layer socket pool. From the lower level socket pool's perspective, the socket is being "actively" used. From the higher socket pool's (including SpdySession, which is more of a connection manager) perspective, the connection is idle and can be closed if we have hit a limit. Normally this isn't a big deal, except when we have a lot of idle SPDY connections and are connecting via a proxy, so we have low connection limits through the proxy server. We address this problem by allowing lower-level socket pools to tell higher level socket pools to close a socket. Fixed ASAN test failures by removing .Times(1) and .Times(2) from CloseMultipleIdleSocketsHeldByLayeredPoolWhenNeeded unittest (this removes the tests relying on the order of std::set in CloseOneIdleConnectionInLayeredPool). ASAN is prob ably causing the memory allocator to allocate the pools differently. The std::set is ordered by LayeredPool* which is the address of the LayeredPool (willchan). Added NET_EXPORT for layered_pool class defintion to fix windows shared compile. BUG=62364, 92244, 109876, 110368 TEST= Review URL: http://codereview.chromium.org/9667016 TBR=rch@chromium.org Review URL: https://chromiumcodereview.appspot.com/9760002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127730 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 118788 - Revert 113405 - Revert 113305 - Revert 113300 - Revert ↵rch@chromium.org2012-03-201-0/+21
| | | | | | | | | | | | | | | | | | | | | | 112134 - Revert 112130 - Close idle connections / SPDY sessions when needed Due to the idle connection state being held by different socket pools, it's possible for one socket pool to hold an idle socket in a lower layer socket pool. From the lower level socket pool's perspective, the socket is being "actively" used. From the higher socket pool's (including SpdySession, which is more of a connection manager) perspective, the connection is idle and can be closed if we have hit a limit. Normally this isn't a big deal, except when we have a lot of idle SPDY connections and are connecting via a proxy, so we have low connection limits through the proxy server. We address this problem by allowing lower-level socket pools to tell higher level socket pools to close a socket. Fixed ASAN test failures by removing .Times(1) and .Times(2) from CloseMultipleIdleSocketsHeldByLayeredPoolWhenNeeded unittest (this removes the tests relying on the order of std::set in CloseOneIdleConnectionInLayeredPool). ASAN is prob ably causing the memory allocator to allocate the pools differently. The std::set is ordered by LayeredPool* which is the address of the LayeredPool (willchan). Added NET_EXPORT for layered_pool class defintion to fix windows shared compile. BUG=62364, 92244, 109876, 110368 TEST= Review URL: http://codereview.chromium.org/9667016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@127717 0039d316-1c4b-4281-b951-d872f2087c98
* Revert r113405, since it appears to be causing a crash and a hang. Also ↵eroman@chromium.org2012-01-241-22/+1
| | | | | | | | | | reverted r118506 since it is no longer applicable. BUG=109876, 110368, 62364, 92244 Review URL: https://chromiumcodereview.appspot.com/9226039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118788 0039d316-1c4b-4281-b951-d872f2087c98
* base::Bind: Finish converting net/socket.jhawkins@chromium.org2011-12-211-1/+1
| | | | | | | | | | BUG=none TEST=none R=groby Review URL: http://codereview.chromium.org/9008004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115405 0039d316-1c4b-4281-b951-d872f2087c98
* base::Bind: Convert most of net/http.jhawkins@chromium.org2011-12-201-1/+1
| | | | | | | | | | BUG=none TEST=none R=csilv Review URL: http://codereview.chromium.org/8990001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115220 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 113305 - Revert 113300 - Revert of 112134 of Revert 112130 - Close ↵rtenneti@google.com2011-12-071-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | idle connections / SPDY sessions when needed. Due to the idle connection state being held by different socket pools, it's possible for one socket pool to hold an idle socket in a lower layer socket pool. From the lower level socket pool's perspective, the socket is being "actively" used. From the higher socket pool's (including SpdySession, which is more of a connection manager) perspective, the connection is idle and can be closed if we have hit a limit. Normally this isn't a big deal, except when we have a lot of idle SPDY connections and are connecting via a proxy, so we have low connection limits through the proxy server. We address this problem by allowing lower-level socket pools to tell higher level socket pools to close a socket. Fixed ASAN test failures by removing .Times(1) and .Times(2) from CloseMultipleIdleSocketsHeldByLayeredPoolWhenNeeded unittest (this removes the tests relying on the order of std::set in CloseOneIdleConnectionInLayeredPool). ASAN is prob ably causing the memory allocator to allocate the pools differently. The std::set is ordered by LayeredPool* which is the address of the LayeredPool (willchan). Added NET_EXPORT for layered_pool class defintion to fix windows shared compile. BUG=62364, 92244, 105839 TEST=none Review URL: http://codereview.chromium.org/8340012 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/8745007 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/8803019 TBR=rtenneti@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=113305 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/8836002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113405 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 113300 - Revert of 112134 of Revert 112130 - Close idle connections / ↵rtenneti@chromium.org2011-12-071-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | SPDY sessions when needed. Due to the idle connection state being held by different socket pools, it's possible for one socket pool to hold an idle socket in a lower layer socket pool. From the lower level socket pool's perspective, the socket is being "actively" used. From the higher socket pool's (including SpdySession, which is more of a connection manager) perspective, the connection is idle and can be closed if we have hit a limit. Normally this isn't a big deal, except when we have a lot of idle SPDY connections and are connecting via a proxy, so we have low connection limits through the proxy server. We address this problem by allowing lower-level socket pools to tell higher level socket pools to close a socket. Fixed ASAN test failures by removing .Times(1) and .Times(2) from CloseMultipleIdleSocketsHeldByLayeredPoolWhenNeeded unittest (this removes the tests relying on the order of std::set in CloseOneIdleConnectionInLayeredPool). ASAN is probably causing the memory allocator to allocate the pools differently. The std::set is ordered by LayeredPool* which is the address of the LayeredPool (willchan). BUG=62364,92244, 105839 TEST=none Review URL: http://codereview.chromium.org/8340012 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/8745007 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/8803019 TBR=rtenneti@chromium.org Review URL: http://codereview.chromium.org/8825014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113305 0039d316-1c4b-4281-b951-d872f2087c98
* Revert of 112134 of Revert 112130 - Close idle connections / SPDY sessions ↵rtenneti@chromium.org2011-12-061-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | when needed. Due to the idle connection state being held by different socket pools, it's possible for one socket pool to hold an idle socket in a lower layer socket pool. From the lower level socket pool's perspective, the socket is being "actively" used. From the higher socket pool's (including SpdySession, which is more of a connection manager) perspective, the connection is idle and can be closed if we have hit a limit. Normally this isn't a big deal, except when we have a lot of idle SPDY connections and are connecting via a proxy, so we have low connection limits through the proxy server. We address this problem by allowing lower-level socket pools to tell higher level socket pools to close a socket. Fixed ASAN test failures by removing .Times(1) and .Times(2) from CloseMultipleIdleSocketsHeldByLayeredPoolWhenNeeded unittest (this removes the tests relying on the order of std::set in CloseOneIdleConnectionInLayeredPool). ASAN is probably causing the memory allocator to allocate the pools differently. The std::set is ordered by LayeredPool* which is the address of the LayeredPool (willchan). BUG=62364,92244, 105839 TEST=none Review URL: http://codereview.chromium.org/8340012 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/8745007 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/8803019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113300 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 112130 - Close idle connections / SPDY sessions when needed.sail@chromium.org2011-11-301-19/+0
| | | | | | | | | | | | | | | | | Due to the idle connection state being held by different socket pools, it's possible for one socket pool to hold an idle socket in a lower layer socket pool. From the lower level socket pool's perspective, the socket is being "actively" used. From the higher socket pool's (including SpdySession, which is more of a connection manager) perspective, the connection is idle and can be closed if we have hit a limit. Normally this isn't a big deal, except when we have a lot of idle SPDY connections and are connecting via a proxy, so we have low connection limits through the proxy server. We address this problem by allowing lower-level socket pools to tell higher level socket pools to close a socket. BUG=62364,92244, 105839 TEST=none Review URL: http://codereview.chromium.org/8340012 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/8745007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112134 0039d316-1c4b-4281-b951-d872f2087c98
* Close idle connections / SPDY sessions when needed.willchan@chromium.org2011-11-301-0/+19
| | | | | | | | | | | | | | Due to the idle connection state being held by different socket pools, it's possible for one socket pool to hold an idle socket in a lower layer socket pool. From the lower level socket pool's perspective, the socket is being "actively" used. From the higher socket pool's (including SpdySession, which is more of a connection manager) perspective, the connection is idle and can be closed if we have hit a limit. Normally this isn't a big deal, except when we have a lot of idle SPDY connections and are connecting via a proxy, so we have low connection limits through the proxy server. We address this problem by allowing lower-level socket pools to tell higher level socket pools to close a socket. BUG=62364,92244 TEST=none Review URL: http://codereview.chromium.org/8340012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@112130 0039d316-1c4b-4281-b951-d872f2087c98
* Expose some network configurations for performance tuning.wangxianzhu@chromium.org2011-10-121-2/+5
| | | | | | | | | | | | Make used_idle_socket_timeout configurable. Expose max_sockets_per_pool. BUG= TEST= Review URL: http://codereview.chromium.org/8073018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105046 0039d316-1c4b-4281-b951-d872f2087c98
* Begin CompletionCallback switchover.willchan@chromium.org2011-10-011-2/+2
| | | | | | | | | | | | | Rename CompletionCallback to OldCompletionCallback in preparation for introducing a new CompletionCallback based on base::Callback. Also renames other CompletionCallback types like CancelableCompletionCallback and TestCompletionCallback and CompletionCallbackImpl. All using sed with s/CompletionCallback/OldCompletionCallback/g. BUG=98719 TEST=none Review URL: http://codereview.chromium.org/8070013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103650 0039d316-1c4b-4281-b951-d872f2087c98
* Rename NET_API to NET_EXPORT, and rename NET_TEST to NET_EXPORT_PRIVATE.darin@chromium.org2011-08-121-2/+2
| | | | | | Review URL: http://codereview.chromium.org/7529043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96560 0039d316-1c4b-4281-b951-d872f2087c98
* Move base/values.h into the base namespace. This includes a cros DEPS rolldmazzoni@chromium.org2011-07-121-3/+6
| | | | | | | | | | with a minor change to that code since libcros also uses base/values.h. BUG=88666 TEST=none Review URL: http://codereview.chromium.org/7259019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@92208 0039d316-1c4b-4281-b951-d872f2087c98
* Net: Add net_api to the socket codervargas@google.com2011-05-191-1/+2
| | | | | | | | BUG=76997 TEST=NONE Review URL: http://codereview.chromium.org/7011056 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85982 0039d316-1c4b-4281-b951-d872f2087c98
* Rename ClientSocket to StreamSocket.sergeyu@chromium.org2011-05-051-4/+4
| | | | | | | | | BUG=80895 TEST=Compiles Review URL: http://codereview.chromium.org/6930014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@84167 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | raw_scoped_refptr_mismatch_checker.h ref_counted.cc ref_counted.h ref_counted_memory.cc ref_counted_memory.h ref_counted_unittest.cc scoped_callback_factory.h scoped_comptr_win.h scoped_handle.h scoped_native_library.cc scoped_native_library.h scoped_native_library_unittest.cc scoped_nsobject.h scoped_open_process.h scoped_ptr.h scoped_ptr_unittest.cc scoped_temp_dir.cc scoped_temp_dir.h scoped_temp_dir_unittest.cc scoped_vector.h singleton.h singleton_objc.h singleton_unittest.cc linked_ptr.h linked_ptr_unittest.cc weak_ptr.cc weak_ptr.h weak_ptr_unittest.cc BUG=None TEST=Compile Review URL: http://codereview.chromium.org/6714032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79524 0039d316-1c4b-4281-b951-d872f2087c98
* Allow a non-200 (or non-407) response for a CONNECT request from an HTTPS proxyrch@chromium.org2010-12-171-2/+2
| | | | | | | | | | | | | | | | | to be consumed by chrome. Among other things, this will allow the proxy to inform the user that the hostname could not be resolved or similar conditions. This adds a new OnHttpsProxyTunnelConnectionResponse method to StreamRequest::Delegate which is invoked when an HTTPS proxy returns a non-200, non-407 response. The method is called with an HttpResponseInfor argument to access the request headers, and an HttpStream argument to access the response body. BUG=none TEST=HttpNetworkTransactionTest Review URL: http://codereview.chromium.org/4935001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69513 0039d316-1c4b-4281-b951-d872f2087c98
* Plumb up the preconnect logic from pools to StreamFactory.willchan@chromium.org2010-10-161-6/+17
| | | | | | | | | BUG=54450 TEST=none Review URL: http://codereview.chromium.org/3750009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62827 0039d316-1c4b-4281-b951-d872f2087c98
* Add ClientSocketPoolBaseHelper support for preconnect.willchan@chromium.org2010-10-131-0/+15
| | | | | | | | | | | | | | | | | | | Adds a RequestSockets() API to ClientSocketPool interface. - no RequestPriority param, all requests default to LOWEST. - adds a |num_sockets| param to control how many sockets to try to ensure are connected. Adds an implementation for said function in ClientSocketPoolBaseHelper. Adds a new ClientSocketPoolBaseHelper::Flag type to modify socket request behavior. In this case, we bypass idle sockets. Adds a preconnect concept to ConnectJob. This lets normal requests hijack preconnect jobs. Modifies all ClientSocketPool subclasses to support new RequestSockets API(). Adds new tests. No client actually uses this API yet. We need to plumb it up to the preconnect system. BUG=54450 TEST=new tests in ClientSocketPoolBaseTest Review URL: http://codereview.chromium.org/3689004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62365 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Move ctors/dtors into implementation files. Adds ctors/dtors to ↵erg@google.com2010-09-301-2/+2
| | | | | | | | | | | | | | non-POD structs. Cuts ~2MB off our .a files (Debug, Linux). Also added the "virtual" keyword on a whole bunch of virtual dtors that were missing it. BUG=none TEST=compiles Review URL: http://codereview.chromium.org/3522004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61100 0039d316-1c4b-4281-b951-d872f2087c98
* Stop refcounting ClientSocketPool.willchan@chromium.org2010-09-291-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Establishes that HttpNetworkSession owns all the socket pools. Move out all the socket pools into a ClientSocketPoolManager. This is because of the dependency tree amongst socket pools, which dictates the order in which they must be constructed and destructed. In order to better establish it, I moved them out to their own class. HttpNetworkSession owns the ClientSocketPoolManager which owns the pools. We pass the pools as raw pointers everywhere. Note that ClientSocketPoolManager owns more pools than are publicly accessible via its interface. That's because some of them are wrapped by publicly exposed pools. Also, ClientSocketPoolHistograms used to be reference counted. That's because it can be shared by multiple ClientSocketPools. But it's effectively a global as well, so I make their lifetimes persist for the length of ClientSocketPoolManager too. I also removed internal refcounting in ClientSocketPoolBase. I had refcounted it before I knew about ScopedRunnableMethodFactory back when I first started. I cleaned up the unit tests a lot. Back when I was a young padawan, I didn't really know what I was doing, so I copy/pasted a metric asston of code. Turns out most of it was stupid, so I fixed it. I also stopped the use of implementation inheritance with ClientSocketPoolTest because it's discouraged by the style guide and more importantly because it caused the ClientSocketHandles within the TestSocketRequest vector to be destroyed _after_ the pools themselves were destroyed, which is bad since the handles will call pool_->Release() which blows up. BUG=56215,56215 TEST=Existing unit tests Review URL: http://codereview.chromium.org/3389020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60983 0039d316-1c4b-4281-b951-d872f2087c98
* Add missing nested socket pools to socket pool info page. Each socket pool ↵mmenke@chromium.org2010-09-081-5/+8
| | | | | | | | | | | should be displayed once and only once. Also, if more than one proxy is in use, socket pools with the same proxy will appear adjacent to each other. BUG=39756 TEST=manual Review URL: http://codereview.chromium.org/3328009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58826 0039d316-1c4b-4281-b951-d872f2087c98
* Sockets page on net-internals now displays some information about the ↵mmenke@chromium.org2010-08-301-0/+7
| | | | | | | | | | current socket pool state. Table padding slightly increased for legibility. TEST=manual BUG=39756 Review URL: http://codereview.chromium.org/3267002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57869 0039d316-1c4b-4281-b951-d872f2087c98
* FBTF: Remove unnecessary STL #includes from src/net.viettrungluu@chromium.org2010-08-191-1/+0
| | | | | | | | | | | | This removes obviously unneeded inclusions of <map>, <set>, <string>, <vector>, etc. from src/net. BUG=none TEST=builds Review URL: http://codereview.chromium.org/3132022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56654 0039d316-1c4b-4281-b951-d872f2087c98
* `#pragma once` for app, base, chrome, gfx, ipc, net, skia, viewsthakis@chromium.org2010-07-261-0/+1
| | | | | | | | | BUG=50273 TEST=everything still builds, build is 10% faster on windows, same speed on mac/linux TBR: erg git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53716 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor how ClientSocketPoolBaseHelper avoids re-entrancy.willchan@chromium.org2010-07-151-1/+1
| | | | | | | | | Specifically, we defer asynchronous user callbacks to tasks. BUG=48861 Review URL: http://codereview.chromium.org/2994003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52509 0039d316-1c4b-4281-b951-d872f2087c98
* Implement SSLClientSocketPool.vandebo@chromium.org2010-07-141-2/+3
| | | | | | | | | | | | To support SSLClientSocketPool, ClientSocketPoolBase and ClientSocketHandle require a notion of additional error state reported from the pool. Overtime the error handling may get become more integrated, alleviating the need for some of the additional error state. To support getting Http Proxy credentials from the user, the SSLClientSocketPool will release unauthenticated HttpProxyClientSocket's into the pool as idle. However, it checks their authentication status when receiving one, completing the authentication once the user has provided the credentials. BUG=30357 TEST=existing unit tests, ClientSocketPoolBaseTest.AdditionalErrorState*, SSLClientSocketPoolTest.* Review URL: http://codereview.chromium.org/2870030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52275 0039d316-1c4b-4281-b951-d872f2087c98
* Make the various SocketParams reference counted.vandebo@chromium.org2010-07-121-3/+5
| | | | | | | | | | | This is so that the SSLSocketParam can hold one of any of the existing SocketParams. BUG=30357 TEST=existing unit tests Review URL: http://codereview.chromium.org/2848029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52107 0039d316-1c4b-4281-b951-d872f2087c98
* Put HttpProxyClientSocket into a pool.vandebo@chromium.org2010-07-121-4/+9
| | | | | | | | | | | | | | | This CL requires http://codereview.chromium.org/2799036 - Cleanup the HttpProxyClientSocket interface a touch. - Make HttpAuthController reference counted. - Enable ClientSocketPool to return recoverable connections. BUG=42795 TEST=existing unit tests Review URL: http://codereview.chromium.org/2817033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52104 0039d316-1c4b-4281-b951-d872f2087c98
* A/B test for determining a value for unused socket timeout. Currently theziadh@chromium.org2010-06-211-0/+4
| | | | | | | | | | | | | | timeout defaults to 10 seconds. Having this value set too low won't allow us to take advantage of idle sockets. Setting it to too high could possibly result in more ERR_CONNECT_RESETs, requiring one RTT to receive the RST packet and possibly another RTT to re-establish the connection. r=jar Review URL: http://codereview.chromium.org/2827016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50364 0039d316-1c4b-4281-b951-d872f2087c98
* Improve error messages for bad SocketParams.willchan@chromium.org2010-06-151-6/+17
| | | | | | | | | | Make it a compile-time error instead of link-time. Add a check to make sure you don't try to use it with a pointer. BUG=41016 Review URL: http://codereview.chromium.org/1604042 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49823 0039d316-1c4b-4281-b951-d872f2087c98
* Do not attempt to reuse active sockets after a socket pool flush (usually a ↵willchan@chromium.org2010-06-071-2/+12
| | | | | | | | | | | network change). Implements this functionality by adding an |id_| field to ClientSocketPoolBaseHelper that is incremented on each Flush(). BUG=45872 Review URL: http://codereview.chromium.org/2647003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49076 0039d316-1c4b-4281-b951-d872f2087c98
* Make ClientSocketPool histograms static so that they work properly.vandebo@chromium.org2010-05-201-2/+4
| | | | | | | | | | | | Also change their names so that they appear all together on the histograms page. BUG=43375 TEST=none Review URL: http://codereview.chromium.org/2029004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47843 0039d316-1c4b-4281-b951-d872f2087c98
* Implement SOCKSClientSocketPoolvandebo@chromium.org2010-03-221-2/+9
| | | | | | | | | | | | | | This is the first layered pool, so there are several infrastructure changes in this change as well. Add a ConnectionTimeout method to pools so that layered pools can timeout each phase. Add a name method to pools to support per pool UMA histograms. Change SOCKS sockets to take a ClientSocketHandle instead of a ClientSocket BUG=30357 (blocks an SSL Pool) TEST=existing unit tests Review URL: http://codereview.chromium.org/668097 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42231 0039d316-1c4b-4281-b951-d872f2087c98
* Generalize the net module's LoadLog facility from a passive container, to an ↵eroman@chromium.org2010-03-161-2/+2
| | | | | | | | | | | | | | | | event stream (NetLog). This makes it possible to associate a single NetLog with a URLRequestContext, and then attach observers to that log to watch the stream of events. This changelist attempts to do the most direct translation, so there will be subsequent iterations to clean up. The user-visible behavior should remain unchanged. BUG=37421 Review URL: http://codereview.chromium.org/848006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41689 0039d316-1c4b-4281-b951-d872f2087c98
* When connect takes too long for a new socket group, issue a singlembelshe@chromium.org2010-03-141-0/+3
| | | | | | | | | | | | backup socket request to retry the connect. This reduces latency in the presence of packet loss. BUG=36629 TEST=TCPClientSocketPoolTest.BackupSocket* Review URL: http://codereview.chromium.org/842004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41543 0039d316-1c4b-4281-b951-d872f2087c98
* Update network priorities to support better granularitymbelshe@google.com2009-12-021-1/+2
| | | | | | | | | | | | | | of resource loading from WebKit into the network stack. In order to fully make these work, webkit changes are needed as well. BUG=none TEST=none Review URL: http://codereview.chromium.org/452033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33546 0039d316-1c4b-4281-b951-d872f2087c98
* Make ClientSocketHandle::Init() typesafe.willchan@chromium.org2009-08-191-0/+16
| | | | | | | | | | | Introduce a REGISTER_SOCKET_PARAMS_FOR_POOL macro to register valid SocketParams for a ClientSocketPool subtype. Update HttpNetworkSession's ClientSocketPool to return the concrete TCPClientSocketPool instead of the parent interface. Renamed the member variable&accessor. Updated tests. BUG=http://crbug.com/13289 Review URL: http://codereview.chromium.org/173018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23743 0039d316-1c4b-4281-b951-d872f2087c98
* Make ClientSocketPool/ClientSocketPoolBase/ClientSocketHandle more generic.willchan@chromium.org2009-08-141-1/+1
| | | | | | | | | | | | | | | This is in preparation for creating an SSLClientSocketPool. ClientSocketPoolBase is now templated. Most of the implementation has moved to ClientSocketPoolBaseHelper which is not templated. In order to make this possible, ClientSocketPoolBaseHelper's internal data structures do not use the full concrete Request type, but rather use a pointer to Request. ClientSocketPoolBase takes a SocketParams as a template argument, primarily to allow RequestSocket to take a templated parameter that contains all the information necessary to connect the socket (be it TCP or SSL or whatever). ClientSocketPool::RequestSocket() and ClientSocketHandle::Init() have been templated as well to handle this case. I've left adding run-time type safety checks as a TODO. TEST=net_unittests BUG=http://crbug.com/13289 Review URL: http://codereview.chromium.org/160621 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23427 0039d316-1c4b-4281-b951-d872f2087c98
* LoadLog is used as an output parameter, reorder it to the last parameter.willchan@chromium.org2009-08-141-3/+3
| | | | | | Review URL: http://codereview.chromium.org/164531 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23419 0039d316-1c4b-4281-b951-d872f2087c98
* Add a "LoadLog" parameter to transactions, hostresolver, clientsocketpool ↵ericroman@google.com2009-08-121-1/+3
| | | | | | | | and proyxservice.This dependency comes from the parent URLRequest, and is used as a container for per-request profiling data.This change is strictly a no-op refactor -- the parameter is unused, and LoadLog does nothing.BUG=http://crbug.com/14478TEST=none -- just needs to compile and pass existing tests.DESIGN=<http://docs.google.com/Doc?id=dfhcnb2v_21gbtrcpr3&hl=en> Review URL: http://codereview.chromium.org/126303 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23127 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor ClientSocketPoolBase to be testable without host resolution / tcp ↵willchan@chromium.org2009-06-301-3/+0
| | | | | | | | | | | connections. BUG=http://crbug.com/13289 TEST=none Review URL: http://codereview.chromium.org/147252 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19620 0039d316-1c4b-4281-b951-d872f2087c98
* Move socket related files from net/base to net/socket.willchan@chromium.org2009-06-221-0/+97
Review URL: http://codereview.chromium.org/144009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18985 0039d316-1c4b-4281-b951-d872f2087c98