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

Unified Diff: net/spdy/spdy_test_util_common.cc

Issue 2756503002: Allow SpdySessionPool to find/create SpdySession with IP pooling disabled. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « net/spdy/spdy_test_util_common.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_test_util_common.cc
diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc
index 1b2ef2474328e89e3a9c7ecbe0f49f6a7697753f..53a3bfe6aab1c1ecf072ae0cdc445e839e19b169 100644
--- a/net/spdy/spdy_test_util_common.cc
+++ b/net/spdy/spdy_test_util_common.cc
@@ -25,6 +25,7 @@
#include "net/http/http_network_transaction.h"
#include "net/http/http_server_properties_impl.h"
#include "net/log/net_log_with_source.h"
+#include "net/socket/client_socket_handle.h"
#include "net/socket/next_proto.h"
#include "net/socket/socket_test_util.h"
#include "net/socket/ssl_client_socket.h"
@@ -484,8 +485,9 @@ SpdyURLRequestContext::~SpdyURLRequestContext() {
}
bool HasSpdySession(SpdySessionPool* pool, const SpdySessionKey& key) {
- return static_cast<bool>(
- pool->FindAvailableSession(key, GURL(), NetLogWithSource()));
+ return static_cast<bool>(pool->FindAvailableSession(
+ key, GURL(),
+ /* enable_ip_based_pooling = */ true, NetLogWithSource()));
}
namespace {
@@ -495,8 +497,10 @@ base::WeakPtr<SpdySession> CreateSpdySessionHelper(
const SpdySessionKey& key,
const NetLogWithSource& net_log,
Error expected_status,
- bool is_secure) {
- EXPECT_FALSE(HasSpdySession(http_session->spdy_session_pool(), key));
+ bool is_secure,
+ bool enable_ip_based_pooling) {
+ EXPECT_FALSE(http_session->spdy_session_pool()->FindAvailableSession(
+ key, GURL(), enable_ip_based_pooling, NetLogWithSource()));
scoped_refptr<TransportSocketParams> transport_params(
new TransportSocketParams(
@@ -552,8 +556,9 @@ base::WeakPtr<SpdySession> CreateInsecureSpdySession(
HttpNetworkSession* http_session,
const SpdySessionKey& key,
const NetLogWithSource& net_log) {
- return CreateSpdySessionHelper(http_session, key, net_log,
- OK, false /* is_secure */);
+ return CreateSpdySessionHelper(http_session, key, net_log, OK,
+ /* is_secure = */ false,
+ /* enable_ip_based_pooling = */ true);
}
base::WeakPtr<SpdySession> TryCreateSpdySessionExpectingFailure(
@@ -563,15 +568,26 @@ base::WeakPtr<SpdySession> TryCreateSpdySessionExpectingFailure(
const NetLogWithSource& net_log) {
DCHECK_LT(expected_error, ERR_IO_PENDING);
return CreateSpdySessionHelper(http_session, key, net_log, expected_error,
- true /* is_secure */);
+ /* is_secure = */ true,
+ /* enable_ip_based_pooling = */ true);
}
base::WeakPtr<SpdySession> CreateSecureSpdySession(
HttpNetworkSession* http_session,
const SpdySessionKey& key,
const NetLogWithSource& net_log) {
- return CreateSpdySessionHelper(http_session, key, net_log,
- OK, true /* is_secure */);
+ return CreateSpdySessionHelper(http_session, key, net_log, OK,
+ /* is_secure = */ true,
+ /* enable_ip_based_pooling = */ true);
+}
+
+base::WeakPtr<SpdySession> CreateSecureSpdySessionWithIpBasedPoolingDisabled(
+ HttpNetworkSession* http_session,
+ const SpdySessionKey& key,
+ const NetLogWithSource& net_log) {
+ return CreateSpdySessionHelper(http_session, key, net_log, OK,
+ /* is_secure = */ true,
+ /* enable_ip_based_pooling = */ false);
}
namespace {
« no previous file with comments | « net/spdy/spdy_test_util_common.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698