| Index: chrome/browser/profiles/profile_io_data.cc
|
| diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
|
| index bcbc31ceae677a60c1b2f06cf48bcab76d2b9eef..1f5769abb9e1dc7a2bd6ae41aa82cf07d0b15f09 100644
|
| --- a/chrome/browser/profiles/profile_io_data.cc
|
| +++ b/chrome/browser/profiles/profile_io_data.cc
|
| @@ -69,6 +69,7 @@
|
| #include "net/url_request/data_protocol_handler.h"
|
| #include "net/url_request/file_protocol_handler.h"
|
| #include "net/url_request/ftp_protocol_handler.h"
|
| +#include "net/url_request/protocol_intercept_job_factory.h"
|
| #include "net/url_request/url_request.h"
|
| #include "net/url_request/url_request_file_job.h"
|
| #include "net/url_request/url_request_job_factory_impl.h"
|
| @@ -188,12 +189,13 @@ bool IsSupportedDevToolsURL(const GURL& url, FilePath* path) {
|
| return true;
|
| }
|
|
|
| -class DebugDevToolsInterceptor : public net::URLRequestJobFactory::Interceptor {
|
| +class DebugDevToolsInterceptor
|
| + : public net::URLRequestJobFactory::ProtocolHandler {
|
| public:
|
| DebugDevToolsInterceptor() {}
|
| virtual ~DebugDevToolsInterceptor() {}
|
|
|
| - virtual net::URLRequestJob* MaybeIntercept(
|
| + virtual net::URLRequestJob* MaybeCreateJob(
|
| net::URLRequest* request,
|
| net::NetworkDelegate* network_delegate) const OVERRIDE {
|
| FilePath path;
|
| @@ -202,23 +204,6 @@ class DebugDevToolsInterceptor : public net::URLRequestJobFactory::Interceptor {
|
|
|
| return NULL;
|
| }
|
| -
|
| - virtual net::URLRequestJob* MaybeInterceptRedirect(
|
| - const GURL& location,
|
| - net::URLRequest* request,
|
| - net::NetworkDelegate* network_delegate) const OVERRIDE {
|
| - return NULL;
|
| - }
|
| -
|
| - virtual net::URLRequestJob* MaybeInterceptResponse(
|
| - net::URLRequest* request,
|
| - net::NetworkDelegate* network_delegate) const OVERRIDE {
|
| - return NULL;
|
| - }
|
| -
|
| - virtual bool WillHandleProtocol(const std::string& protocol) const {
|
| - return protocol == chrome::kChromeDevToolsScheme;
|
| - }
|
| };
|
| #endif // defined(DEBUG_DEVTOOLS)
|
|
|
| @@ -765,16 +750,20 @@ scoped_ptr<net::URLRequestJobFactory> ProfileIOData::SetUpJobFactoryDefaults(
|
| ftp_auth_cache));
|
| #endif // !defined(DISABLE_FTP_SUPPORT)
|
|
|
| + scoped_ptr<net::URLRequestJobFactory> top_job_factory =
|
| + job_factory.PassAs<net::URLRequestJobFactory>();
|
| #if defined(DEBUG_DEVTOOLS)
|
| - job_factory->AddInterceptor(new DebugDevToolsInterceptor());
|
| + top_job_factory.reset(new net::ProtocolInterceptJobFactory(
|
| + top_job_factory.Pass(),
|
| + scoped_ptr<net::URLRequestJobFactory::ProtocolHandler>(
|
| + new DebugDevToolsInterceptor)));
|
| #endif
|
|
|
| if (protocol_handler_interceptor) {
|
| - protocol_handler_interceptor->Chain(
|
| - job_factory.PassAs<net::URLRequestJobFactory>());
|
| + protocol_handler_interceptor->Chain(top_job_factory.Pass());
|
| return protocol_handler_interceptor.PassAs<net::URLRequestJobFactory>();
|
| } else {
|
| - return job_factory.PassAs<net::URLRequestJobFactory>();
|
| + return top_job_factory.Pass();
|
| }
|
| }
|
|
|
|
|