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

Side by Side Diff: net/http/http_stream_factory_impl.h

Issue 1952423002: JobController 2: Remove reference between HttpStreamFactoryImpl::Jobs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@Job_Controller_1
Patch Set: sync to JobController1, and move DoWaitForJob to JobController 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/http/http_stream_factory_impl_job.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ 5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_
6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 61
62 void PreconnectStreams(int num_streams, const HttpRequestInfo& info) override; 62 void PreconnectStreams(int num_streams, const HttpRequestInfo& info) override;
63 const HostMappingRules* GetHostMappingRules() const override; 63 const HostMappingRules* GetHostMappingRules() const override;
64 64
65 enum JobType { 65 enum JobType {
66 MAIN, 66 MAIN,
67 ALTERNATIVE, 67 ALTERNATIVE,
68 PRECONNECT, 68 PRECONNECT,
69 }; 69 };
70 70
71 enum State {
72 STATE_START,
73 STATE_RESOLVE_PROXY,
74 STATE_RESOLVE_PROXY_COMPLETE,
75
76 // Note that when Alternate-Protocol says we can connect to an alternate
77 // port using a different protocol, we have the choice of communicating over
78 // the original protocol, or speaking the alternate protocol (currently,
79 // only npn-spdy) over an alternate port. For a cold page load, the http
80 // connection that delivers the http response that has the
81 // Alternate-Protocol header will already be warm. So, blocking the next
82 // http request on establishing a new npn-spdy connection would incur extra
83 // latency. Even if the http connection was not reused, establishing a new
84 // http connection is typically faster than npn-spdy, since npn-spdy
85 // requires a SSL handshake. Therefore, we start both the http and the
86 // npn-spdy jobs in parallel. In order not to unnecessarily waste sockets,
87 // we have the http job block on the npn-spdy job after proxy resolution.
88 // The npn-spdy job will Resume() the http job if, in
89 // STATE_INIT_CONNECTION_COMPLETE, it detects an error or does not find an
90 // existing SpdySession. In that case, the http and npn-spdy jobs will race.
91 // When QUIC protocol is used by the npn-spdy job, then http job will wait
92 // for |wait_time_| when the http job was resumed.
93 STATE_WAIT_FOR_JOB,
94 STATE_WAIT_FOR_JOB_COMPLETE,
95
96 STATE_INIT_CONNECTION,
97 STATE_INIT_CONNECTION_COMPLETE,
98 STATE_WAITING_USER_ACTION,
99 STATE_RESTART_TUNNEL_AUTH,
100 STATE_RESTART_TUNNEL_AUTH_COMPLETE,
101 STATE_CREATE_STREAM,
102 STATE_CREATE_STREAM_COMPLETE,
103 STATE_DRAIN_BODY_FOR_AUTH_RESTART,
104 STATE_DRAIN_BODY_FOR_AUTH_RESTART_COMPLETE,
105 STATE_DONE,
106 STATE_NONE
107 };
108
71 private: 109 private:
72 FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryImplRequestTest, SetPriority); 110 FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryImplRequestTest, SetPriority);
73 FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryImplRequestTest, DelayMainJob); 111 FRIEND_TEST_ALL_PREFIXES(HttpStreamFactoryImplRequestTest, DelayMainJob);
74 112
75 class NET_EXPORT_PRIVATE Request; 113 class NET_EXPORT_PRIVATE Request;
76 class NET_EXPORT_PRIVATE Job; 114 class NET_EXPORT_PRIVATE Job;
77 class NET_EXPORT_PRIVATE JobController; 115 class NET_EXPORT_PRIVATE JobController;
78 116
79 typedef std::set<Request*> RequestSet; 117 typedef std::set<Request*> RequestSet;
80 typedef std::map<SpdySessionKey, RequestSet> SpdySessionRequestMap; 118 typedef std::map<SpdySessionKey, RequestSet> SpdySessionRequestMap;
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 163
126 SpdySessionRequestMap spdy_session_request_map_; 164 SpdySessionRequestMap spdy_session_request_map_;
127 165
128 const bool for_websockets_; 166 const bool for_websockets_;
129 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactoryImpl); 167 DISALLOW_COPY_AND_ASSIGN(HttpStreamFactoryImpl);
130 }; 168 };
131 169
132 } // namespace net 170 } // namespace net
133 171
134 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_ 172 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | net/http/http_stream_factory_impl_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698