#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "url/origin.h"
#include <stdint.h>
#include <algorithm>
#include <ostream>
#include <string>
#include <string_view>
#include <tuple>
#include <utility>
#include "base/base64.h"
#include "base/check.h"
#include "base/check_op.h"
#include "base/containers/contains.h"
#include "base/containers/span.h"
#include "base/debug/crash_logging.h"
#include "base/pickle.h"
#include "base/strings/strcat.h"
#include "base/trace_event/base_tracing.h"
#include "base/trace_event/memory_usage_estimator.h"
#include "base/unguessable_token.h"
#include "url/gurl.h"
#include "url/scheme_host_port.h"
#include "url/url_constants.h"
#include "url/url_features.h"
#include "url/url_util.h"
namespace url {
Origin::Origin() : … { … }
Origin Origin::Create(const GURL& url) { … }
Origin Origin::Resolve(const GURL& url, const Origin& base_origin) { … }
Origin::Origin(const Origin&) = default;
Origin& Origin::operator=(const Origin&) = default;
Origin::Origin(Origin&&) noexcept = default;
Origin& Origin::operator=(Origin&&) noexcept = default;
Origin::~Origin() = default;
std::optional<Origin> Origin::UnsafelyCreateTupleOriginWithoutNormalization(
std::string_view scheme,
std::string_view host,
uint16_t port) { … }
std::optional<Origin> Origin::UnsafelyCreateOpaqueOriginWithoutNormalization(
std::string_view precursor_scheme,
std::string_view precursor_host,
uint16_t precursor_port,
const Origin::Nonce& nonce) { … }
Origin Origin::CreateFromNormalizedTuple(std::string scheme,
std::string host,
uint16_t port) { … }
Origin Origin::CreateOpaqueFromNormalizedPrecursorTuple(
std::string precursor_scheme,
std::string precursor_host,
uint16_t precursor_port,
const Origin::Nonce& nonce) { … }
std::string Origin::Serialize() const { … }
GURL Origin::GetURL() const { … }
const base::UnguessableToken* Origin::GetNonceForSerialization() const { … }
bool Origin::IsSameOriginWith(const Origin& other) const { … }
bool Origin::IsSameOriginWith(const GURL& url) const { … }
bool Origin::CanBeDerivedFrom(const GURL& url) const { … }
bool Origin::DomainIs(std::string_view canonical_domain) const { … }
bool Origin::operator<(const Origin& other) const { … }
Origin Origin::DeriveNewOpaqueOrigin() const { … }
const base::UnguessableToken* Origin::GetNonceForTesting() const { … }
std::string Origin::GetDebugString(bool include_nonce) const { … }
Origin::Origin(SchemeHostPort tuple) : … { … }
Origin::Origin(const Nonce& nonce, SchemeHostPort precursor)
: … { … }
std::optional<std::string> Origin::SerializeWithNonce() const { … }
std::optional<std::string> Origin::SerializeWithNonceAndInitIfNeeded() { … }
std::optional<std::string> Origin::SerializeWithNonceImpl() const { … }
std::optional<Origin> Origin::Deserialize(const std::string& value) { … }
void Origin::WriteIntoTrace(perfetto::TracedValue context) const { … }
size_t Origin::EstimateMemoryUsage() const { … }
std::ostream& operator<<(std::ostream& out, const url::Origin& origin) { … }
std::ostream& operator<<(std::ostream& out, const url::Origin::Nonce& nonce) { … }
bool IsSameOriginWith(const GURL& a, const GURL& b) { … }
Origin::Nonce::Nonce() = default;
Origin::Nonce::Nonce(const base::UnguessableToken& token) : … { … }
const base::UnguessableToken& Origin::Nonce::token() const { … }
const base::UnguessableToken& Origin::Nonce::raw_token() const { … }
Origin::Nonce::Nonce(const Origin::Nonce& other) : … { … }
Origin::Nonce& Origin::Nonce::operator=(const Origin::Nonce& other) { … }
Origin::Nonce::Nonce(Origin::Nonce&& other) noexcept : … { … }
Origin::Nonce& Origin::Nonce::operator=(Origin::Nonce&& other) noexcept { … }
bool Origin::Nonce::operator<(const Origin::Nonce& other) const { … }
bool Origin::Nonce::operator==(const Origin::Nonce& other) const { … }
bool Origin::Nonce::operator!=(const Origin::Nonce& other) const { … }
namespace debug {
ScopedOriginCrashKey::ScopedOriginCrashKey(
base::debug::CrashKeyString* crash_key,
const url::Origin* value)
: … { … }
ScopedOriginCrashKey::~ScopedOriginCrashKey() = default;
}
}