namespace atom {
+typedef net::URLRequestJobFactory::ProtocolHandler ProtocolHandler;
+
AtomURLRequestJobFactory::AtomURLRequestJobFactory() {}
AtomURLRequestJobFactory::~AtomURLRequestJobFactory() {
return true;
}
+ProtocolHandler* AtomURLRequestJobFactory::InterceptProtocol(
+ const std::string& scheme,
+ ProtocolHandler* protocol_handler) {
+ DCHECK(CalledOnValidThread());
+ DCHECK(protocol_handler);
+
+ if (!ContainsKey(protocol_handler_map_, scheme))
+ return NULL;
+ ProtocolHandler* original_protocol_handler = protocol_handler_map_[scheme];
+ protocol_handler_map_[scheme] = protocol_handler;
+ return original_protocol_handler;
+}
+
net::URLRequestJob* AtomURLRequestJobFactory::MaybeCreateJobWithProtocolHandler(
const std::string& scheme,
net::URLRequest* request,
bool SetProtocolHandler(const std::string& scheme,
ProtocolHandler* protocol_handler);
+ // Intercepts the ProtocolHandler for a scheme. Returns the original protocol
+ // handler on success, otherwise returns NULL.
+ ProtocolHandler* InterceptProtocol(const std::string& scheme,
+ ProtocolHandler* protocol_handler);
+
// URLRequestJobFactory implementation
virtual net::URLRequestJob* MaybeCreateJobWithProtocolHandler(
const std::string& scheme,