Add ClientSocketPoolBaseHelper support for preconnect.

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
diff --git a/net/socket/ssl_client_socket_pool.cc b/net/socket/ssl_client_socket_pool.cc
index ea0a177..22d921a 100644
--- a/net/socket/ssl_client_socket_pool.cc
+++ b/net/socket/ssl_client_socket_pool.cc
@@ -428,6 +428,17 @@
                              handle, callback, net_log);
 }
 
+void SSLClientSocketPool::RequestSockets(
+    const std::string& group_name,
+    const void* params,
+    int num_sockets,
+    const BoundNetLog& net_log) {
+  const scoped_refptr<SSLSocketParams>* casted_params =
+      static_cast<const scoped_refptr<SSLSocketParams>*>(params);
+
+  base_.RequestSockets(group_name, *casted_params, num_sockets, net_log);
+}
+
 void SSLClientSocketPool::CancelRequest(const std::string& group_name,
                                         ClientSocketHandle* handle) {
   base_.CancelRequest(group_name, handle);