From 9a5698807ff9d07d37177a9b5c004a1fd3f17eaa Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Fri, 9 Jan 2015 19:10:31 -0800 Subject: [PATCH] Update to latest URLRequestJobFactory API --- .../net/atom_url_request_job_factory.cc | 19 ++++++++++++++++--- .../net/atom_url_request_job_factory.h | 7 +++++++ 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/atom/browser/net/atom_url_request_job_factory.cc b/atom/browser/net/atom_url_request_job_factory.cc index bca05eb216ed..ed1fb97e2c1c 100644 --- a/atom/browser/net/atom_url_request_job_factory.cc +++ b/atom/browser/net/atom_url_request_job_factory.cc @@ -50,7 +50,7 @@ ProtocolHandler* AtomURLRequestJobFactory::ReplaceProtocol( base::AutoLock locked(lock_); if (!ContainsKey(protocol_handler_map_, scheme)) - return NULL; + return nullptr; ProtocolHandler* original_protocol_handler = protocol_handler_map_[scheme]; protocol_handler_map_[scheme] = protocol_handler; return original_protocol_handler; @@ -63,7 +63,7 @@ ProtocolHandler* AtomURLRequestJobFactory::GetProtocolHandler( base::AutoLock locked(lock_); ProtocolHandlerMap::const_iterator it = protocol_handler_map_.find(scheme); if (it == protocol_handler_map_.end()) - return NULL; + return nullptr; return it->second; } @@ -82,10 +82,23 @@ net::URLRequestJob* AtomURLRequestJobFactory::MaybeCreateJobWithProtocolHandler( base::AutoLock locked(lock_); ProtocolHandlerMap::const_iterator it = protocol_handler_map_.find(scheme); if (it == protocol_handler_map_.end()) - return NULL; + return nullptr; return it->second->MaybeCreateJob(request, network_delegate); } +net::URLRequestJob* AtomURLRequestJobFactory::MaybeInterceptRedirect( + net::URLRequest* request, + net::NetworkDelegate* network_delegate, + const GURL& location) const { + return nullptr; +} + +net::URLRequestJob* AtomURLRequestJobFactory::MaybeInterceptResponse( + net::URLRequest* request, + net::NetworkDelegate* network_delegate) const { + return nullptr; +} + bool AtomURLRequestJobFactory::IsHandledProtocol( const std::string& scheme) const { DCHECK(CalledOnValidThread()); diff --git a/atom/browser/net/atom_url_request_job_factory.h b/atom/browser/net/atom_url_request_job_factory.h index 77e5d54a3b9b..a083e51483c7 100644 --- a/atom/browser/net/atom_url_request_job_factory.h +++ b/atom/browser/net/atom_url_request_job_factory.h @@ -44,6 +44,13 @@ class AtomURLRequestJobFactory : public net::URLRequestJobFactory { const std::string& scheme, net::URLRequest* request, net::NetworkDelegate* network_delegate) const override; + net::URLRequestJob* MaybeInterceptRedirect( + net::URLRequest* request, + net::NetworkDelegate* network_delegate, + const GURL& location) const override; + net::URLRequestJob* MaybeInterceptResponse( + net::URLRequest* request, + net::NetworkDelegate* network_delegate) const override; bool IsHandledProtocol(const std::string& scheme) const override; bool IsHandledURL(const GURL& url) const override; bool IsSafeRedirectTarget(const GURL& location) const override;