diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-01 17:50:17 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-01 17:50:17 +0000 |
commit | 1b323178a6277a5042c8202300d4248f7a5a8194 (patch) | |
tree | 606665f0dc3b23c8df993bba7f5cbe3e96640721 /net/http/http_stream_factory_impl.h | |
parent | 3b996df58cba3da832f2c2765b8abb623f8aea9b (diff) | |
download | chromium_src-1b323178a6277a5042c8202300d4248f7a5a8194.zip chromium_src-1b323178a6277a5042c8202300d4248f7a5a8194.tar.gz chromium_src-1b323178a6277a5042c8202300d4248f7a5a8194.tar.bz2 |
Add HttpStreamFactory Job orphaning semantics.
BUG=54371,69688
TEST=none
Review URL: http://codereview.chromium.org/6591030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76389 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_stream_factory_impl.h')
-rw-r--r-- | net/http/http_stream_factory_impl.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/net/http/http_stream_factory_impl.h b/net/http/http_stream_factory_impl.h index 9d6e133..4bdbfca 100644 --- a/net/http/http_stream_factory_impl.h +++ b/net/http/http_stream_factory_impl.h @@ -11,6 +11,7 @@ #include "base/ref_counted.h" #include "net/http/http_stream_factory.h" +#include "net/base/net_log.h" #include "net/proxy/proxy_server.h" namespace net { @@ -44,20 +45,29 @@ class HttpStreamFactoryImpl : public HttpStreamFactory { typedef std::set<Request*> RequestSet; typedef std::map<HostPortProxyPair, RequestSet> SpdySessionRequestMap; - LoadState GetLoadState(const Request& request) const; + // Detaches |job| from |request|. + void OrphanJob(Job* job, const Request* request); // Called when a SpdySession is ready. It will find appropriate Requests and // fulfill them. |direct| indicates whether or not |spdy_session| uses a // proxy. - void OnSpdySessionReady(const Job* job, - scoped_refptr<SpdySession> spdy_session, - bool direct); + void OnSpdySessionReady(scoped_refptr<SpdySession> spdy_session, + bool direct, + const SSLConfig& used_ssl_config, + const ProxyInfo& used_proxy_info, + bool was_alternate_protocol_available, + bool was_npn_negotiated, + bool using_spdy, + const NetLog::Source& source); // Called when the Job detects that the endpoint indicated by the // Alternate-Protocol does not work. Lets the factory update // HttpAlternateProtocols with the failure and resets the SPDY session key. void OnBrokenAlternateProtocol(const Job*, const HostPortPair& origin); + // Invoked when an orphaned Job finishes. + void OnOrphanedJobComplete(const Job* job); + // Invoked when the Job finishes preconnecting sockets. void OnPreconnectsComplete(const Job* job); @@ -75,6 +85,13 @@ class HttpStreamFactoryImpl : public HttpStreamFactory { SpdySessionRequestMap spdy_session_request_map_; + // These jobs correspond to jobs orphaned by Requests and now owned by + // HttpStreamFactoryImpl. Since they are no longer tied to Requests, they will + // not be canceled when Requests are canceled. Therefore, in + // ~HttpStreamFactoryImpl, it is possible for some jobs to still exist in this + // set. Leftover jobs will be deleted when the factory is destroyed. + std::set<const Job*> orphaned_job_set_; + // These jobs correspond to preconnect requests and have no associated Request // object. They're owned by HttpStreamFactoryImpl. Leftover jobs will be // deleted when the factory is destroyed. |