summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net
diff options
context:
space:
mode:
authorshalev@chromium.org <shalev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-24 01:06:58 +0000
committershalev@chromium.org <shalev@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-08-24 01:06:58 +0000
commit9f170464e1ab4f1f75802a391db76408bc8998f2 (patch)
tree50ecf1c9c893ab12c59ee653d57732572128b7ed /chrome/browser/net
parent3dc4019ef862889073cf16e875050a512e93aa3a (diff)
downloadchromium_src-9f170464e1ab4f1f75802a391db76408bc8998f2.zip
chromium_src-9f170464e1ab4f1f75802a391db76408bc8998f2.tar.gz
chromium_src-9f170464e1ab4f1f75802a391db76408bc8998f2.tar.bz2
Refactoring: ProtocolHandler::MaybeCreateJob and other functions take NetworkDelegate as argument
This change goes a long way to prepare for removing NetworkDelegate from URLRequestContext. TBR=sky@chromium.org, michaeln@chromium.org, benjhayden@chromium.org, brettw@chromium.org, ben@chromium.org, davemoore@chromium.org, zelidrag@chromium.org, mnissler@chromium.org, thestig@chromium.org, asargent@chromium.org, jhawkins@chromium.org, bulach@chromium.org BUG=crbug.com/142945 Review URL: https://chromiumcodereview.appspot.com/10855209 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153133 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net')
-rw-r--r--chrome/browser/net/about_protocol_handler.cc4
-rw-r--r--chrome/browser/net/about_protocol_handler.h3
-rw-r--r--chrome/browser/net/connect_interceptor.cc7
-rw-r--r--chrome/browser/net/connect_interceptor.h10
-rw-r--r--chrome/browser/net/url_request_mock_link_doctor_job.cc7
-rw-r--r--chrome/browser/net/url_request_mock_link_doctor_job.h3
6 files changed, 21 insertions, 13 deletions
diff --git a/chrome/browser/net/about_protocol_handler.cc b/chrome/browser/net/about_protocol_handler.cc
index 9eea3d5..20a8f1f 100644
--- a/chrome/browser/net/about_protocol_handler.cc
+++ b/chrome/browser/net/about_protocol_handler.cc
@@ -12,9 +12,9 @@ AboutProtocolHandler::AboutProtocolHandler() {
}
URLRequestJob* AboutProtocolHandler::MaybeCreateJob(
- URLRequest* request) const {
+ URLRequest* request, NetworkDelegate* network_delegate) const {
DCHECK(false);
- return new URLRequestAboutJob(request);
+ return new URLRequestAboutJob(request, network_delegate);
}
} // namespace net
diff --git a/chrome/browser/net/about_protocol_handler.h b/chrome/browser/net/about_protocol_handler.h
index 6e1c5da..46bbe6f 100644
--- a/chrome/browser/net/about_protocol_handler.h
+++ b/chrome/browser/net/about_protocol_handler.h
@@ -17,7 +17,8 @@ class URLRequestJob;
class AboutProtocolHandler : public URLRequestJobFactory::ProtocolHandler {
public:
AboutProtocolHandler();
- virtual URLRequestJob* MaybeCreateJob(URLRequest* request) const OVERRIDE;
+ virtual URLRequestJob* MaybeCreateJob(
+ URLRequest* request, NetworkDelegate* network_delegate) const OVERRIDE;
private:
DISALLOW_COPY_AND_ASSIGN(AboutProtocolHandler);
diff --git a/chrome/browser/net/connect_interceptor.cc b/chrome/browser/net/connect_interceptor.cc
index 0ea6dbd..c1d6dea 100644
--- a/chrome/browser/net/connect_interceptor.cc
+++ b/chrome/browser/net/connect_interceptor.cc
@@ -28,7 +28,7 @@ ConnectInterceptor::~ConnectInterceptor() {
}
net::URLRequestJob* ConnectInterceptor::MaybeIntercept(
- net::URLRequest* request) const {
+ net::URLRequest* request, net::NetworkDelegate* network_delegate) const {
GURL request_scheme_host(Predictor::CanonicalizeUrl(request->url()));
if (request_scheme_host == GURL::EmptyGURL())
return NULL;
@@ -88,13 +88,14 @@ net::URLRequestJob* ConnectInterceptor::MaybeIntercept(
}
net::URLRequestJob* ConnectInterceptor::MaybeInterceptResponse(
- net::URLRequest* request) const {
+ net::URLRequest* request, net::NetworkDelegate* network_delegate) const {
return NULL;
}
net::URLRequestJob* ConnectInterceptor::MaybeInterceptRedirect(
const GURL& location,
- net::URLRequest* request) const {
+ net::URLRequest* request,
+ net::NetworkDelegate* network_delegate) const {
return NULL;
}
diff --git a/chrome/browser/net/connect_interceptor.h b/chrome/browser/net/connect_interceptor.h
index 5fb3da7..1cef9fe 100644
--- a/chrome/browser/net/connect_interceptor.h
+++ b/chrome/browser/net/connect_interceptor.h
@@ -28,11 +28,15 @@ class ConnectInterceptor : public net::URLRequestJobFactory::Interceptor {
// Overridden from net::URLRequest::Interceptor:
// Learn about referrers, and optionally preconnect based on history.
virtual net::URLRequestJob* MaybeIntercept(
- net::URLRequest* request) const OVERRIDE;
+ net::URLRequest* request,
+ net::NetworkDelegate* network_delegate) const OVERRIDE;
virtual net::URLRequestJob* MaybeInterceptResponse(
- net::URLRequest* request) const OVERRIDE;
+ net::URLRequest* request,
+ net::NetworkDelegate* network_delegate) const OVERRIDE;
virtual net::URLRequestJob* MaybeInterceptRedirect(
- const GURL& location, net::URLRequest* request) const OVERRIDE;
+ const GURL& location,
+ net::URLRequest* request,
+ net::NetworkDelegate* network_delegate) const OVERRIDE;
private:
// Provide access to local class TimedCache for testing.
diff --git a/chrome/browser/net/url_request_mock_link_doctor_job.cc b/chrome/browser/net/url_request_mock_link_doctor_job.cc
index fb6563e..d68122b 100644
--- a/chrome/browser/net/url_request_mock_link_doctor_job.cc
+++ b/chrome/browser/net/url_request_mock_link_doctor_job.cc
@@ -24,8 +24,9 @@ FilePath GetMockFilePath() {
// static
net::URLRequestJob* URLRequestMockLinkDoctorJob::Factory(
net::URLRequest* request,
+ net::NetworkDelegate* network_delegate,
const std::string& scheme) {
- return new URLRequestMockLinkDoctorJob(request);
+ return new URLRequestMockLinkDoctorJob(request, network_delegate);
}
// static
@@ -37,6 +38,6 @@ void URLRequestMockLinkDoctorJob::AddUrlHandler() {
}
URLRequestMockLinkDoctorJob::URLRequestMockLinkDoctorJob(
- net::URLRequest* request)
- : URLRequestMockHTTPJob(request, GetMockFilePath()) {
+ net::URLRequest* request, net::NetworkDelegate* network_delegate)
+ : URLRequestMockHTTPJob(request, network_delegate, GetMockFilePath()) {
}
diff --git a/chrome/browser/net/url_request_mock_link_doctor_job.h b/chrome/browser/net/url_request_mock_link_doctor_job.h
index eba6c57..c559d06 100644
--- a/chrome/browser/net/url_request_mock_link_doctor_job.h
+++ b/chrome/browser/net/url_request_mock_link_doctor_job.h
@@ -11,7 +11,8 @@
class URLRequestMockLinkDoctorJob : public URLRequestMockHTTPJob {
public:
- explicit URLRequestMockLinkDoctorJob(net::URLRequest* request);
+ URLRequestMockLinkDoctorJob(net::URLRequest* request,
+ net::NetworkDelegate* network_delegate);
static net::URLRequest::ProtocolFactory Factory;