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

Unified Diff: net/http/http_stream_factory_impl_job.h

Issue 2910463004: Revert "Revert CLs landed in HttpStreamFactoryImpl to track down a crasher" (Closed)
Patch Set: rebased 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_stream_factory_impl.cc ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl_job.h
diff --git a/net/http/http_stream_factory_impl_job.h b/net/http/http_stream_factory_impl_job.h
index 9a96af2961a6260f35786a860e7eaac43ff292ba..11361536f1881623bf027d8ad81f0b60f2d26b10 100644
--- a/net/http/http_stream_factory_impl_job.h
+++ b/net/http/http_stream_factory_impl_job.h
@@ -102,16 +102,6 @@ class HttpStreamFactoryImpl::Job {
// contained in |proxy_info| can be skipped.
virtual bool OnInitConnection(const ProxyInfo& proxy_info) = 0;
- // Invoked when |job| has completed proxy resolution. The delegate may
- // create an alternative proxy server job to fetch the request.
- virtual void OnResolveProxyComplete(
- Job* job,
- const HttpRequestInfo& request_info,
- RequestPriority priority,
- const SSLConfig& server_ssl_config,
- const SSLConfig& proxy_ssl_config,
- HttpStreamRequest::StreamType stream_type) = 0;
-
// Invoked to notify the Request and Factory of the readiness of new
// SPDY session.
virtual void OnNewSpdySessionReady(
@@ -163,6 +153,7 @@ class HttpStreamFactoryImpl::Job {
HttpNetworkSession* session,
const HttpRequestInfo& request_info,
RequestPriority priority,
+ const ProxyInfo& proxy_info,
const SSLConfig& server_ssl_config,
const SSLConfig& proxy_ssl_config,
HostPortPair destination,
@@ -183,6 +174,7 @@ class HttpStreamFactoryImpl::Job {
HttpNetworkSession* session,
const HttpRequestInfo& request_info,
RequestPriority priority,
+ const ProxyInfo& proxy_info,
const SSLConfig& server_ssl_config,
const SSLConfig& proxy_ssl_config,
HostPortPair destination,
@@ -251,6 +243,8 @@ class HttpStreamFactoryImpl::Job {
return using_existing_quic_session_;
}
+ bool should_reconsider_proxy() const { return should_reconsider_proxy_; }
+
// TODO(xunjieli): Added to investigate crbug.com/711721. Remove when no
// longer needed.
void LogHistograms() const;
@@ -260,12 +254,8 @@ class HttpStreamFactoryImpl::Job {
enum State {
STATE_START,
- STATE_RESOLVE_PROXY,
- STATE_RESOLVE_PROXY_COMPLETE,
-
// The main and alternative jobs are started in parallel. The main job
- // waits after it finishes proxy resolution. The alternative job never
- // waits.
+ // can wait if it's paused. The alternative job never waits.
//
// An HTTP/2 alternative job notifies the JobController in DoInitConnection
// unless it can pool to an existing SpdySession. JobController, in turn,
@@ -321,8 +311,6 @@ class HttpStreamFactoryImpl::Job {
// ERR_IO_PENDING, then the result from OnIOComplete will be passed to the
// next state method as the result arg.
int DoStart();
- int DoResolveProxy();
- int DoResolveProxyComplete(int result);
int DoWait();
int DoWaitComplete(int result);
int DoInitConnection();
@@ -405,7 +393,7 @@ class HttpStreamFactoryImpl::Job {
const HttpRequestInfo request_info_;
RequestPriority priority_;
- ProxyInfo proxy_info_;
+ const ProxyInfo proxy_info_;
SSLConfig server_ssl_config_;
SSLConfig proxy_ssl_config_;
const NetLogWithSource net_log_;
@@ -418,7 +406,6 @@ class HttpStreamFactoryImpl::Job {
State state_;
State next_state_;
- ProxyService::PacRequest* pac_request_;
SSLInfo ssl_info_;
// The server we are trying to reach, could be that of the origin or of the
@@ -453,6 +440,10 @@ class HttpStreamFactoryImpl::Job {
// True if this network transaction is using QUIC instead of HTTP.
bool using_quic_;
+
+ // True if this job might succeed with a different proxy config.
+ bool should_reconsider_proxy_;
+
QuicStreamRequest quic_request_;
// True if this job used an existing QUIC session.
@@ -498,51 +489,53 @@ class HttpStreamFactoryImpl::Job {
// Factory for creating Jobs.
class HttpStreamFactoryImpl::JobFactory {
public:
- virtual ~JobFactory() {}
+ JobFactory();
+
+ virtual ~JobFactory();
- // Creates an alternative service Job.
- virtual HttpStreamFactoryImpl::Job* CreateJob(
+ virtual std::unique_ptr<HttpStreamFactoryImpl::Job> CreateMainJob(
HttpStreamFactoryImpl::Job::Delegate* delegate,
HttpStreamFactoryImpl::JobType job_type,
HttpNetworkSession* session,
const HttpRequestInfo& request_info,
RequestPriority priority,
+ const ProxyInfo& proxy_info,
const SSLConfig& server_ssl_config,
const SSLConfig& proxy_ssl_config,
HostPortPair destination,
GURL origin_url,
- AlternativeService alternative_service,
bool enable_ip_based_pooling,
- NetLog* net_log) = 0;
+ NetLog* net_log);
- // Creates an alternative proxy server Job.
- virtual HttpStreamFactoryImpl::Job* CreateJob(
+ virtual std::unique_ptr<HttpStreamFactoryImpl::Job> CreateAltSvcJob(
HttpStreamFactoryImpl::Job::Delegate* delegate,
HttpStreamFactoryImpl::JobType job_type,
HttpNetworkSession* session,
const HttpRequestInfo& request_info,
RequestPriority priority,
+ const ProxyInfo& proxy_info,
const SSLConfig& server_ssl_config,
const SSLConfig& proxy_ssl_config,
HostPortPair destination,
GURL origin_url,
- const ProxyServer& alternative_proxy_server,
+ AlternativeService alternative_service,
bool enable_ip_based_pooling,
- NetLog* net_log) = 0;
+ NetLog* net_log);
- // Creates a non-alternative Job.
- virtual HttpStreamFactoryImpl::Job* CreateJob(
+ virtual std::unique_ptr<HttpStreamFactoryImpl::Job> CreateAltProxyJob(
HttpStreamFactoryImpl::Job::Delegate* delegate,
HttpStreamFactoryImpl::JobType job_type,
HttpNetworkSession* session,
const HttpRequestInfo& request_info,
RequestPriority priority,
+ const ProxyInfo& proxy_info,
const SSLConfig& server_ssl_config,
const SSLConfig& proxy_ssl_config,
HostPortPair destination,
GURL origin_url,
+ const ProxyServer& alternative_proxy_server,
bool enable_ip_based_pooling,
- NetLog* net_log) = 0;
+ NetLog* net_log);
};
} // namespace net
« no previous file with comments | « net/http/http_stream_factory_impl.cc ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698