Commit 09d0aae0 authored by bengr's avatar bengr Committed by Commit bot

Use URLRequestJobManager to retry data reduction proxy bypasses

The data reduction proxy retries a bypassed request by creating
a new URLRequestHttpJob for the request and starting it. This
change uses URLRequestJobManager::CreateJob() to create that job.
Previously, the URLRequestJobFactory chain was called to create
the job, an it only would for main frame requests.

BUG=434830

Review URL: https://codereview.chromium.org/740643003

Cr-Commit-Position: refs/heads/master@{#305054}
parent 547026d2
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "net/url_request/url_request.h" #include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_http_job.h" #include "net/url_request/url_request_http_job.h"
#include "net/url_request/url_request_job_factory.h" #include "net/url_request/url_request_job_manager.h"
#include "url/url_constants.h" #include "url/url_constants.h"
namespace data_reduction_proxy { namespace data_reduction_proxy {
...@@ -48,8 +48,8 @@ net::URLRequestJob* DataReductionProxyInterceptor::MaybeInterceptResponse( ...@@ -48,8 +48,8 @@ net::URLRequestJob* DataReductionProxyInterceptor::MaybeInterceptResponse(
// Returning non-NULL has the effect of restarting the request with the // Returning non-NULL has the effect of restarting the request with the
// supplied job. // supplied job.
DCHECK(request->url().SchemeIs(url::kHttpScheme)); DCHECK(request->url().SchemeIs(url::kHttpScheme));
return request->context()->job_factory()->MaybeCreateJobWithProtocolHandler( return net::URLRequestJobManager::GetInstance()->CreateJob(
url::kHttpScheme, request, network_delegate); request, network_delegate);
} }
} // namespace data_reduction_proxy } // namespace data_reduction_proxy
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/synchronization/lock.h" #include "base/synchronization/lock.h"
#include "base/threading/platform_thread.h" #include "base/threading/platform_thread.h"
#include "net/base/net_export.h"
#include "net/url_request/url_request.h" #include "net/url_request/url_request.h"
template <typename T> struct DefaultSingletonTraits; template <typename T> struct DefaultSingletonTraits;
...@@ -24,7 +25,7 @@ namespace net { ...@@ -24,7 +25,7 @@ namespace net {
// URLRequest is designed to have all consumers on a single thread, and // URLRequest is designed to have all consumers on a single thread, and
// so no attempt is made to support Interceptor instances being // so no attempt is made to support Interceptor instances being
// registered/unregistered or in any way poked on multiple threads. // registered/unregistered or in any way poked on multiple threads.
class URLRequestJobManager { class NET_EXPORT URLRequestJobManager {
public: public:
// Returns the singleton instance. // Returns the singleton instance.
static URLRequestJobManager* GetInstance(); static URLRequestJobManager* GetInstance();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment