#include "components/safe_browsing/content/common/file_type_policies.h"
#include "base/check_op.h"
#include "base/memory/singleton.h"
#include "base/metrics/histogram_functions.h"
#include "base/no_destructor.h"
#include "base/strings/string_util.h"
#include "components/grit/components_resources.h"
#include "components/safe_browsing/content/common/file_type_policies_policy_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "url/gurl.h"
namespace safe_browsing {
namespace policy {
ExtensionToPolicyMap;
ExtensionToPolicyMap& GetExtensionToPolicyMap() { … }
const DownloadFileType& GetOrCreatePolicyForExtensionOverrideNotDangerous(
const std::string& extension,
const DownloadFileType& base_policy) { … }
}
AutoLock;
struct FileTypePoliciesSingletonTrait
: public base::LeakySingletonTraits<FileTypePolicies> { … };
FileTypePolicies* FileTypePolicies::GetInstance() { … }
FileTypePolicies::FileTypePolicies() { … }
FileTypePolicies::~FileTypePolicies() = default;
std::string FileTypePolicies::ReadResourceBundle() { … }
void FileTypePolicies::RecordUpdateMetrics(UpdateResult result,
const std::string& src_name) { … }
void FileTypePolicies::PopulateFromResourceBundle() { … }
void FileTypePolicies::PopulateFromDynamicUpdate(const std::string& binary_pb) { … }
FileTypePolicies::UpdateResult FileTypePolicies::PopulateFromBinaryPb(
const std::string& binary_pb) { … }
void FileTypePolicies::SwapConfig(
std::unique_ptr<DownloadFileTypeConfig>& new_config) { … }
void FileTypePolicies::SwapConfigLocked(
std::unique_ptr<DownloadFileTypeConfig>& new_config) { … }
base::FilePath::StringType FileTypePolicies::GetFileExtension(
const base::FilePath& file) { … }
std::string FileTypePolicies::CanonicalizedExtension(
const base::FilePath& file) { … }
float FileTypePolicies::SampledPingProbability() const { … }
const DownloadFileType& FileTypePolicies::PolicyForExtension(
const std::string& ascii_ext,
const GURL& source_url,
const PrefService* prefs) const { … }
DownloadFileType FileTypePolicies::PolicyForFile(
const base::FilePath& file,
const GURL& source_url,
const PrefService* prefs) const { … }
DownloadFileType::PlatformSettings FileTypePolicies::SettingsForFile(
const base::FilePath& file,
const GURL& source_url,
const PrefService* prefs) const { … }
int64_t FileTypePolicies::UmaValueForFile(const base::FilePath& file) const { … }
bool FileTypePolicies::IsArchiveFile(const base::FilePath& file) const { … }
bool FileTypePolicies::IsAllowedToOpenAutomatically(
const base::FilePath& file) const { … }
DownloadFileType::PingSetting FileTypePolicies::PingSettingForFile(
const base::FilePath& file) const { … }
bool FileTypePolicies::IsCheckedBinaryFile(const base::FilePath& file) const { … }
DownloadFileType::DangerLevel FileTypePolicies::GetFileDangerLevel(
const base::FilePath& file,
const GURL& source_url,
const PrefService* prefs) const { … }
uint64_t FileTypePolicies::GetMaxFileSizeToAnalyze(
const std::string& ascii_ext) const { … }
uint64_t FileTypePolicies::GetMaxFileSizeToAnalyze(
const base::FilePath& file) const { … }
uint64_t FileTypePolicies::GetMaxArchivedBinariesToReport() const { … }
}