diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-29 20:59:40 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-29 20:59:40 +0000 |
commit | 023cee77677908dda1466d6c88e9dc1c7dddc705 (patch) | |
tree | 32ea70311d6330a39c22f99dce8cb35629e0a860 /net/spdy/spdy_session.h | |
parent | 0e6b51dd99f0333a7ab0e2fabe511d771a3d3e1f (diff) | |
download | chromium_src-023cee77677908dda1466d6c88e9dc1c7dddc705.zip chromium_src-023cee77677908dda1466d6c88e9dc1c7dddc705.tar.gz chromium_src-023cee77677908dda1466d6c88e9dc1c7dddc705.tar.bz2 |
Use ScopedRunnableMethodFactory for SpdySession to better control lifetime.
I'm trying to make sure all IO objects clean up appropriately when HttpNetworkSession goes away. SpdySession can cause problems since it pointlessly keeps itself alive for another MessageLoop loop even though all references may have gone away. This fixes that.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3547003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60988 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_session.h')
-rw-r--r-- | net/spdy/spdy_session.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/spdy/spdy_session.h b/net/spdy/spdy_session.h index 2894471..313440c 100644 --- a/net/spdy/spdy_session.h +++ b/net/spdy/spdy_session.h @@ -15,6 +15,7 @@ #include "base/gtest_prod_util.h" #include "base/linked_ptr.h" #include "base/ref_counted.h" +#include "base/task.h" #include "net/base/io_buffer.h" #include "net/base/load_states.h" #include "net/base/net_errors.h" @@ -284,6 +285,12 @@ class SpdySession : public base::RefCounted<SpdySession>, CompletionCallbackImpl<SpdySession> read_callback_; CompletionCallbackImpl<SpdySession> write_callback_; + // Used for posting asynchronous IO tasks. We use this even though + // SpdySession is refcounted because we don't need to keep the SpdySession + // alive if the last reference is within a RunnableMethod. Just revoke the + // method. + ScopedRunnableMethodFactory<SpdySession> method_factory_; + // The domain this session is connected to. const HostPortProxyPair host_port_proxy_pair_; |