diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-23 01:01:31 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-23 01:01:31 +0000 |
commit | 102e27c64d9deae4c32f346214fd7c2bddaa9fb3 (patch) | |
tree | d7372b853f79764c4ec200f4cd6d26c9bb512d65 /net/spdy/spdy_network_transaction_unittest.cc | |
parent | d7f21d5584fb4962617644833fd2a80b6d0c7e8d (diff) | |
download | chromium_src-102e27c64d9deae4c32f346214fd7c2bddaa9fb3.zip chromium_src-102e27c64d9deae4c32f346214fd7c2bddaa9fb3.tar.gz chromium_src-102e27c64d9deae4c32f346214fd7c2bddaa9fb3.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
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=75668
Review URL: http://codereview.chromium.org/6543004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75688 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_network_transaction_unittest.cc')
-rw-r--r-- | net/spdy/spdy_network_transaction_unittest.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc index 402f2f7..019cc4c 100644 --- a/net/spdy/spdy_network_transaction_unittest.cc +++ b/net/spdy/spdy_network_transaction_unittest.cc @@ -393,8 +393,7 @@ class SpdyNetworkTransactionTest const scoped_refptr<HttpNetworkSession>& session = helper.session(); SpdySessionPool* pool(session->spdy_session_pool()); EXPECT_TRUE(pool->HasSession(pair)); - scoped_refptr<SpdySession> spdy_session( - pool->Get(pair, session->mutable_spdy_settings(), log)); + scoped_refptr<SpdySession> spdy_session(pool->Get(pair, log)); ASSERT_TRUE(spdy_session.get() != NULL); EXPECT_EQ(0u, spdy_session->num_active_streams()); EXPECT_EQ(0u, spdy_session->num_unclaimed_pushed_streams()); @@ -4016,7 +4015,8 @@ TEST_P(SpdyNetworkTransactionTest, SettingsSaved) { // Verify that no settings exist initially. HostPortPair host_port_pair("www.google.com", helper.port()); - EXPECT_TRUE(helper.session()->spdy_settings().Get(host_port_pair).empty()); + SpdySessionPool* spdy_session_pool = helper.session()->spdy_session_pool(); + EXPECT_TRUE(spdy_session_pool->spdy_settings().Get(host_port_pair).empty()); // Construct the request. scoped_ptr<spdy::SpdyFrame> req(ConstructSpdyGet(NULL, 0, false, 1, LOWEST)); @@ -4078,7 +4078,7 @@ TEST_P(SpdyNetworkTransactionTest, SettingsSaved) { { // Verify we had two persisted settings. spdy::SpdySettings saved_settings = - helper.session()->spdy_settings().Get(host_port_pair); + spdy_session_pool->spdy_settings().Get(host_port_pair); ASSERT_EQ(2u, saved_settings.size()); // Verify the first persisted setting. @@ -4124,7 +4124,8 @@ TEST_P(SpdyNetworkTransactionTest, SettingsPlayback) { // Verify that no settings exist initially. HostPortPair host_port_pair("www.google.com", helper.port()); - EXPECT_TRUE(helper.session()->spdy_settings().Get(host_port_pair).empty()); + SpdySessionPool* spdy_session_pool = helper.session()->spdy_session_pool(); + EXPECT_TRUE(spdy_session_pool->spdy_settings().Get(host_port_pair).empty()); unsigned int kSampleId1 = 0x1; unsigned int kSampleValue1 = 0x0a0a0a0a; @@ -4143,14 +4144,14 @@ TEST_P(SpdyNetworkTransactionTest, SettingsPlayback) { setting.set_id(kSampleId2); settings.push_back(std::make_pair(setting, kSampleValue2)); - helper.session()->mutable_spdy_settings()->Set(host_port_pair, settings); + spdy_session_pool->mutable_spdy_settings()->Set(host_port_pair, settings); } - EXPECT_EQ(2u, helper.session()->spdy_settings().Get(host_port_pair).size()); + EXPECT_EQ(2u, spdy_session_pool->spdy_settings().Get(host_port_pair).size()); // Construct the SETTINGS frame. const spdy::SpdySettings& settings = - helper.session()->spdy_settings().Get(host_port_pair); + spdy_session_pool->spdy_settings().Get(host_port_pair); scoped_ptr<spdy::SpdyFrame> settings_frame(ConstructSpdySettings(settings)); // Construct the request. @@ -4190,7 +4191,7 @@ TEST_P(SpdyNetworkTransactionTest, SettingsPlayback) { { // Verify we had two persisted settings. spdy::SpdySettings saved_settings = - helper.session()->spdy_settings().Get(host_port_pair); + spdy_session_pool->spdy_settings().Get(host_port_pair); ASSERT_EQ(2u, saved_settings.size()); // Verify the first persisted setting. |