diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-04 01:03:10 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-04 01:03:10 +0000 |
commit | d1eda9325775891900b0ed740b2faffbe522fc20 (patch) | |
tree | e34789a2b48016864d86674b22f84cf7da33fd61 /net/flip/flip_session.cc | |
parent | ebca346eb646c5b714f4efb4f383cb538780f1ae (diff) | |
download | chromium_src-d1eda9325775891900b0ed740b2faffbe522fc20.zip chromium_src-d1eda9325775891900b0ed740b2faffbe522fc20.tar.gz chromium_src-d1eda9325775891900b0ed740b2faffbe522fc20.tar.bz2 |
Flip: FlipSessionPool changes.
(1) Move it into the HttpNetworkSession so that HttpNetworkTransaction can access it.
This is in anticipation of switching HTTP/HTTPS connections over to FLIP.
(2) Add some more functionality to FlipSessionPool, allowing HttpNetworkTransactions to check for
the existence of other, reusable FlipSessions.
Review URL: http://codereview.chromium.org/348066
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30909 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/flip/flip_session.cc')
-rw-r--r-- | net/flip/flip_session.cc | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/net/flip/flip_session.cc b/net/flip/flip_session.cc index cb0da56..f2ff88a 100644 --- a/net/flip/flip_session.cc +++ b/net/flip/flip_session.cc @@ -26,17 +26,8 @@ namespace net { // static -scoped_ptr<FlipSessionPool> FlipSession::session_pool_; bool FlipSession::use_ssl_ = true; -FlipSession* FlipSession::GetFlipSession( - const HostResolver::RequestInfo& info, - HttpNetworkSession* session) { - if (!session_pool_.get()) - session_pool_.reset(new FlipSessionPool()); - return session_pool_->Get(info, session); -} - FlipSession::FlipSession(std::string host, HttpNetworkSession* session) : ALLOW_THIS_IN_INITIALIZER_LIST( connect_callback_(this, &FlipSession::OnTCPConnect)), @@ -70,8 +61,8 @@ FlipSession::~FlipSession() { // With Flip we can't recycle sockets. connection_.socket()->Disconnect(); } - if (session_pool_.get()) - session_pool_->Remove(this); + + session_->flip_session_pool()->Remove(this); } net::Error FlipSession::Connect(const std::string& group_name, @@ -239,7 +230,7 @@ bool FlipSession::CancelStream(int id) { return true; } -bool FlipSession::IsStreamActive(int id) { +bool FlipSession::IsStreamActive(int id) const { return active_streams_.find(id) != active_streams_.end(); } |