#include "content/browser/renderer_host/ancestor_throttle.h"
#include "base/feature_list.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "content/browser/renderer_host/frame_tree.h"
#include "content/browser/renderer_host/frame_tree_node.h"
#include "content/browser/renderer_host/navigation_request.h"
#include "content/browser/renderer_host/navigator.h"
#include "content/browser/renderer_host/render_frame_host_csp_context.h"
#include "content/browser/renderer_host/render_frame_host_impl.h"
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/common/features.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/navigation_throttle.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_client.h"
#include "net/http/http_response_headers.h"
#include "services/network/public/cpp/content_security_policy/content_security_policy.h"
#include "services/network/public/cpp/content_security_policy/csp_context.h"
#include "third_party/blink/public/mojom/devtools/console_message.mojom-shared.h"
#include "third_party/blink/public/mojom/devtools/console_message.mojom.h"
#include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom.h"
namespace content {
namespace {
bool HeadersContainFrameAncestorsCSP(
const network::mojom::ParsedHeadersPtr& headers) { … }
RenderFrameHostImpl* GetParentForFrameAncestors(NavigationRequest* request,
RenderFrameHostImpl* frame) { … }
}
std::unique_ptr<NavigationThrottle> AncestorThrottle::MaybeCreateThrottleFor(
NavigationHandle* handle) { … }
AncestorThrottle::~AncestorThrottle() { … }
NavigationThrottle::ThrottleCheckResult
AncestorThrottle::WillRedirectRequest() { … }
NavigationThrottle::ThrottleCheckResult
AncestorThrottle::WillProcessResponse() { … }
NavigationThrottle::ThrottleCheckResult AncestorThrottle::ProcessResponseImpl(
LoggingDisposition logging,
bool is_response_check) { … }
const char* AncestorThrottle::GetNameForLogging() { … }
AncestorThrottle::AncestorThrottle(NavigationHandle* handle)
: … { … }
void AncestorThrottle::ParseXFrameOptionsError(
const net::HttpResponseHeaders* headers,
network::mojom::XFrameOptionsValue disposition) { … }
void AncestorThrottle::ConsoleErrorEmbeddingRequiresOptIn() { … }
void AncestorThrottle::ConsoleErrorXFrameOptions(
network::mojom::XFrameOptionsValue disposition) { … }
void AncestorThrottle::AddMessageToConsole(
blink::mojom::ConsoleMessageLevel level,
std::string message) { … }
AncestorThrottle::CheckResult AncestorThrottle::EvaluateXFrameOptions(
LoggingDisposition logging) { … }
AncestorThrottle::CheckResult AncestorThrottle::EvaluateEmbeddingOptIn(
LoggingDisposition logging) { … }
AncestorThrottle::CheckResult AncestorThrottle::EvaluateFrameAncestors(
const std::vector<network::mojom::ContentSecurityPolicyPtr>&
content_security_policy) { … }
}