#include "components/policy/core/common/cloud/machine_level_user_cloud_policy_store.h"
#include <utility>
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/task/sequenced_task_runner.h"
#include "build/build_config.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "components/policy/core/common/cloud/cloud_policy_util.h"
#include "components/policy/core/common/cloud/dm_token.h"
#include "components/policy/core/common/cloud/user_cloud_policy_store.h"
#include "components/policy/core/common/policy_logger.h"
#include "components/policy/proto/device_management_backend.pb.h"
em;
namespace policy {
namespace {
const base::FilePath::CharType kPolicyCache[] = …);
const base::FilePath::CharType kKeyCache[] = …);
constexpr base::FilePath::StringPieceType kExternalPolicyCache = …);
constexpr base::FilePath::StringPieceType kExternalPolicyInfo = …);
}
MachineLevelUserCloudPolicyStore::MachineLevelUserCloudPolicyStore(
const DMToken& machine_dm_token,
const std::string& machine_client_id,
const base::FilePath& external_policy_path,
const base::FilePath& external_policy_info_path,
const base::FilePath& policy_path,
const base::FilePath& key_path,
scoped_refptr<base::SequencedTaskRunner> background_task_runner)
: … { … }
MachineLevelUserCloudPolicyStore::~MachineLevelUserCloudPolicyStore() { … }
std::unique_ptr<MachineLevelUserCloudPolicyStore>
MachineLevelUserCloudPolicyStore::Create(
const DMToken& machine_dm_token,
const std::string& machine_client_id,
const base::FilePath& external_policy_dir,
const base::FilePath& policy_dir,
scoped_refptr<base::SequencedTaskRunner> background_task_runner) { … }
bool IsResultKeyEqual(const PolicyLoadResult& default_result,
const PolicyLoadResult& external_result) { … }
void MachineLevelUserCloudPolicyStore::LoadImmediately() { … }
void MachineLevelUserCloudPolicyStore::Load() { … }
PolicyLoadResult
MachineLevelUserCloudPolicyStore::MaybeUseExternalCachedPolicies(
const base::FilePath& policy_cache_path,
const base::FilePath& policy_info_path,
PolicyLoadResult default_cached_policy_load_result) { … }
PolicyLoadResult MachineLevelUserCloudPolicyStore::LoadExternalCachedPolicies(
const base::FilePath& policy_cache_path,
const base::FilePath& policy_info_path) { … }
std::unique_ptr<UserCloudPolicyValidator>
MachineLevelUserCloudPolicyStore::CreateValidator(
std::unique_ptr<enterprise_management::PolicyFetchResponse>
policy_fetch_response,
CloudPolicyValidatorBase::ValidateTimestampOption option) { … }
void MachineLevelUserCloudPolicyStore::SetupRegistration(
const DMToken& machine_dm_token,
const std::string& machine_client_id) { … }
void MachineLevelUserCloudPolicyStore::InitWithoutToken() { … }
void MachineLevelUserCloudPolicyStore::Validate(
std::unique_ptr<enterprise_management::PolicyFetchResponse> policy,
std::unique_ptr<enterprise_management::PolicySigningKey> key,
UserCloudPolicyValidator::CompletionCallback callback) { … }
}