#include "components/content_settings/core/common/host_indexed_content_settings.h"
#include <cstddef>
#include <map>
#include <memory>
#include <string>
#include <string_view>
#include <vector>
#include "base/check_op.h"
#include "base/feature_list.h"
#include "base/notreached.h"
#include "base/time/clock.h"
#include "base/time/default_clock.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_metadata.h"
#include "components/content_settings/core/common/content_settings_pattern.h"
#include "components/content_settings/core/common/content_settings_rules.h"
#include "components/content_settings/core/common/content_settings_utils.h"
#include "components/content_settings/core/common/cookie_settings_base.h"
#include "components/content_settings/core/common/features.h"
namespace content_settings {
namespace {
bool InsertValue(Rules& rules,
const ContentSettingsPattern& primary_pattern,
const ContentSettingsPattern& secondary_pattern,
base::Value value,
const RuleMetaData& metadata) { … }
bool EraseValue(Rules& rules,
const ContentSettingsPattern& primary_pattern,
const ContentSettingsPattern& secondary_pattern) { … }
bool EraseValue(HostIndexedContentSettings::HostToContentSettings& index,
const std::string& key,
const ContentSettingsPattern& primary_pattern,
const ContentSettingsPattern& secondary_pattern) { … }
const RuleEntry* FindContentSetting(const GURL& primary_url,
const GURL& secondary_url,
const Rules& settings,
base::Clock* clock) { … }
const RuleEntry* FindInHostToContentSettings(
const GURL& primary_url,
const GURL& secondary_url,
const HostIndexedContentSettings::HostToContentSettings&
indexed_content_setting,
std::string_view host,
base::Clock* clock) { … }
}
HostIndexedContentSettings::Iterator::Iterator(
const HostIndexedContentSettings& index,
bool begin)
: … { … }
HostIndexedContentSettings::Iterator::Iterator(const Iterator& other)
: … { … }
HostIndexedContentSettings::Iterator::Iterator(Iterator&& other)
: … { … }
HostIndexedContentSettings::Iterator::~Iterator() { … }
HostIndexedContentSettings::Iterator&
HostIndexedContentSettings::Iterator::operator++() { … }
HostIndexedContentSettings::Iterator
HostIndexedContentSettings::Iterator::operator++(int) { … }
void HostIndexedContentSettings::Iterator::SetStage(Stage stage) { … }
HostIndexedContentSettings::HostIndexedContentSettings()
: … { … }
HostIndexedContentSettings::HostIndexedContentSettings(base::Clock* clock)
: … { … }
HostIndexedContentSettings::HostIndexedContentSettings(ProviderType source,
bool off_the_record)
: … { … }
HostIndexedContentSettings::HostIndexedContentSettings(
HostIndexedContentSettings&& other) = default;
HostIndexedContentSettings& HostIndexedContentSettings::operator=(
HostIndexedContentSettings&&) = default;
std::vector<HostIndexedContentSettings> HostIndexedContentSettings::Create(
const ContentSettingsForOneType& settings) { … }
HostIndexedContentSettings::~HostIndexedContentSettings() = default;
HostIndexedContentSettings::Iterator HostIndexedContentSettings::begin() const { … }
HostIndexedContentSettings::Iterator HostIndexedContentSettings::end() const { … }
const RuleEntry* HostIndexedContentSettings::Find(
const GURL& primary_url,
const GURL& secondary_url) const { … }
bool HostIndexedContentSettings::SetValue(
const ContentSettingsPattern& primary_pattern,
const ContentSettingsPattern& secondary_pattern,
base::Value value,
const RuleMetaData& metadata) { … }
bool HostIndexedContentSettings::DeleteValue(
const ContentSettingsPattern& primary_pattern,
const ContentSettingsPattern& secondary_pattern) { … }
void HostIndexedContentSettings::Clear() { … }
size_t HostIndexedContentSettings::size() const { … }
bool HostIndexedContentSettings::empty() const { … }
void HostIndexedContentSettings::SetClockForTesting(base::Clock* clock) { … }
}