summaryrefslogtreecommitdiffstats
path: root/net/spdy/spdy_session_unittest.cc
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-22 23:57:45 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-22 23:57:45 +0000
commit95fb385e5e68a69a39c77d66d801bebdaf39c311 (patch)
tree2090dc35a76c8cb85b1ef20c200254884f6d6d3a /net/spdy/spdy_session_unittest.cc
parent711726473047dc051e3bddc04657f3f6ce42569f (diff)
downloadchromium_src-95fb385e5e68a69a39c77d66d801bebdaf39c311.zip
chromium_src-95fb385e5e68a69a39c77d66d801bebdaf39c311.tar.gz
chromium_src-95fb385e5e68a69a39c77d66d801bebdaf39c311.tar.bz2
Refactor HttpStreamFactory.
Rename StreamFactory and StreamRequest to HttpStreamFactory and HttpStreamRequest. Rename HttpStreamFactory to HttpStreamFactoryImpl. Create HttpStreamFactoryImpl::Request (inherits from HttpStreamRequest) and HttpStreamFactoryImpl::Job (most of the old HttpStreamRequest code, other than the interface, moved here). Currently there is still a strong binding within HttpStreamFactoryImpl between requests and jobs. This will be removed in a future changelist. Note that due to the preparation for late binding, information like HttpRequestInfo and SSLConfig and ProxyInfo are just copied. It's possible we can consider refcounting them to reduce copies, but I think it's not worth the effort / ugliness. I also did some minor cleanups like moving SpdySettingsStorage into SpdySessionPool and some CloseIdleConnections() cleanup. BUG=54371,42669 TEST=unit tests Review URL: http://codereview.chromium.org/6543004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75668 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_session_unittest.cc')
-rw-r--r--net/spdy/spdy_session_unittest.cc27
1 files changed, 12 insertions, 15 deletions
diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc
index 44848e3..0f3b601 100644
--- a/net/spdy/spdy_session_unittest.cc
+++ b/net/spdy/spdy_session_unittest.cc
@@ -88,8 +88,7 @@ TEST_F(SpdySessionTest, GoAway) {
SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool());
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
scoped_refptr<SpdySession> session =
- spdy_session_pool->Get(pair, http_session->mutable_spdy_settings(),
- BoundNetLog());
+ spdy_session_pool->Get(pair, BoundNetLog());
EXPECT_TRUE(spdy_session_pool->HasSession(pair));
scoped_refptr<TCPSocketParams> tcp_params(
@@ -107,8 +106,7 @@ TEST_F(SpdySessionTest, GoAway) {
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
scoped_refptr<SpdySession> session2 =
- spdy_session_pool->Get(pair, http_session->mutable_spdy_settings(),
- BoundNetLog());
+ spdy_session_pool->Get(pair, BoundNetLog());
// Delete the first session.
session = NULL;
@@ -187,18 +185,17 @@ TEST_F(SpdySessionTest, OnSettings) {
HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct());
// Initialize the SpdySettingsStorage with 1 max concurrent streams.
+ SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool());
spdy::SpdySettings old_settings;
id.set_flags(spdy::SETTINGS_FLAG_PLEASE_PERSIST);
old_settings.push_back(spdy::SpdySetting(id, 1));
- http_session->mutable_spdy_settings()->Set(
+ spdy_session_pool->mutable_spdy_settings()->Set(
test_host_port_pair, old_settings);
// Create a session.
- SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool());
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
scoped_refptr<SpdySession> session =
- spdy_session_pool->Get(pair, http_session->mutable_spdy_settings(),
- BoundNetLog());
+ spdy_session_pool->Get(pair, BoundNetLog());
ASSERT_TRUE(spdy_session_pool->HasSession(pair));
scoped_refptr<TCPSocketParams> tcp_params(
@@ -267,19 +264,19 @@ TEST_F(SpdySessionTest, CancelPendingCreateStream) {
HostPortProxyPair pair(test_host_port_pair, ProxyServer::Direct());
// Initialize the SpdySettingsStorage with 1 max concurrent streams.
+ SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool());
spdy::SpdySettings settings;
spdy::SettingsFlagsAndId id(spdy::SETTINGS_MAX_CONCURRENT_STREAMS);
id.set_id(spdy::SETTINGS_MAX_CONCURRENT_STREAMS);
id.set_flags(spdy::SETTINGS_FLAG_PLEASE_PERSIST);
settings.push_back(spdy::SpdySetting(id, 1));
- http_session->mutable_spdy_settings()->Set(test_host_port_pair, settings);
+ spdy_session_pool->mutable_spdy_settings()->Set(
+ test_host_port_pair, settings);
// Create a session.
- SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool());
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
scoped_refptr<SpdySession> session =
- spdy_session_pool->Get(pair, http_session->mutable_spdy_settings(),
- BoundNetLog());
+ spdy_session_pool->Get(pair, BoundNetLog());
ASSERT_TRUE(spdy_session_pool->HasSession(pair));
scoped_refptr<TCPSocketParams> tcp_params(
@@ -369,12 +366,12 @@ TEST_F(SpdySessionTest, SendSettingsOnNewSession) {
id.set_flags(spdy::SETTINGS_FLAG_PLEASE_PERSIST);
settings.clear();
settings.push_back(spdy::SpdySetting(id, kBogusSettingValue));
- http_session->mutable_spdy_settings()->Set(test_host_port_pair, settings);
SpdySessionPool* spdy_session_pool(http_session->spdy_session_pool());
+ spdy_session_pool->mutable_spdy_settings()->Set(
+ test_host_port_pair, settings);
EXPECT_FALSE(spdy_session_pool->HasSession(pair));
scoped_refptr<SpdySession> session =
- spdy_session_pool->Get(pair, http_session->mutable_spdy_settings(),
- BoundNetLog());
+ spdy_session_pool->Get(pair, BoundNetLog());
EXPECT_TRUE(spdy_session_pool->HasSession(pair));
scoped_refptr<TCPSocketParams> tcp_params(