#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "components/content_settings/core/browser/content_settings_utils.h"
#include <stddef.h>
#include <vector>
#include "base/notreached.h"
#include "base/strings/string_split.h"
#include "base/values.h"
#include "build/build_config.h"
#include "components/content_settings/core/browser/content_settings_registry.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/content_settings/core/common/content_settings.h"
#include "components/content_settings/core/common/content_settings_types.h"
#include "components/content_settings/core/common/content_settings_utils.h"
#include "components/content_settings/core/common/features.h"
namespace {
const char kPatternSeparator[] = …;
struct ContentSettingsStringMapping { … };
const ContentSettingsStringMapping kContentSettingsStringMapping[] = …;
static_assert …;
const ContentSetting kContentSettingOrder[] = …;
static_assert …;
}
namespace content_settings {
std::string ContentSettingToString(ContentSetting setting) { … }
bool ContentSettingFromString(const std::string& name,
ContentSetting* setting) { … }
std::string CreatePatternString(
const ContentSettingsPattern& item_pattern,
const ContentSettingsPattern& top_level_frame_pattern) { … }
PatternPair ParsePatternString(const std::string& pattern_str) { … }
void GetRendererContentSettingRules(const HostContentSettingsMap* map,
RendererContentSettingRules* rules) { … }
bool IsMorePermissive(ContentSetting a, ContentSetting b) { … }
bool IsConstraintPersistent(const ContentSettingConstraints& constraints) { … }
bool CanTrackLastVisit(ContentSettingsType type) { … }
base::Time GetCoarseVisitedTime(base::Time time) { … }
base::TimeDelta GetCoarseVisitedTimePrecision() { … }
bool CanBeAutoRevoked(ContentSettingsType type,
ContentSetting setting,
bool is_one_time) { … }
bool CanBeAutoRevoked(ContentSettingsType type,
const base::Value& value,
bool is_one_time) { … }
bool IsChooserPermissionEligibleForAutoRevocation(ContentSettingsType type) { … }
bool IsGrantedByRelatedWebsiteSets(ContentSettingsType type,
const RuleMetaData& metadata) { … }
const std::vector<ContentSettingsType>& GetTypesWithTemporaryGrants() { … }
const std::vector<ContentSettingsType>& GetTypesWithTemporaryGrantsInHcsm() { … }
}