#include "content/browser/client_hints/critical_client_hints_throttle.h"
#include "base/feature_list.h"
#include "base/metrics/histogram_functions.h"
#include "content/browser/client_hints/client_hints.h"
#include "content/browser/renderer_host/frame_tree_node.h"
#include "content/browser/renderer_host/navigation_request.h"
#include "content/common/features.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/client_hints_controller_delegate.h"
#include "content/public/browser/content_browser_client.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_client.h"
#include "net/http/http_request_headers.h"
#include "net/http/http_util.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
#include "services/metrics/public/cpp/ukm_source_id.h"
#include "services/network/public/cpp/client_hints.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/mojom/parsed_headers.mojom-forward.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "third_party/blink/public/common/client_hints/client_hints.h"
#include "third_party/blink/public/common/client_hints/enabled_client_hints.h"
#include "third_party/blink/public/common/loader/url_loader_throttle.h"
namespace {
WebClientHintsType;
void LogCriticalCHStatus(CriticalCHRestart status) { … }
}
namespace content {
CriticalClientHintsThrottle::CriticalClientHintsThrottle(
BrowserContext* context,
ClientHintsControllerDelegate* client_hint_delegate,
int frame_tree_node_id)
: … { … }
CriticalClientHintsThrottle::~CriticalClientHintsThrottle() = default;
void CriticalClientHintsThrottle::WillStartRequest(
network::ResourceRequest* request,
bool* defer) { … }
void CriticalClientHintsThrottle::BeforeWillProcessResponse(
const GURL& response_url,
const network::mojom::URLResponseHead& response_head,
RestartWithURLReset* restart_with_url_reset) { … }
void CriticalClientHintsThrottle::BeforeWillRedirectRequest(
net::RedirectInfo* redirect_info,
const network::mojom::URLResponseHead& response_head,
RestartWithURLReset* restart_with_url_reset,
std::vector<std::string>* to_be_removed_request_headers,
net::HttpRequestHeaders* modified_request_headers,
net::HttpRequestHeaders* modified_cors_exempt_request_headers) { … }
void CriticalClientHintsThrottle::MaybeRestartWithHints(
const network::mojom::URLResponseHead& response_head,
RestartWithURLReset* restart_with_url_reset) { … }
}