#ifndef NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_
#define NET_URL_REQUEST_URL_REQUEST_JOB_FACTORY_H_
#include <string>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/threading/non_thread_safe.h"
#include "net/base/net_export.h"
class GURL;
namespace net {
class NetworkDelegate;
class URLRequest;
class URLRequestJob;
class NET_EXPORT URLRequestJobFactory
: NON_EXPORTED_BASE(public base::NonThreadSafe) {
public:
class NET_EXPORT ProtocolHandler {
public:
virtual ~ProtocolHandler();
virtual URLRequestJob* MaybeCreateJob(
URLRequest* request, NetworkDelegate* network_delegate) const = 0;
virtual bool IsSafeRedirectTarget(const GURL& location) const;
};
URLRequestJobFactory();
virtual ~URLRequestJobFactory();
virtual URLRequestJob* MaybeCreateJobWithProtocolHandler(
const std::string& scheme,
URLRequest* request,
NetworkDelegate* network_delegate) const = 0;
virtual bool IsHandledProtocol(const std::string& scheme) const = 0;
virtual bool IsHandledURL(const GURL& url) const = 0;
virtual bool IsSafeRedirectTarget(const GURL& location) const = 0;
private:
DISALLOW_COPY_AND_ASSIGN(URLRequestJobFactory);
};
}
#endif