chromium/content/browser/browsing_data/browsing_data_filter_builder_impl.cc

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

#include "content/browser/browsing_data/browsing_data_filter_builder_impl.h"

#include <string>
#include <vector>

#include "base/containers/contains.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/notreached.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "services/network/public/mojom/clear_data_filter.mojom.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
#include "url/origin.h"

GetDomainAndRegistry;
INCLUDE_PRIVATE_REGISTRIES;

OriginMatchingMode;

namespace content {

namespace {

// Whether this is a subdomain of a registrable domain.
bool IsSubdomainOfARegistrableDomain(const std::string& domain) {}

// Note that for every domain, exactly one of the following holds:
// 1. GetDomainAndRegistry(domain, _) == ""        - e.g. localhost, 127.0.0.1
// 2. GetDomainAndRegistry(domain, _) == domain    - e.g. google.com
// 3. IsSubdomainOfARegistrableDomain(domain)      - e.g. www.google.com
// Types 1 and 2 are supported by RegistrableDomainFilterBuilder. Type 3 is not.

// True if the domain of `url` is in the deletelist, or isn't in the
// preservelist. The deletelist or preservelist is represented as `origins`,
// `registerable_domains`, and `mode`.
bool MatchesStorageKey(const std::set<url::Origin>& origins,
                       const std::set<std::string>& registerable_domains,
                       BrowsingDataFilterBuilder::Mode mode,
                       BrowsingDataFilterBuilder::OriginMatchingMode match_mode,
                       const blink::StorageKey& storage_key) {}

bool MatchesURL(const std::set<url::Origin>& origins,
                const std::set<std::string>& registerable_domains,
                BrowsingDataFilterBuilder::Mode mode,
                BrowsingDataFilterBuilder::OriginMatchingMode origin_mode,
                bool partitioned_cookies_only,
                const GURL& url) {}

// True if none of the supplied domains matches this plugin's |site| and we're a
// preservelist, or one of them does and we're a deletelist. The deletelist or
// preservelist is represented by |domains_and_ips| and |mode|.
bool MatchesPluginSiteForRegisterableDomainsAndIPs(
    const std::set<std::string>& domains_and_ips,
    BrowsingDataFilterBuilder::Mode mode,
    const std::string& site) {}

template <typename T>
base::RepeatingCallback<bool(const T&)> NotReachedFilter() {}

bool StorageKeyInCookiePartitionKeyCollection(
    const blink::StorageKey& storage_key,
    const net::CookiePartitionKeyCollection& cookie_partition_key_collection) {}

}  // namespace

// static
std::unique_ptr<BrowsingDataFilterBuilder>
BrowsingDataFilterBuilder::Create(Mode mode) {}

// static
std::unique_ptr<BrowsingDataFilterBuilder> BrowsingDataFilterBuilder::Create(
    Mode mode,
    OriginMatchingMode origin_mode) {}

// static
base::RepeatingCallback<bool(const GURL&)>
BrowsingDataFilterBuilder::BuildNoopFilter() {}

BrowsingDataFilterBuilderImpl::BrowsingDataFilterBuilderImpl(Mode mode)
    :{}

BrowsingDataFilterBuilderImpl::BrowsingDataFilterBuilderImpl(
    Mode mode,
    OriginMatchingMode origin_mode)
    :{}

BrowsingDataFilterBuilderImpl::~BrowsingDataFilterBuilderImpl() {}

void BrowsingDataFilterBuilderImpl::AddOrigin(const url::Origin& origin) {}

void BrowsingDataFilterBuilderImpl::AddRegisterableDomain(
    const std::string& domain) {}

void BrowsingDataFilterBuilderImpl::SetCookiePartitionKeyCollection(
    const net::CookiePartitionKeyCollection& cookie_partition_key_collection) {}

void BrowsingDataFilterBuilderImpl::SetStorageKey(
    const std::optional<blink::StorageKey>& storage_key) {}

bool BrowsingDataFilterBuilderImpl::HasStorageKey() const {}

bool BrowsingDataFilterBuilderImpl::MatchesWithSavedStorageKey(
    const blink::StorageKey& other_key) const {}

bool BrowsingDataFilterBuilderImpl::MatchesAllOriginsAndDomains() {}

bool BrowsingDataFilterBuilderImpl::MatchesMostOriginsAndDomains() {}

bool BrowsingDataFilterBuilderImpl::MatchesNothing() {}

void BrowsingDataFilterBuilderImpl::SetPartitionedCookiesOnly(bool value) {}

bool BrowsingDataFilterBuilderImpl::PartitionedCookiesOnly() const {}

void BrowsingDataFilterBuilderImpl::SetStoragePartitionConfig(
    const StoragePartitionConfig& storage_partition_config) {}

std::optional<StoragePartitionConfig>
BrowsingDataFilterBuilderImpl::GetStoragePartitionConfig() {}

base::RepeatingCallback<bool(const GURL&)>
BrowsingDataFilterBuilderImpl::BuildUrlFilter() {}

content::StoragePartition::StorageKeyMatcherFunction
BrowsingDataFilterBuilderImpl::BuildStorageKeyFilter() {}

network::mojom::ClearDataFilterPtr
BrowsingDataFilterBuilderImpl::BuildNetworkServiceFilter() {}

network::mojom::CookieDeletionFilterPtr
BrowsingDataFilterBuilderImpl::BuildCookieDeletionFilter() {}

base::RepeatingCallback<bool(const std::string& site)>
BrowsingDataFilterBuilderImpl::BuildPluginFilter() {}

BrowsingDataFilterBuilderImpl::Mode BrowsingDataFilterBuilderImpl::GetMode() {}

BrowsingDataFilterBuilderImpl::OriginMatchingMode
BrowsingDataFilterBuilderImpl::GetOriginModeForTesting() const {}

const std::set<url::Origin>& BrowsingDataFilterBuilderImpl::GetOrigins() const {}

const std::set<std::string>&
BrowsingDataFilterBuilderImpl::GetRegisterableDomains() const {}

const net::CookiePartitionKeyCollection&
BrowsingDataFilterBuilderImpl::GetCookiePartitionKeyCollectionForTesting()
    const {}
std::unique_ptr<BrowsingDataFilterBuilder>
BrowsingDataFilterBuilderImpl::Copy() {}

bool BrowsingDataFilterBuilderImpl::IsEqual(
    const BrowsingDataFilterBuilder& other) const {}

}  // namespace content