#include "third_party/blink/renderer/platform/weborigin/security_origin.h"
#include <stdint.h>
#include <memory>
#include <string>
#include <utility>
#include "base/containers/contains.h"
#include "net/base/url_util.h"
#include "services/network/public/cpp/is_potentially_trustworthy.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/renderer/platform/blob/blob_url.h"
#include "third_party/blink/renderer/platform/blob/blob_url_null_origin_map.h"
#include "third_party/blink/renderer/platform/weborigin/known_ports.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/weborigin/origin_access_entry.h"
#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h"
#include "third_party/blink/renderer/platform/weborigin/security_policy.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
#include "third_party/blink/renderer/platform/wtf/text/string_builder.h"
#include "third_party/blink/renderer/platform/wtf/text/string_utf8_adaptor.h"
#include "third_party/blink/renderer/platform/wtf/text/wtf_string.h"
#include "third_party/blink/renderer/platform/wtf/wtf.h"
#include "url/scheme_host_port.h"
#include "url/url_canon.h"
#include "url/url_canon_ip.h"
#include "url/url_util.h"
namespace blink {
namespace {
const String& EnsureNonNull(const String& string) { … }
}
bool SecurityOrigin::ShouldUseInnerURL(const KURL& url) { … }
KURL SecurityOrigin::ExtractInnerURL(const KURL& url) { … }
static bool ShouldTreatAsOpaqueOrigin(const KURL& url) { … }
scoped_refptr<SecurityOrigin> SecurityOrigin::CreateInternal(const KURL& url) { … }
SecurityOrigin::SecurityOrigin(const String& protocol,
const String& host,
uint16_t port)
: … { … }
SecurityOrigin::SecurityOrigin(const url::Origin::Nonce& nonce,
const SecurityOrigin* precursor)
: … { … }
SecurityOrigin::SecurityOrigin(NewUniqueOpaque, const SecurityOrigin* precursor)
: … { … }
SecurityOrigin::SecurityOrigin(const SecurityOrigin* other,
ConstructIsolatedCopy)
: … { … }
SecurityOrigin::SecurityOrigin(const SecurityOrigin* other,
ConstructSameThreadCopy)
: … { … }
scoped_refptr<SecurityOrigin> SecurityOrigin::CreateWithReferenceOrigin(
const KURL& url,
const SecurityOrigin* reference_origin) { … }
scoped_refptr<SecurityOrigin> SecurityOrigin::Create(const KURL& url) { … }
scoped_refptr<SecurityOrigin> SecurityOrigin::CreateUniqueOpaque() { … }
scoped_refptr<SecurityOrigin> SecurityOrigin::CreateOpaque(
const url::Origin::Nonce& nonce,
const SecurityOrigin* precursor) { … }
scoped_refptr<SecurityOrigin> SecurityOrigin::CreateFromUrlOrigin(
const url::Origin& origin) { … }
url::Origin SecurityOrigin::ToUrlOrigin() const { … }
scoped_refptr<SecurityOrigin> SecurityOrigin::IsolatedCopy() const { … }
void SecurityOrigin::SetDomainFromDOM(const String& new_domain) { … }
String SecurityOrigin::RegistrableDomain() const { … }
const base::UnguessableToken* SecurityOrigin::GetNonceForSerialization() const { … }
bool SecurityOrigin::CanAccess(const SecurityOrigin* other,
AccessResultDomainDetail& detail) const { … }
bool SecurityOrigin::PassesFileCheck(const SecurityOrigin* other) const { … }
bool SecurityOrigin::CanRequest(const KURL& url) const { … }
bool SecurityOrigin::CanReadContent(const KURL& url) const { … }
bool SecurityOrigin::CanDisplay(const KURL& url) const { … }
bool SecurityOrigin::IsPotentiallyTrustworthy() const { … }
String SecurityOrigin::IsPotentiallyTrustworthyErrorMessage() { … }
void SecurityOrigin::GrantLoadLocalResources() { … }
void SecurityOrigin::GrantUniversalAccess() { … }
void SecurityOrigin::GrantCrossAgentClusterAccess() { … }
void SecurityOrigin::BlockLocalAccessFromLocalOrigin() { … }
bool SecurityOrigin::IsLocal() const { … }
bool SecurityOrigin::IsLocalhost() const { … }
String SecurityOrigin::ToString() const { … }
AtomicString SecurityOrigin::ToAtomicString() const { … }
String SecurityOrigin::ToRawString() const { … }
void SecurityOrigin::BuildRawString(StringBuilder& builder) const { … }
String SecurityOrigin::ToTokenForFastCheck() const { … }
scoped_refptr<SecurityOrigin> SecurityOrigin::CreateFromString(
const String& origin_string) { … }
scoped_refptr<SecurityOrigin> SecurityOrigin::CreateFromValidTuple(
const String& protocol,
const String& host,
uint16_t port) { … }
bool SecurityOrigin::IsSameOriginWith(const SecurityOrigin* other) const { … }
bool SecurityOrigin::AreSameOrigin(const KURL& a, const KURL& b) { … }
bool SecurityOrigin::IsSameOriginDomainWith(
const SecurityOrigin* other,
AccessResultDomainDetail& detail) const { … }
bool SecurityOrigin::IsSameSiteWith(const SecurityOrigin* other) const { … }
const KURL& SecurityOrigin::UrlWithUniqueOpaqueOrigin() { … }
std::unique_ptr<SecurityOrigin::PrivilegeData>
SecurityOrigin::CreatePrivilegeData() const { … }
void SecurityOrigin::TransferPrivilegesFrom(
std::unique_ptr<PrivilegeData> privilege_data) { … }
void SecurityOrigin::SetOpaqueOriginIsPotentiallyTrustworthy(
bool is_opaque_origin_potentially_trustworthy) { … }
scoped_refptr<SecurityOrigin> SecurityOrigin::DeriveNewOpaqueOrigin() const { … }
const SecurityOrigin* SecurityOrigin::GetOriginOrPrecursorOriginIfOpaque()
const { … }
String SecurityOrigin::CanonicalizeHost(const String& host, bool* success) { … }
scoped_refptr<SecurityOrigin> SecurityOrigin::GetOriginForAgentCluster(
const base::UnguessableToken& agent_cluster_id) { … }
bool SecurityOrigin::SerializesAsNull() const { … }
}