#ifndef CONTENT_BROWSER_PRELOADING_PRERENDER_PRERENDER_NAVIGATION_THROTTLE_H_
#define CONTENT_BROWSER_PRELOADING_PRERENDER_PRERENDER_NAVIGATION_THROTTLE_H_
#include "content/public/browser/navigation_throttle.h"
namespace content {
class PrerenderHost;
enum class PrerenderFinalStatus;
class PrerenderNavigationThrottle : public NavigationThrottle {
public:
static void MaybeCreateAndAdd(NavigationThrottleRegistry& registry);
~PrerenderNavigationThrottle() override;
const char* GetNameForLogging() override;
ThrottleCheckResult WillStartRequest() override;
ThrottleCheckResult WillRedirectRequest() override;
ThrottleCheckResult WillProcessResponse() override;
private:
explicit PrerenderNavigationThrottle(NavigationThrottleRegistry& registry);
ThrottleCheckResult WillStartOrRedirectRequest(bool is_redirection);
bool IsInitialNavigation() const;
void CancelPrerendering(PrerenderFinalStatus final_status);
const base::WeakPtr<PrerenderHost> prerender_host_ = nullptr;
bool is_same_site_cross_origin_prerender_ = false;
bool same_site_cross_origin_prerender_did_redirect_ = false;
};
}
#endif