#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-private-field"
#endif
#include "services/network/public/mojom/content_security_policy.mojom-blink.h"
#include <math.h>
#include <stdint.h>
#include <utility>
#include "base/debug/alias.h"
#include "base/hash/md5_constexpr.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/thread_pool/thread_pool_instance.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/typed_macros.h"
#include "mojo/public/cpp/bindings/features.h"
#include "mojo/public/cpp/bindings/lib/default_construct_tag_internal.h"
#include "mojo/public/cpp/bindings/lib/generated_code_util.h"
#include "mojo/public/cpp/bindings/lib/message_internal.h"
#include "mojo/public/cpp/bindings/lib/proxy_to_responder.h"
#include "mojo/public/cpp/bindings/lib/send_message_helper.h"
#include "mojo/public/cpp/bindings/lib/serialization_util.h"
#include "mojo/public/cpp/bindings/lib/unserialized_message_context.h"
#include "mojo/public/cpp/bindings/lib/validate_params.h"
#include "mojo/public/cpp/bindings/lib/validation_errors.h"
#include "mojo/public/cpp/bindings/mojo_buildflags.h"
#include "mojo/public/cpp/bindings/urgent_message_scope.h"
#include "mojo/public/interfaces/bindings/interface_control_messages.mojom.h"
#include "third_party/perfetto/include/perfetto/tracing/traced_value.h"
#include "services/network/public/mojom/content_security_policy.mojom-params-data.h"
#include "services/network/public/mojom/content_security_policy.mojom-shared-message-ids.h"
#include "services/network/public/mojom/content_security_policy.mojom-blink-import-headers.h"
#include "services/network/public/mojom/content_security_policy.mojom-blink-test-utils.h"
#include "mojo/public/cpp/bindings/lib/wtf_serialization.h"
namespace network::mojom::blink {
ContentSecurityPolicyHeader::ContentSecurityPolicyHeader()
: … { … }
ContentSecurityPolicyHeader::ContentSecurityPolicyHeader(
const WTF::String& header_value_in,
ContentSecurityPolicyType type_in,
ContentSecurityPolicySource source_in)
: … { … }
ContentSecurityPolicyHeader::~ContentSecurityPolicyHeader() = default;
size_t ContentSecurityPolicyHeader::Hash(size_t seed) const { … }
void ContentSecurityPolicyHeader::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool ContentSecurityPolicyHeader::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
CSPSource::CSPSource()
: … { … }
CSPSource::CSPSource(
const WTF::String& scheme_in,
const WTF::String& host_in,
int32_t port_in,
const WTF::String& path_in,
bool is_host_wildcard_in,
bool is_port_wildcard_in)
: … { … }
CSPSource::~CSPSource() = default;
size_t CSPSource::Hash(size_t seed) const { … }
void CSPSource::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool CSPSource::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
CSPHashSource::CSPHashSource()
: … { … }
CSPHashSource::CSPHashSource(
CSPHashAlgorithm algorithm_in,
WTF::Vector<uint8_t> value_in)
: … { … }
CSPHashSource::~CSPHashSource() = default;
void CSPHashSource::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool CSPHashSource::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
CSPSourceList::CSPSourceList()
: … { … }
CSPSourceList::CSPSourceList(
WTF::Vector<CSPSourcePtr> sources_in,
WTF::Vector<WTF::String> nonces_in,
WTF::Vector<CSPHashSourcePtr> hashes_in,
bool allow_self_in,
bool allow_star_in,
bool allow_response_redirects_in,
bool allow_inline_in,
bool allow_inline_speculation_rules_in,
bool allow_eval_in,
bool allow_wasm_eval_in,
bool allow_wasm_unsafe_eval_in,
bool allow_dynamic_in,
bool allow_unsafe_hashes_in,
bool report_sample_in)
: … { … }
CSPSourceList::~CSPSourceList() = default;
void CSPSourceList::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool CSPSourceList::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
CSPTrustedTypes::CSPTrustedTypes()
: … { … }
CSPTrustedTypes::CSPTrustedTypes(
WTF::Vector<WTF::String> list_in,
bool allow_any_in,
bool allow_duplicates_in)
: … { … }
CSPTrustedTypes::~CSPTrustedTypes() = default;
void CSPTrustedTypes::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool CSPTrustedTypes::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
ContentSecurityPolicy::ContentSecurityPolicy()
: … { … }
ContentSecurityPolicy::ContentSecurityPolicy(
CSPSourcePtr self_origin_in,
const WTF::HashMap<CSPDirectiveName, WTF::String>& raw_directives_in,
WTF::HashMap<CSPDirectiveName, CSPSourceListPtr> directives_in,
bool upgrade_insecure_requests_in,
bool treat_as_public_address_in,
bool block_all_mixed_content_in,
::network::mojom::blink::WebSandboxFlags sandbox_in,
ContentSecurityPolicyHeaderPtr header_in,
bool use_reporting_api_in,
WTF::Vector<WTF::String> report_endpoints_in,
CSPRequireTrustedTypesFor require_trusted_types_for_in,
CSPTrustedTypesPtr trusted_types_in,
WTF::Vector<WTF::String> parsing_errors_in)
: … { … }
ContentSecurityPolicy::~ContentSecurityPolicy() = default;
void ContentSecurityPolicy::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool ContentSecurityPolicy::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
CSPViolation::CSPViolation()
: … { … }
CSPViolation::CSPViolation(
const WTF::String& directive_in,
const WTF::String& effective_directive_in,
const WTF::String& console_message_in,
const ::blink::KURL& blocked_url_in,
WTF::Vector<WTF::String> report_endpoints_in,
bool use_reporting_api_in,
const WTF::String& header_in,
ContentSecurityPolicyType type_in,
::network::mojom::blink::SourceLocationPtr source_location_in)
: … { … }
CSPViolation::~CSPViolation() = default;
void CSPViolation::WriteIntoTrace(
perfetto::TracedValue traced_context) const { … }
bool CSPViolation::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
AllowCSPFromHeaderValue::AllowCSPFromHeaderValue() : … { … }
AllowCSPFromHeaderValue::~AllowCSPFromHeaderValue() { … }
void AllowCSPFromHeaderValue::set_allow_star(
bool allow_star) { … }
void AllowCSPFromHeaderValue::set_origin(
const ::scoped_refptr<const ::blink::SecurityOrigin>& origin) { … }
void AllowCSPFromHeaderValue::set_error_message(
const WTF::String& error_message) { … }
void AllowCSPFromHeaderValue::DestroyActive() { … }
bool AllowCSPFromHeaderValue::Validate(
const void* data,
mojo::internal::ValidationContext* validation_context) { … }
}
namespace mojo {
bool StructTraits<::network::mojom::blink::ContentSecurityPolicyHeader::DataView, ::network::mojom::blink::ContentSecurityPolicyHeaderPtr>::Read(
::network::mojom::blink::ContentSecurityPolicyHeader::DataView input,
::network::mojom::blink::ContentSecurityPolicyHeaderPtr* output) { … }
bool StructTraits<::network::mojom::blink::CSPSource::DataView, ::network::mojom::blink::CSPSourcePtr>::Read(
::network::mojom::blink::CSPSource::DataView input,
::network::mojom::blink::CSPSourcePtr* output) { … }
bool StructTraits<::network::mojom::blink::CSPHashSource::DataView, ::network::mojom::blink::CSPHashSourcePtr>::Read(
::network::mojom::blink::CSPHashSource::DataView input,
::network::mojom::blink::CSPHashSourcePtr* output) { … }
bool StructTraits<::network::mojom::blink::CSPSourceList::DataView, ::network::mojom::blink::CSPSourceListPtr>::Read(
::network::mojom::blink::CSPSourceList::DataView input,
::network::mojom::blink::CSPSourceListPtr* output) { … }
bool StructTraits<::network::mojom::blink::CSPTrustedTypes::DataView, ::network::mojom::blink::CSPTrustedTypesPtr>::Read(
::network::mojom::blink::CSPTrustedTypes::DataView input,
::network::mojom::blink::CSPTrustedTypesPtr* output) { … }
bool StructTraits<::network::mojom::blink::ContentSecurityPolicy::DataView, ::network::mojom::blink::ContentSecurityPolicyPtr>::Read(
::network::mojom::blink::ContentSecurityPolicy::DataView input,
::network::mojom::blink::ContentSecurityPolicyPtr* output) { … }
bool StructTraits<::network::mojom::blink::CSPViolation::DataView, ::network::mojom::blink::CSPViolationPtr>::Read(
::network::mojom::blink::CSPViolation::DataView input,
::network::mojom::blink::CSPViolationPtr* output) { … }
bool UnionTraits<::network::mojom::blink::AllowCSPFromHeaderValue::DataView, ::network::mojom::blink::AllowCSPFromHeaderValuePtr>::Read(
::network::mojom::blink::AllowCSPFromHeaderValue::DataView input,
::network::mojom::blink::AllowCSPFromHeaderValuePtr* output) { … }
}
namespace network::mojom::blink {
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif