This source file includes following definitions.
- IsHandledProtocol
- IsHandledURL
- MaybeCreateJobWithProtocolHandler
- SetProtocolHandler
- IsSafeRedirectTarget
#include "android_webview/browser/net/aw_url_request_job_factory.h"
#include "net/base/net_errors.h"
#include "net/url_request/url_request_error_job.h"
#include "net/url_request/url_request_job_factory_impl.h"
#include "net/url_request/url_request_job_manager.h"
using net::NetworkDelegate;
using net::URLRequest;
using net::URLRequestJob;
namespace android_webview {
AwURLRequestJobFactory::AwURLRequestJobFactory()
: next_factory_(new net::URLRequestJobFactoryImpl()) {
}
AwURLRequestJobFactory::~AwURLRequestJobFactory() {
}
bool AwURLRequestJobFactory::IsHandledProtocol(
const std::string& scheme) const {
return true;
}
bool AwURLRequestJobFactory::IsHandledURL(const GURL& url) const {
return true;
}
URLRequestJob* AwURLRequestJobFactory::MaybeCreateJobWithProtocolHandler(
const std::string& scheme,
URLRequest* request,
NetworkDelegate* network_delegate) const {
URLRequestJob* job = next_factory_->MaybeCreateJobWithProtocolHandler(
scheme, request, network_delegate);
if (job)
return job;
if (net::URLRequest::IsHandledProtocol(scheme))
return NULL;
return new net::URLRequestErrorJob(
request, network_delegate, net::ERR_UNKNOWN_URL_SCHEME);
}
bool AwURLRequestJobFactory::SetProtocolHandler(
const std::string& scheme,
ProtocolHandler* protocol_handler) {
return next_factory_->SetProtocolHandler(scheme, protocol_handler);
}
bool AwURLRequestJobFactory::IsSafeRedirectTarget(const GURL& location) const {
return next_factory_->IsSafeRedirectTarget(location);
}
}