Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Unified Diff: net/http/http_stream_factory_impl.h

Issue 1941083002: JobController 1: Adding a new class HttpStreamFactoryImpl::JobController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | net/http/http_stream_factory_impl.cc » ('j') | net/http/http_stream_factory_impl.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl.h
diff --git a/net/http/http_stream_factory_impl.h b/net/http/http_stream_factory_impl.h
index 4e20033bc20aa610ab8351eba8f00ad11867edb7..063d60385c134eb9426c38fa463b8089f3c3469b 100644
--- a/net/http/http_stream_factory_impl.h
+++ b/net/http/http_stream_factory_impl.h
@@ -62,17 +62,17 @@ class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : public HttpStreamFactory {
void PreconnectStreams(int num_streams, const HttpRequestInfo& info) override;
const HostMappingRules* GetHostMappingRules() const override;
- size_t num_orphaned_jobs() const { return orphaned_job_set_.size(); }
-
private:
FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryImplRequestTest, SetPriority);
FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryImplRequestTest, DelayMainJob);
class NET_EXPORT_PRIVATE Request;
class NET_EXPORT_PRIVATE Job;
+ class NET_EXPORT_PRIVATE JobController;
typedef std::set<Request*> RequestSet;
typedef std::map<SpdySessionKey, RequestSet> SpdySessionRequestMap;
+ typedef std::set<JobController*> JobControllerSet;
Ryan Hamilton 2016/05/06 20:49:01 Since the controllers are owned by the factory, th
Zhongyi Shi 2016/05/12 07:26:23 Done.
HttpStreamRequest* RequestStreamInternal(
const HttpRequestInfo& info,
@@ -89,9 +89,6 @@ class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : public HttpStreamFactory {
HttpStreamRequest::Delegate* delegate,
HttpStreamRequest::StreamType stream_type);
- // 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.
@@ -109,15 +106,13 @@ class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : public HttpStreamFactory {
// 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);
-
// Called when the Preconnect completes. Used for testing.
virtual void OnPreconnectsCompleteInternal() {}
+ // Called when the JobController finishes service. Delete the JobController
+ // from |job_controller_set_|.
+ void OnJobControllerComplete(JobController* controller);
+
// Returns true if QUIC is whitelisted for |host|.
bool IsQuicWhitelistedForHost(const std::string& host);
@@ -128,19 +123,9 @@ class NET_EXPORT_PRIVATE HttpStreamFactoryImpl : public HttpStreamFactory {
// |request_map_|. The Requests will delete the corresponding job.
std::map<const Job*, Request*> request_map_;
- SpdySessionRequestMap spdy_session_request_map_;
+ JobControllerSet job_controller_set_;
- // 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.
- std::set<const Job*> preconnect_job_set_;
+ SpdySessionRequestMap spdy_session_request_map_;
const bool for_websockets_;
DISALLOW_COPY_AND_ASSIGN(HttpStreamFactoryImpl);
« no previous file with comments | « no previous file | net/http/http_stream_factory_impl.cc » ('j') | net/http/http_stream_factory_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698