chromium/third_party/blink/renderer/platform/storage/blink_storage_key.cc

// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/platform/storage/blink_storage_key.h"

#include <ostream>

#include "base/types/optional_util.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "third_party/blink/public/mojom/storage_key/ancestor_chain_bit.mojom-blink.h"
#include "third_party/blink/renderer/platform/network/blink_schemeful_site.h"

namespace blink {

BlinkStorageKey::BlinkStorageKey()
    :{}

BlinkStorageKey::BlinkStorageKey(
    scoped_refptr<const SecurityOrigin> origin,
    const BlinkSchemefulSite& top_level_site,
    const base::UnguessableToken* nonce,
    mojom::blink::AncestorChainBit ancestor_chain_bit)
    :{}

// static
BlinkStorageKey BlinkStorageKey::CreateFirstParty(
    scoped_refptr<const SecurityOrigin> origin) {}

// static
// The AncestorChainBit is not applicable to StorageKeys with a non-empty
// nonce, so they are initialized to be kCrossSite.
BlinkStorageKey BlinkStorageKey::CreateWithNonce(
    scoped_refptr<const SecurityOrigin> origin,
    const base::UnguessableToken& nonce) {}

// static
BlinkStorageKey BlinkStorageKey::Create(
    scoped_refptr<const SecurityOrigin> origin,
    const BlinkSchemefulSite& top_level_site,
    mojom::blink::AncestorChainBit ancestor_chain_bit) {}

// static
BlinkStorageKey BlinkStorageKey::CreateFromStringForTesting(
    const WTF::String& origin) {}

BlinkStorageKey::BlinkStorageKey(const StorageKey& storage_key)
    :{}

operator StorageKey()

// static
// Keep consistent with StorageKey::FromWire().
bool BlinkStorageKey::FromWire(
    scoped_refptr<const SecurityOrigin> origin,
    const BlinkSchemefulSite& top_level_site,
    const BlinkSchemefulSite& top_level_site_if_third_party_enabled,
    const std::optional<base::UnguessableToken>& nonce,
    mojom::blink::AncestorChainBit ancestor_chain_bit,
    mojom::blink::AncestorChainBit ancestor_chain_bit_if_third_party_enabled,
    BlinkStorageKey& out) {}

BlinkStorageKey BlinkStorageKey::WithOrigin(
    scoped_refptr<const SecurityOrigin> origin) const {}

String BlinkStorageKey::ToDebugString() const {}

bool BlinkStorageKey::ExactMatchForTesting(const BlinkStorageKey& other) const {}

bool operator==(const BlinkStorageKey& lhs, const BlinkStorageKey& rhs) {}

bool operator!=(const BlinkStorageKey& lhs, const BlinkStorageKey& rhs) {}

std::ostream& operator<<(std::ostream& ostream, const BlinkStorageKey& key) {}

bool BlinkStorageKey::IsValid() const {}

}  // namespace blink