#ifndef COMPONENTS_CUSTOM_HANDLERS_PROTOCOL_HANDLER_THROTTLE_H_
#define COMPONENTS_CUSTOM_HANDLERS_PROTOCOL_HANDLER_THROTTLE_H_
#include "third_party/blink/public/common/loader/url_loader_throttle.h"
#include "url/gurl.h"
namespace custom_handlers {
class ProtocolHandlerRegistry;
class ProtocolHandlerThrottle : public blink::URLLoaderThrottle {
public:
explicit ProtocolHandlerThrottle(ProtocolHandlerRegistry&);
~ProtocolHandlerThrottle() override;
void WillStartRequest(network::ResourceRequest* request,
bool* defer) override;
void WillRedirectRequest(
net::RedirectInfo* redirect_info,
const network::mojom::URLResponseHead& response_head,
bool* defer,
std::vector<std::string>* to_be_removed_headers,
net::HttpRequestHeaders* modified_headers,
net::HttpRequestHeaders* modified_cors_exempt_headers) override;
private:
void TranslateUrl(GURL& url);
base::WeakPtr<ProtocolHandlerRegistry> protocol_handler_registry_;
};
}
#endif