summaryrefslogtreecommitdiffstats
path: root/net/socket/tcp_client_socket_pool.h
Commit message (Collapse)AuthorAgeFilesLines
* Rename a number of classes previously labeled "TCP" to "Transport" inmbelshe@chromium.org2011-04-071-197/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | preparation for non-TCP transports. This helps because the alternative is to either use non-TCP protocols (like SCTP) in classes which are called "TCPClientSocketPool", or to clone the code as "SCTPClientSocketPool", both of which are less than ideal. For now, we're just testing transports, so the TransportSocketPool classes will determine a single type of transport and just use them. In the future we'll likely need to figure out how to deal with runtime selection of transports, and probably support use of multiple transports either within the same pools or within subpools. But that is for the future. Note that the histograms have some "tcp" references to them. I didn't change these to "transport" yet, because it will effect existing histograms. Renames include: classes: TCPClientSocketPool -> TransportClientSocketPool MockTCPClientSocketPool -> MockTransportClientSocketPool TCPSocketParams -> TransportSocketParams methods (not the exhaustive list): CreateTCPClientSocket() -> CreateTransportClientSocket() DoTCPConnect() -> DoTransportConnect() BUG=none TEST=none Review URL: http://codereview.chromium.org/6804028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80781 0039d316-1c4b-4281-b951-d872f2087c98
* Add ignore limits flag and use for sync requestkristianm@google.com2011-03-301-1/+4
| | | | | | | | | | | | | Letting sync request ignore the socket and group limits when loading to prevent the WebCore thread from locking up. BUG=45986,58703 TEST=No new tests Review URL: http://codereview.chromium.org/6756004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79817 0039d316-1c4b-4281-b951-d872f2087c98
* Move some files from base to base/memory.levin@chromium.org2011-03-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert 78061 - Revert 78034 - Removing a TODO and cleaning up code.kristianm@google.com2011-03-151-4/+0
| | | | | | | | | | | | | | | | | | | This is done in preparation of a patch to let some request ignore the max sockets and max sockets to group limits. BUG=none TEST=none Review URL: http://codereview.chromium.org/6679001 TBR=kristianm@google.com Review URL: http://codereview.chromium.org/6685057 TBR=kristianm@google.com Review URL: http://codereview.chromium.org/6696017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78189 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 78034 - Removing a TODO and cleaning up code.kristianm@google.com2011-03-141-0/+4
| | | | | | | | | | | | | | | | This is done in preparation of a patch to let some request ignore the max sockets and max sockets to group limits. BUG=none TEST=none Review URL: http://codereview.chromium.org/6679001 TBR=kristianm@google.com Review URL: http://codereview.chromium.org/6685057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78061 0039d316-1c4b-4281-b951-d872f2087c98
* Removing a TODO and cleaning up code.kristianm@google.com2011-03-141-4/+0
| | | | | | | | | | | | | This is done in preparation of a patch to let some request ignore the max sockets and max sockets to group limits. BUG=none TEST=none Review URL: http://codereview.chromium.org/6679001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78034 0039d316-1c4b-4281-b951-d872f2087c98
* Even more reordering the methods in headers and implementation in net/.erg@google.com2011-01-201-5/+5
| | | | | | | | | BUG=68682 TEST=compiles Review URL: http://codereview.chromium.org/6314010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71880 0039d316-1c4b-4281-b951-d872f2087c98
* Start deinlining non-empty virtual methods. (This will be automatically checkederg@google.com2010-12-091-21/+5
| | | | | | | | | | | for in the future.) BUG=none TEST=compiles Review URL: http://codereview.chromium.org/5574006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68746 0039d316-1c4b-4281-b951-d872f2087c98
* Add ClientSocketPoolBaseHelper support for preconnect.willchan@chromium.org2010-10-131-0/+5
| | | | | | | | | | | | | | | | | | | 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
* Stop refcounting HostResolver.willchan@chromium.org2010-10-011-1/+1
| | | | | | | | | BUG=46049 TEST=none Review URL: http://codereview.chromium.org/3601002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61256 0039d316-1c4b-4281-b951-d872f2087c98
* Stop refcounting ClientSocketPool.willchan@chromium.org2010-09-291-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* net: Fix incorrect style used in some enumerations.tfarina@chromium.org2010-09-221-5/+5
| | | | | | | | | | | | | | | | | | | Reason: They are using kConstantNaming, however the Chromium style is to use UPPER_CASE_FOR_ENUMS. Also convert some truly constants, like the following: http/http_proxy_client_socket_pool.h: enum { kDrainBodyBufferSize = 1024 }; To: static const int kDrainBodyBufferSize = 1024; BUG=55668 TEST=compiles locally. Review URL: http://codereview.chromium.org/3421026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60155 0039d316-1c4b-4281-b951-d872f2087c98
* Add missing nested socket pools to socket pool info page. Each socket pool ↵mmenke@chromium.org2010-09-081-2/+3
| | | | | | | | | | | 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/+5
| | | | | | | | | | 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
* `#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-0/+2
| | | | | | | | | | | | 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-12/+9
| | | | | | | | | | | 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
* Massively simplify the NetworkChangeNotifier infrastructure:pkasting@chromium.org2010-06-251-1/+0
| | | | | | | | | | | | | | * Use a process-wide object (singleton pattern) * Create/destroy this object on the main thread, make it outlive all consumers * Make observer-related functions threadsafe As a result, the notifier can now be used by any thread (eliminating things like NetworkChangeObserverProxy and NetworkChangeNotifierProxy, and expanding its usefulness); its creation and inner workings are much simplified (eliminating implementation-specific classes); and it is simpler to access (eliminating things like NetworkChangeNotifierThread and a LOT of passing pointers around). BUG=none TEST=Unittests; network changes still trigger notifications Review URL: http://codereview.chromium.org/2802015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50895 0039d316-1c4b-4281-b951-d872f2087c98
* Improve error messages for bad SocketParams.willchan@chromium.org2010-06-151-1/+1
| | | | | | | | | | 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-1/+4
| | | | | | | | | | | 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
* Rework the logging for sockets/connectjobs.eroman@chromium.org2010-06-031-6/+9
| | | | | | | | | | | | | | | | | | In particular, make it work better when using backup jobs / late binding (the display was very confused before because of how these asynchronous events would nest). Also changed the paradigm for how PassiveLogCollector preserves these async associations -- this fixes how it replays the events to net-internals. (Before we would collapse the event streams into the SOURCE_URL_REQUEST which lost some hiearchy.. now I keep the separate streams). Some of the particular changes to the event streams: * ConnectJobs now create their own source stream internally. * Sockets are now bounded by +SOCKET_ALIVE / -SOCKET_ALIVE events (removed the one-off SOCKET_DONE event). * The socket log streams contains +SOCKET_IN_USE / -SOCKET_IN_USE event blocks to show which URLRequest was controlling it at various points in time (this makes it much easier to understand which read/writes belonged to a particular network transaction when a socket gets re-used). * ConnectJobs are bounded by +SOCKET_POOL_CONNECT_JOB / - SOCKET_POOL_CONNECT_JOB events. * ConnectJobs log the net error they failed with. * Removed the SOCKET_BACKUP_TIMER_EXTENDED event. Review URL: http://codereview.chromium.org/2363003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48797 0039d316-1c4b-4281-b951-d872f2087c98
* Make ClientSocketPool histograms static so that they work properly.vandebo@chromium.org2010-05-201-2/+5
| | | | | | | | | | | | 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
* Revert r47395. Looks like it still crashes =/willchan@chromium.org2010-05-201-1/+2
| | | | | | | | BUG=40455,40457 Review URL: http://codereview.chromium.org/2104013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47753 0039d316-1c4b-4281-b951-d872f2087c98
* This is roughly a reland of r43908, although I had to rewrite a fair chunk ↵willchan@chromium.org2010-05-171-2/+1
| | | | | | | | | | since code's changed a lot. I've changed it so as not to flush the host resolver too. I suspect there might have been a bug there. I was unable to reproduce the crash here on network change, so I think either that fixed it or something else changed under the hood. In any case, I want to reland this and see if anyone encounters any problems with it. BUG=40455,40457 Review URL: http://codereview.chromium.org/2114004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47395 0039d316-1c4b-4281-b951-d872f2087c98
* Implement a 15 connection per proxy server limit.willchan@chromium.org2010-04-291-3/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, we had a limit of 6 connections per proxy server, which was horrifically low. Connections to all endpoint hosts remains at 6. Basically, we have a map of socket pools, keyed by the proxy server. Each of these proxy socket pools has a socket limit of 15 and a connection limit per host of 6. The main TCP socket pool (non-proxied) has the standard 256 socket limit, and connection limit per host of 6. There are two maps currently, one for HTTP proxies and one for SOCKS proxies. Note that SSL tunnels over HTTP CONNECTs are still located within the standard http proxy socket pools. We depend on the fact that our code never returns a non-SSL connected socket to the pool for a |connection_group| that is to a HTTPS endpoint. A newly connected socket from the pool will only have the TCP connection done. An idle socket will have both the TCP and the HTTP CONNECT and the SSL handshake done for it. TODO(willchan): Remove the extra constructor overload for the old deprecated parameters. Switch to using HostPortPair everywhere. TODO(willchan): Finish SSL socket pools. TODO(willchan): Rip out the DoInitConnection() code so it can be shared by other caller (TCP pre-warming!). TODO(willchan): Flush out the socket pool maps when the proxy configuration changes. TODO(willchan): Fix up global socket limits. They're slightly broken in this case, since each pool instance has its own "global" limit, so obviously different pools don't share the same "global" limit. This is such a minor deal since the global limits are so small for proxy servers compared to the system global limits (256 vs 15), that it doesn't have a big effect. TODO(willchan): Drink moar b33r. BUG=12066 Review URL: http://codereview.chromium.org/1808001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45896 0039d316-1c4b-4281-b951-d872f2087c98
* Fix crash on IP address change.willchan@chromium.org2010-04-191-1/+2
| | | | | | | | | | Revert r43908: "Flush socket pools and SPDY session pool properly on explicit requests and network changes." This change was reverted on the 375 branch, but not on trunk. BUG=41190 Review URL: http://codereview.chromium.org/1604045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44973 0039d316-1c4b-4281-b951-d872f2087c98
* Flush socket pools and SPDY session pool properly on explicit requests and ↵willchan@chromium.org2010-04-081-2/+1
| | | | | | | | | | network changes. BUG=40455,40457 Review URL: http://codereview.chromium.org/1615005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43908 0039d316-1c4b-4281-b951-d872f2087c98
* Implement SOCKSClientSocketPoolvandebo@chromium.org2010-03-221-0/+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-3/+3
| | | | | | | | | | | | | | | | 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
* Make a proper TCPSocketParamsvandebo@chromium.org2010-02-271-5/+25
| | | | | | | | | BUG=none TEST=existing unit tests Review URL: http://codereview.chromium.org/661194 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40182 0039d316-1c4b-4281-b951-d872f2087c98
* Pass the NetworkChangeNotifier to HostResolver.willchan@chromium.org2010-02-041-1/+1
| | | | | | | | | | | | | | | This requires the following refactors: (1) NetworkChangeNotifier moves out of HttpNetworkSession into IOThread. (2) HostResolver gets initialized with NetworkChangeNotifier. (3) NetworkChangeNotifier needs to get passed into HttpCache and HttpNetworkSession (required updating a lot of files). (4) NetworkChangeNotifier is no longer reference counted. It is owned by IOThread. (5) IOThread gains a new struct: Globals. It can only be used on the io thread. (6) ChromeURLRequestContextFactory uses IOThread::Globals to initialize ChromeURLRequest objects with the host resolver and network change notifier. BUG=26159 Review URL: http://codereview.chromium.org/552117 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38052 0039d316-1c4b-4281-b951-d872f2087c98
* Switch on socket late binding - Take 2.willchan@chromium.org2010-01-271-1/+0
| | | | | | | | | | | | | | | Re-enable socket late binding. The mac valgrind errors happened due to threading bugs in test_shell_tests. The ui thread would TearDown() the test object, which deleted the TestURLRequestContext, which eventually deletes the TCPClientSocketPool, which deletes its ConnectJobs. However, those ConnectJobs might be running simultaneously on the io thread. Therefore, we have a race condition. This change fixes that. Histograms for the 4.0.266.0 dev channel release indicate the following changes for late binding: (a) Net.TCPSocketType shows a decrease (from 41.85% to 39.29%) in used of newly connected sockets. Part of this decrease is due to using previously used sockets more often (increase from 58.15% to 58.53%), but is primarily due to being able to use sockets that were connected, but not immediately handed over to a socket request (increased from 0 [not supported without late binding] to 2.18%). (b) Net.SocketIdleTimeBeforeNextUse_ReusedSocket indicates that reused sockets are getting used more quickly than before, with a decrease of mean idle time from 11.65 seconds to 11.34 seconds. (c) Net.Transaction_Connected_Under_10 indicates shows that the mean for time until the first byte of the transaction response decreased from 1585ms to 1481ms. The code change deletes the old non socket late binding code paths, cleaning up the code significantly. It also deletes duplicated tests in ClientSocketPoolBase which covered both pathways. A TCPClientSocketPool test had to be updated as well. BUG=http://crbug.com/30354. Review URL: http://codereview.chromium.org/549093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37311 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 36230 - Switch on socket late binding.willchan@chromium.org2010-01-141-0/+1
| | | | | | | | | | | | | | | | | Broke mac valgrind for test_shell_tests. Various errors. I also missed fixing a bug that eroman pointed out in review. Total brainfart. Histograms for the 4.0.266.0 dev channel release indicate the following changes for late binding: (a) Net.TCPSocketType shows a decrease (from 41.85% to 39.29%) in used of newly connected sockets. Part of this decrease is due to using previously used sockets more often (increase from 58.15% to 58.53%), but is primarily due to being able to use sockets that were connected, but not immediately handed over to a socket request (increased from 0 [not supported without late binding] to 2.18%). (b) Net.SocketIdleTimeBeforeNextUse_ReusedSocket indicates that reused sockets are getting used more quickly than before, with a decrease of mean idle time from 11.65 seconds to 11.34 seconds. (c) Net.Transaction_Connected_Under_10 indicates shows that the mean for time until the first byte of the transaction response decreased from 1585ms to 1481ms. The code change deletes the old non socket late binding code paths, cleaning up the code significantly. It also deletes duplicated tests in ClientSocketPoolBase which covered both pathways. A TCPClientSocketPool test had to be updated as well. BUG=http://crbug.com/30354. Review URL: http://codereview.chromium.org/543051 TBR=willchan@chromium.org Review URL: http://codereview.chromium.org/549047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36231 0039d316-1c4b-4281-b951-d872f2087c98
* Switch on socket late binding.willchan@chromium.org2010-01-141-1/+0
| | | | | | | | | | | | | Histograms for the 4.0.266.0 dev channel release indicate the following changes for late binding: (a) Net.TCPSocketType shows a decrease (from 41.85% to 39.29%) in used of newly connected sockets. Part of this decrease is due to using previously used sockets more often (increase from 58.15% to 58.53%), but is primarily due to being able to use sockets that were connected, but not immediately handed over to a socket request (increased from 0 [not supported without late binding] to 2.18%). (b) Net.SocketIdleTimeBeforeNextUse_ReusedSocket indicates that reused sockets are getting used more quickly than before, with a decrease of mean idle time from 11.65 seconds to 11.34 seconds. (c) Net.Transaction_Connected_Under_10 indicates shows that the mean for time until the first byte of the transaction response decreased from 1585ms to 1481ms. The code change deletes the old non socket late binding code paths, cleaning up the code significantly. It also deletes duplicated tests in ClientSocketPoolBase which covered both pathways. A TCPClientSocketPool test had to be updated as well. BUG=http://crbug.com/30354. Review URL: http://codereview.chromium.org/543051 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36230 0039d316-1c4b-4281-b951-d872f2087c98
* Fixup some connection time measurements.mbelshe@google.com2009-12-281-1/+4
| | | | | | | | | | | | | | | | - Net.TCP_Connection_Latency Time to connect only - Net.DNS_Resolution_And_TCP_Connection_Latency2 Time to do DNS and Connect - Net.HttpConnectionLatency Time for HTTP to connect (includes all delays, DNS, Queue, TCP, etc) BUG=none TEST=none Review URL: http://codereview.chromium.org/517014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35316 0039d316-1c4b-4281-b951-d872f2087c98
* Detects network changes. Only for Mac OS X so far. Hooks up ↵willchan@chromium.org2009-12-211-4/+6
| | | | | | | | | | | TCPClientSocketPool to flush idle sockets on IP address change. BUG=http://crbug.com/26156 TEST=Run chrome with both network cable and wireless on. Go to www.google.com, twice. Verify second time via chrome://net-internals that the second request did not need a TCP_CONNECT_JOB, since we reused idle sockets. Unplug network cable. This should flush idle sockets. Go back to www.google.com. Check chrome://net-internals. Verify that there is a TCP_CONNECT_JOB for that request, because there was no idle socket to reuse. Review URL: http://codereview.chromium.org/460149 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35107 0039d316-1c4b-4281-b951-d872f2087c98
* Update network priorities to support better granularitymbelshe@google.com2009-12-021-1/+1
| | | | | | | | | | | | | | 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 GetLoadState virtual in ConnectJob().willchan@chromium.org2009-09-011-0/+1
| | | | | | | | | This will be necessary for SSLClientSocketPool since the SSLConnectJob will contain a ClientSocketHandle for the TCPClientSocketPool. SSLConnectJob::GetLoadState() will forward to ClientSocketHandle::GetLoadState() if the SSLConnectJob is waiting on requesting a TCP socket. BUG=http://crbug.com/13289. Review URL: http://codereview.chromium.org/176024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25032 0039d316-1c4b-4281-b951-d872f2087c98
* Add instrumentation to ClientSocketPool, that writes to LoadLog.eroman@chromium.org2009-08-201-2/+4
| | | | | | | | BUG=http://crbug.com/14478 Review URL: http://codereview.chromium.org/174101 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23855 0039d316-1c4b-4281-b951-d872f2087c98
* Make ClientSocketHandle::Init() typesafe.willchan@chromium.org2009-08-191-2/+6
| | | | | | | | | | | 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-11/+8
| | | | | | | | | | | | | | | 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/+2
| | | | | | | | 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
* Add timeouts for ConnectJobs. Limit ConnectJobs per group to number of ↵willchan@chromium.org2009-08-031-5/+8
| | | | | | | | | | Requests per group + 1. In the histograms for Net.SocketRequestTime, late binding has a much longer tail. This is presumably because I didn't implement timeouts and CancelRequest() never cancelled jobs. I'm limiting TCPConnectJobs to 60 seconds and cancelling jobs if there are too many more than there are requests. Review URL: http://codereview.chromium.org/160499 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22338 0039d316-1c4b-4281-b951-d872f2087c98
* Add timeouts for ConnectJobs. Limit ConnectJobs per group to number of ↵willchan@chromium.org2009-08-031-8/+5
| | | | | | | | | | Requests per group + 1. In the histograms for Net.SocketRequestTime, late binding has a much longer tail. This is presumably because I didn't implement timeouts and CancelRequest() never cancelled jobs. I'm limiting TCPConnectJobs to 30 seconds and cancelling jobs if there are too many more than there are requests. Review URL: http://codereview.chromium.org/160499 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22330 0039d316-1c4b-4281-b951-d872f2087c98
* Add timeouts for ConnectJobs. Limit ConnectJobs per group to number of ↵willchan@chromium.org2009-08-031-5/+8
| | | | | | | | | | Requests per group + 1. In the histograms for Net.SocketRequestTime, late binding has a much longer tail. This is presumably because I didn't implement timeouts and CancelRequest() never cancelled jobs. I'm limiting TCPConnectJobs to 30 seconds and cancelling jobs if there are too many more than there are requests. Review URL: http://codereview.chromium.org/160499 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22326 0039d316-1c4b-4281-b951-d872f2087c98
* Limit total number of sockets in the system.phajdan.jr@chromium.org2009-07-221-1/+2
| | | | | | | | | | Based on Eric Roman's patch at http://codereview.chromium.org/62181 http://crbug.com/15093 Review URL: http://codereview.chromium.org/149027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21276 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor ConnectJob and TCPConnectJob.willchan@chromium.org2009-07-011-12/+16
| | | | | | | | | | | ConnectJob will only call OnConnectJobComplete() on asynchronous completion. TCPConnectJob now uses DoLoop() internally. BUG=http://crbug.com/13289 TEST=none Review URL: http://codereview.chromium.org/151118 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19789 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor ClientSocketPoolBase to be testable without host resolution / tcp ↵willchan@chromium.org2009-06-301-10/+10
| | | | | | | | | | | 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