#include "chrome/browser/permissions/crowd_deny_preload_data.h"
#include <string>
#include <utility>
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/location.h"
#include "base/no_destructor.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "components/permissions/permission_uma_util.h"
#include "net/base/registry_controlled_domains/registry_controlled_domain.h"
#include "url/gurl.h"
#include "url/origin.h"
#include "url/url_constants.h"
namespace {
DomainToReputationMap;
DomainToReputationMap LoadAndParseAndIndexPreloadDataFromDisk(
const base::FilePath& proto_path) { … }
PendingOrigin::PendingOrigin(
url::Origin origin,
base::OnceCallback<void(const chrome_browser_crowd_deny::SiteReputation*)>
callback)
: … { … }
PendingOrigin::~PendingOrigin() = default;
}
CrowdDenyPreloadData::CrowdDenyPreloadData() { … }
CrowdDenyPreloadData::~CrowdDenyPreloadData() = default;
CrowdDenyPreloadData* CrowdDenyPreloadData::GetInstance() { … }
void CrowdDenyPreloadData::GetReputationDataForSiteAsync(
const url::Origin& origin,
SiteReputationCallback callback) { … }
void CrowdDenyPreloadData::LoadFromDisk(const base::FilePath& proto_path,
const base::Version& version) { … }
const CrowdDenyPreloadData::SiteReputation*
CrowdDenyPreloadData::GetReputationDataForSite(
const url::Origin& origin) const { … }
void CrowdDenyPreloadData::SetSiteReputations(DomainToReputationMap map) { … }
void CrowdDenyPreloadData::CheckOriginsPendingVerification() { … }
CrowdDenyPreloadData::DomainToReputationMap
CrowdDenyPreloadData::TakeSiteReputations() { … }
namespace testing {
ScopedCrowdDenyPreloadDataOverride::ScopedCrowdDenyPreloadDataOverride() { … }
ScopedCrowdDenyPreloadDataOverride::~ScopedCrowdDenyPreloadDataOverride() { … }
void ScopedCrowdDenyPreloadDataOverride::SetOriginReputation(
const url::Origin& origin,
SiteReputation site_reputation) { … }
void ScopedCrowdDenyPreloadDataOverride::ClearAllReputations() { … }
}