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

Unified Diff: net/socket/client_socket_pool_manager.cc

Issue 6800009: Attn: Mike Belshe Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Created 9 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: net/socket/client_socket_pool_manager.cc
===================================================================
--- net/socket/client_socket_pool_manager.cc (revision 80449)
+++ net/socket/client_socket_pool_manager.cc (working copy)
@@ -21,6 +21,8 @@
#include "net/socket/client_socket_factory.h"
#include "net/socket/client_socket_handle.h"
#include "net/socket/client_socket_pool_histograms.h"
+#include "net/socket/sctp_client_socket_pool.h"
+#include "net/socket/sctp_support.h"
#include "net/socket/socks_client_socket_pool.h"
#include "net/socket/ssl_client_socket_pool.h"
#include "net/socket/tcp_client_socket_pool.h"
@@ -70,11 +72,16 @@
ClientSocketHandle* socket_handle,
CompletionCallback* callback) {
scoped_refptr<TCPSocketParams> tcp_params;
+ scoped_refptr<SCTPSocketParams> sctp_params;
scoped_refptr<HttpProxySocketParams> http_proxy_params;
scoped_refptr<SOCKSSocketParams> socks_params;
scoped_ptr<HostPortPair> proxy_host_port;
bool using_ssl = request_info.url.SchemeIs("https") || force_spdy_over_ssl;
+ if (using_ssl && sctp_enabled()) {
+ printf("InitSocketPoolHelper: forcing using_ssl = false\n");
Mike Belshe 2011/04/06 18:32:53 nix this
+ using_ssl = false;
+ }
HostPortPair origin_host_port =
HostPortPair(request_info.url.HostNoBrackets(),
@@ -98,11 +105,19 @@
bool ignore_limits = (request_info.load_flags & LOAD_IGNORE_LIMITS) != 0;
if (proxy_info.is_direct()) {
- tcp_params = new TCPSocketParams(origin_host_port,
- request_info.priority,
- request_info.referrer,
- disable_resolver_cache,
- ignore_limits);
+ if (sctp_enabled()) {
+ sctp_params = new SCTPSocketParams(origin_host_port,
+ request_info.priority,
+ request_info.referrer,
+ disable_resolver_cache,
+ ignore_limits);
+ } else {
+ tcp_params = new TCPSocketParams(origin_host_port,
+ request_info.priority,
+ request_info.referrer,
+ disable_resolver_cache,
+ ignore_limits);
+ }
} else {
ProxyServer proxy_server = proxy_info.proxy_server();
proxy_host_port.reset(new HostPortPair(proxy_server.host_port_pair()));
@@ -220,16 +235,29 @@
DCHECK(proxy_info.is_direct());
- TCPClientSocketPool* pool = session->tcp_socket_pool();
- if (num_preconnect_streams) {
- RequestSocketsForPool(pool, connection_group, tcp_params,
- num_preconnect_streams, net_log);
- return OK;
+ if (sctp_enabled()) {
+ SCTPClientSocketPool* pool = session->sctp_socket_pool();
+ if (num_preconnect_streams) {
+ RequestSocketsForPool(pool, connection_group, sctp_params,
+ num_preconnect_streams, net_log);
+ return OK;
+ }
+
+ return socket_handle->Init(connection_group, sctp_params,
+ request_info.priority, callback,
+ pool, net_log);
+ } else {
+ TCPClientSocketPool* pool = session->tcp_socket_pool();
+ if (num_preconnect_streams) {
+ RequestSocketsForPool(pool, connection_group, tcp_params,
+ num_preconnect_streams, net_log);
+ return OK;
+ }
+
+ return socket_handle->Init(connection_group, tcp_params,
+ request_info.priority, callback,
+ pool, net_log);
}
-
- return socket_handle->Init(connection_group, tcp_params,
- request_info.priority, callback,
- pool, net_log);
}
} // namespace
@@ -260,6 +288,13 @@
host_resolver,
socket_factory_,
net_log)),
+ sctp_pool_histograms_("SCTP"),
+ sctp_socket_pool_(new SCTPClientSocketPool(
+ g_max_sockets, g_max_sockets_per_group,
+ &sctp_pool_histograms_,
+ host_resolver,
+ socket_factory_,
+ net_log)),
ssl_pool_histograms_("SSL2"),
ssl_socket_pool_(new SSLClientSocketPool(
g_max_sockets, g_max_sockets_per_group,
@@ -535,6 +570,8 @@
// The following is a sanity check... but we should NEVER be near this value.
DCHECK_GT(100, socket_count);
g_max_sockets_per_group = socket_count;
+ // TODO(jtl): Remove this - it's only used for testing SCTP.
+ g_max_sockets_per_group = 1;
Mike Belshe 2011/04/06 18:32:53 can this be if (sctp_enabled()) g_max_sock
DCHECK_GE(g_max_sockets, g_max_sockets_per_group);
DCHECK_GE(g_max_sockets_per_proxy_server, g_max_sockets_per_group);

Powered by Google App Engine
This is Rietveld 408576698