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

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

Issue 2935293002: HttpStreamFactoryImpl::Job cleanup. (Closed)
Patch Set: Re: #7. Created 3 years, 6 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
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 <memory> 8 #include <memory>
9 9
10 #include "net/base/host_port_pair.h" 10 #include "net/base/host_port_pair.h"
11 #include "net/base/privacy_mode.h" 11 #include "net/base/privacy_mode.h"
12 #include "net/http/http_stream_factory_impl_job.h" 12 #include "net/http/http_stream_factory_impl_job.h"
13 #include "net/http/http_stream_factory_impl_request.h" 13 #include "net/http/http_stream_factory_impl_request.h"
14 #include "net/socket/next_proto.h"
14 15
15 namespace net { 16 namespace net {
16 17
17 class NetLogWithSource; 18 class NetLogWithSource;
18 19
19 // HttpStreamFactoryImpl::JobController manages Request and Job(s). 20 // HttpStreamFactoryImpl::JobController manages Request and Job(s).
20 class HttpStreamFactoryImpl::JobController 21 class HttpStreamFactoryImpl::JobController
21 : public HttpStreamFactoryImpl::Job::Delegate, 22 : public HttpStreamFactoryImpl::Job::Delegate,
22 public HttpStreamFactoryImpl::Request::Helper { 23 public HttpStreamFactoryImpl::Request::Helper {
23 public: 24 public:
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 const bool enable_ip_based_pooling_; 306 const bool enable_ip_based_pooling_;
306 307
307 // Enable using alternative services for the request. 308 // Enable using alternative services for the request.
308 const bool enable_alternative_services_; 309 const bool enable_alternative_services_;
309 310
310 // |main_job_| is a job waiting to see if |alternative_job_| can reuse a 311 // |main_job_| is a job waiting to see if |alternative_job_| can reuse a
311 // connection. If |alternative_job_| is unable to do so, |this| will notify 312 // connection. If |alternative_job_| is unable to do so, |this| will notify
312 // |main_job_| to proceed and then race the two jobs. 313 // |main_job_| to proceed and then race the two jobs.
313 std::unique_ptr<Job> main_job_; 314 std::unique_ptr<Job> main_job_;
314 std::unique_ptr<Job> alternative_job_; 315 std::unique_ptr<Job> alternative_job_;
316 // The alternative service used by |alternative_job_|
317 // (or by |main_job_| if |is_preconnect_|.)
318 AlternativeService alternative_service_;
315 319
316 // Net error code of the failed alternative job. Set to OK by default. 320 // Net error code of the failed alternative job. Set to OK by default.
317 int alternative_job_net_error_; 321 int alternative_job_net_error_;
318 // The alternative service server that |alternative_job_| uses failed.
319 AlternativeService failed_alternative_service_;
320 322
321 // True if a Job has ever been bound to the |request_|. 323 // True if a Job has ever been bound to the |request_|.
322 bool job_bound_; 324 bool job_bound_;
323 325
324 // True if the main job has to wait for the alternative job: i.e., the main 326 // True if the main job has to wait for the alternative job: i.e., the main
325 // job must not create a connection until it is resumed. 327 // job must not create a connection until it is resumed.
326 bool main_job_is_blocked_; 328 bool main_job_is_blocked_;
327 329
328 // True if the main job was blocked and has been resumed in ResumeMainJob(). 330 // True if the main job was blocked and has been resumed in ResumeMainJob().
329 bool main_job_is_resumed_; 331 bool main_job_is_resumed_;
(...skipping 19 matching lines...) Expand all
349 HttpStreamRequest::StreamType stream_type_; 351 HttpStreamRequest::StreamType stream_type_;
350 RequestPriority priority_; 352 RequestPriority priority_;
351 const NetLogWithSource net_log_; 353 const NetLogWithSource net_log_;
352 354
353 base::WeakPtrFactory<JobController> ptr_factory_; 355 base::WeakPtrFactory<JobController> ptr_factory_;
354 }; 356 };
355 357
356 } // namespace net 358 } // namespace net
357 359
358 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_CONTROLLER_H_ 360 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_CONTROLLER_H_
OLDNEW
« no previous file with comments | « net/http/http_stream_factory_impl_job.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