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..47cf80ff88c532343411b289ae440c7dfe268f00 100644 |
--- a/chrome/browser/profiles/profile_io_data.cc |
+++ b/chrome/browser/profiles/profile_io_data.cc |
@@ -188,12 +188,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 +203,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 +749,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(); |
} |
} |