| Index: net/http/http_stream_factory_impl_job_controller.h
|
| diff --git a/net/http/http_stream_factory_impl_job_controller.h b/net/http/http_stream_factory_impl_job_controller.h
|
| index d321fac532fca5a99ab885008525ae93cd1ff95e..1d918a58dc0da77ca5ae28609e0e7d82cd27b492 100644
|
| --- a/net/http/http_stream_factory_impl_job_controller.h
|
| +++ b/net/http/http_stream_factory_impl_job_controller.h
|
| @@ -26,7 +26,9 @@ class HttpStreamFactoryImpl::JobController
|
| const HttpRequestInfo& request_info,
|
| bool is_preconnect,
|
| bool enable_ip_based_pooling,
|
| - bool enable_alternative_services);
|
| + bool enable_alternative_services,
|
| + const SSLConfig& server_ssl_config,
|
| + const SSLConfig& proxy_ssl_config);
|
|
|
| ~JobController() override;
|
|
|
| @@ -41,20 +43,14 @@ class HttpStreamFactoryImpl::JobController
|
| // Methods below are called by HttpStreamFactoryImpl only.
|
| // Creates request and hands out to HttpStreamFactoryImpl, this will also
|
| // create Job(s) and start serving the created request.
|
| - Request* Start(const HttpRequestInfo& request_info,
|
| - HttpStreamRequest::Delegate* delegate,
|
| + Request* Start(HttpStreamRequest::Delegate* delegate,
|
| WebSocketHandshakeStreamBase::CreateHelper*
|
| websocket_handshake_stream_create_helper,
|
| const NetLogWithSource& source_net_log,
|
| HttpStreamRequest::StreamType stream_type,
|
| - RequestPriority priority,
|
| - const SSLConfig& server_ssl_config,
|
| - const SSLConfig& proxy_ssl_config);
|
| + RequestPriority priority);
|
|
|
| - void Preconnect(int num_streams,
|
| - const HttpRequestInfo& request_info,
|
| - const SSLConfig& server_ssl_config,
|
| - const SSLConfig& proxy_ssl_config);
|
| + void Preconnect(int num_streams);
|
|
|
| // From HttpStreamFactoryImpl::Request::Helper.
|
| // Returns the LoadState for Request.
|
| @@ -122,13 +118,6 @@ class HttpStreamFactoryImpl::JobController
|
|
|
| bool OnInitConnection(const ProxyInfo& proxy_info) override;
|
|
|
| - void OnResolveProxyComplete(
|
| - Job* job,
|
| - const HttpRequestInfo& request_info,
|
| - RequestPriority priority,
|
| - const SSLConfig& server_ssl_config,
|
| - const SSLConfig& proxy_ssl_config,
|
| - HttpStreamRequest::StreamType stream_type) override;
|
|
|
| // Invoked to notify the Request and Factory of the readiness of new
|
| // SPDY session.
|
| @@ -191,13 +180,22 @@ class HttpStreamFactoryImpl::JobController
|
| private:
|
| friend class JobControllerPeer;
|
|
|
| + enum State {
|
| + STATE_RESOLVE_PROXY,
|
| + STATE_RESOLVE_PROXY_COMPLETE,
|
| +
|
| + STATE_CREATE_JOBS,
|
| + STATE_NONE
|
| + };
|
| +
|
| + void OnIOComplete(int result);
|
| + void OnResolveProxyError(int error);
|
| + void RunLoop(int result);
|
| + int DoLoop(int result);
|
| + int DoResolveProxy();
|
| + int DoResolveProxyComplete(int result);
|
| // Creates Job(s) for |request_|. Job(s) will be owned by |this|.
|
| - void CreateJobs(const HttpRequestInfo& request_info,
|
| - RequestPriority priority,
|
| - const SSLConfig& server_ssl_config,
|
| - const SSLConfig& proxy_ssl_config,
|
| - HttpStreamRequest::Delegate* delegate,
|
| - HttpStreamRequest::StreamType stream_type);
|
| + int DoCreateJobs();
|
|
|
| // Called to bind |job| to the |request_| and orphan all other jobs that are
|
| // still associated with |request_|.
|
| @@ -223,9 +221,13 @@ class HttpStreamFactoryImpl::JobController
|
| NextProto negotiated_protocol,
|
| bool using_spdy);
|
|
|
| - // Must be called when the alternative job fails. |net_error| is the net error
|
| - // of the failed alternative job.
|
| - void OnAlternativeJobFailed(int net_error);
|
| + // Must be called when the alternative service job fails. |net_error| is the
|
| + // net error of the failed alternative service job.
|
| + void OnAlternativeServiceJobFailed(int net_error);
|
| +
|
| + // Must be called when the alternative proxy job fails. |net_error| is the
|
| + // net error of the failed alternative proxy job.
|
| + void OnAlternativeProxyJobFailed(int net_error);
|
|
|
| // Called to report to http_server_properties to mark alternative service
|
| // broken.
|
| @@ -261,7 +263,6 @@ class HttpStreamFactoryImpl::JobController
|
| // alternative proxy server. |alternative_proxy_server| should not be null,
|
| // and is owned by the caller.
|
| bool ShouldCreateAlternativeProxyServerJob(
|
| - Job* job,
|
| const ProxyInfo& proxy_info_,
|
| const GURL& url,
|
| ProxyServer* alternative_proxy_server) const;
|
| @@ -270,12 +271,17 @@ class HttpStreamFactoryImpl::JobController
|
| // called when |job| has succeeded and the other job will be orphaned.
|
| void ReportAlternateProtocolUsage(Job* job) const;
|
|
|
| - // Starts the |alternative_job_|.
|
| - void StartAlternativeProxyServerJob();
|
| -
|
| // Returns whether |job| is an orphaned job.
|
| bool IsJobOrphaned(Job* job) const;
|
|
|
| + // Called when a Job encountered a network error that could be resolved by
|
| + // trying a new proxy configuration. If there is another proxy configuration
|
| + // to try then this method sets |next_state_| appropriately and returns either
|
| + // OK or ERR_IO_PENDING depending on whether or not the new proxy
|
| + // configuration is available synchronously or asynchronously. Otherwise, the
|
| + // given error code is simply returned.
|
| + int ReconsiderProxyAfterError(Job* job, int error);
|
| +
|
| HttpStreamFactoryImpl* factory_;
|
| HttpNetworkSession* session_;
|
| JobFactory* job_factory_;
|
| @@ -306,11 +312,8 @@ class HttpStreamFactoryImpl::JobController
|
|
|
| // Net error code of the failed alternative job. Set to OK by default.
|
| int alternative_job_net_error_;
|
| -
|
| - // Either and only one of these records failed alternative service/proxy
|
| - // server that |alternative_job_| uses.
|
| + // The alternative service server that |alternative_job_| uses failed.
|
| AlternativeService failed_alternative_service_;
|
| - ProxyServer failed_alternative_proxy_server_;
|
|
|
| // True if a Job has ever been bound to the |request_|.
|
| bool job_bound_;
|
| @@ -335,6 +338,16 @@ class HttpStreamFactoryImpl::JobController
|
| // Privacy mode that should be used for fetching the resource.
|
| PrivacyMode privacy_mode_;
|
|
|
| + State next_state_;
|
| + ProxyService::PacRequest* pac_request_;
|
| + CompletionCallback io_callback_;
|
| + const HttpRequestInfo request_info_;
|
| + ProxyInfo proxy_info_;
|
| + const SSLConfig server_ssl_config_;
|
| + const SSLConfig proxy_ssl_config_;
|
| + int num_streams_;
|
| + HttpStreamRequest::StreamType stream_type_;
|
| + RequestPriority priority_;
|
| const NetLogWithSource net_log_;
|
|
|
| base::WeakPtrFactory<JobController> ptr_factory_;
|
|
|