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

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

Issue 2622193003: Clean up HttpStreamFactoryImpl::JobController when Impl::Jobs complete (Closed)
Patch Set: one more merge conflict Created 3 years, 11 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 | « net/http/http_basic_stream.cc ('k') | net/http/http_stream_factory_impl_job_controller.cc » ('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) 2016 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2016 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_JOB_CONTROLLER_H_ 5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_CONTROLLER_H_
6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_CONTROLLER_H_ 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_CONTROLLER_H_
7 7
8 #include "net/base/host_port_pair.h" 8 #include "net/base/host_port_pair.h"
9 #include "net/http/http_stream_factory_impl_job.h" 9 #include "net/http/http_stream_factory_impl_job.h"
10 #include "net/http/http_stream_factory_impl_request.h" 10 #include "net/http/http_stream_factory_impl_request.h"
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 205
206 // Must be called when |alternative_job_| fails. 206 // Must be called when |alternative_job_| fails.
207 void OnAlternativeJobFailed(Job* job); 207 void OnAlternativeJobFailed(Job* job);
208 208
209 // Called to report to http_server_properties to mark alternative service 209 // Called to report to http_server_properties to mark alternative service
210 // broken. 210 // broken.
211 void ReportBrokenAlternativeService(); 211 void ReportBrokenAlternativeService();
212 212
213 void MaybeNotifyFactoryOfCompletion(); 213 void MaybeNotifyFactoryOfCompletion();
214 214
215 // Called to resume the main job with delay. 215 // Called to resume the main job with delay. Main job is resumed only when
216 // |alternative_job_| has failed or |main_job_wait_time_| elapsed.
216 void MaybeResumeMainJob(Job* job, const base::TimeDelta& delay); 217 void MaybeResumeMainJob(Job* job, const base::TimeDelta& delay);
217 218
218 void ResumeMainJob(); 219 void ResumeMainJob();
219 220
220 // Returns true if QUIC is whitelisted for |host|. 221 // Returns true if QUIC is whitelisted for |host|.
221 bool IsQuicWhitelistedForHost(const std::string& host); 222 bool IsQuicWhitelistedForHost(const std::string& host);
222 223
223 AlternativeService GetAlternativeServiceFor( 224 AlternativeService GetAlternativeServiceFor(
224 const HttpRequestInfo& request_info, 225 const HttpRequestInfo& request_info,
225 HttpStreamRequest::Delegate* delegate, 226 HttpStreamRequest::Delegate* delegate,
(...skipping 17 matching lines...) Expand all
243 const GURL& url, 244 const GURL& url,
244 ProxyServer* alternative_proxy_server) const; 245 ProxyServer* alternative_proxy_server) const;
245 246
246 // Records histogram metrics for the usage of alternative protocol. Must be 247 // Records histogram metrics for the usage of alternative protocol. Must be
247 // called when |job| has succeeded and the other job will be orphaned. 248 // called when |job| has succeeded and the other job will be orphaned.
248 void ReportAlternateProtocolUsage(Job* job) const; 249 void ReportAlternateProtocolUsage(Job* job) const;
249 250
250 // Starts the |alternative_job_|. 251 // Starts the |alternative_job_|.
251 void StartAlternativeProxyServerJob(); 252 void StartAlternativeProxyServerJob();
252 253
254 // Returns whether |job| is an orphaned job.
255 bool IsJobOrphaned(Job* job) const;
256
253 HttpStreamFactoryImpl* factory_; 257 HttpStreamFactoryImpl* factory_;
254 HttpNetworkSession* session_; 258 HttpNetworkSession* session_;
255 JobFactory* job_factory_; 259 JobFactory* job_factory_;
256 260
257 // Request will be handed out to factory once created. This just keeps an 261 // Request will be handed out to factory once created. This just keeps an
258 // reference and is safe as |request_| will notify |this| JobController 262 // reference and is safe as |request_| will notify |this| JobController
259 // when it's destructed by calling OnRequestComplete(), which nulls 263 // when it's destructed by calling OnRequestComplete(), which nulls
260 // |request_|. 264 // |request_|.
261 Request* request_; 265 Request* request_;
262 266
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 299
296 // True if an alternative proxy server job can be started to fetch |request_|. 300 // True if an alternative proxy server job can be started to fetch |request_|.
297 bool can_start_alternative_proxy_job_; 301 bool can_start_alternative_proxy_job_;
298 302
299 base::WeakPtrFactory<JobController> ptr_factory_; 303 base::WeakPtrFactory<JobController> ptr_factory_;
300 }; 304 };
301 305
302 } // namespace net 306 } // namespace net
303 307
304 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_CONTROLLER_H_ 308 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_CONTROLLER_H_
OLDNEW
« no previous file with comments | « net/http/http_basic_stream.cc ('k') | net/http/http_stream_factory_impl_job_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698