chromium/components/policy/core/common/cloud/user_cloud_policy_store.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "components/policy/core/common/cloud/user_cloud_policy_store.h"

#include <stddef.h>

#include <utility>

#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/sequence_checker.h"
#include "base/task/sequenced_task_runner.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "components/policy/proto/cloud_policy.pb.h"
#include "components/policy/proto/device_management_backend.pb.h"
#include "components/policy/proto/policy_signing_key.pb.h"
#include "google_apis/gaia/gaia_auth_util.h"

em;

namespace policy {

namespace {

// Subdirectory in the user's profile for storing user policies.
const base::FilePath::CharType kPolicyDir[] =);
// File in the above directory for storing user policy data.
const base::FilePath::CharType kPolicyCacheFile[] =);

// File in the above directory for storing policy signing key data.
const base::FilePath::CharType kKeyCacheFile[] =);

// Maximum policy and key size that will be loaded, in bytes.
const size_t kPolicySizeLimit =;
const size_t kKeySizeLimit =;

bool WriteStringToFile(const base::FilePath path, const std::string& data) {}

// Stores policy to the backing file (must be called via a task on
// the background thread).
void StorePolicyToDiskOnBackgroundThread(
    const base::FilePath& policy_path,
    const base::FilePath& key_path,
    const em::PolicyFetchResponse& policy) {}

}  // namespace

DesktopCloudPolicyStore::DesktopCloudPolicyStore(
    const base::FilePath& policy_path,
    const base::FilePath& key_path,
    PolicyLoadFilter policy_load_filter,
    scoped_refptr<base::SequencedTaskRunner> background_task_runner,
    PolicyScope policy_scope)
    :{}

DesktopCloudPolicyStore::~DesktopCloudPolicyStore() {}

void DesktopCloudPolicyStore::LoadImmediately() {}

void DesktopCloudPolicyStore::Clear() {}

void DesktopCloudPolicyStore::Load() {}

// static
PolicyLoadResult DesktopCloudPolicyStore::LoadAndFilterPolicyFromDisk(
    const base::FilePath& policy_path,
    const base::FilePath& key_path,
    const PolicyLoadFilter& policy_load_filter) {}

// static
PolicyLoadResult DesktopCloudPolicyStore::LoadPolicyFromDisk(
    const base::FilePath& policy_path,
    const base::FilePath& key_path) {}

void DesktopCloudPolicyStore::OnPolicyLoaded(PolicyLoadResult result) {}

void DesktopCloudPolicyStore::ValidateKeyAndSignature(
    UserCloudPolicyValidator* validator,
    const em::PolicySigningKey* cached_key,
    const std::string& owning_domain) {}

void DesktopCloudPolicyStore::InstallLoadedPolicyAfterValidation(
    bool doing_key_rotation,
    const std::string& signing_key,
    UserCloudPolicyValidator* validator) {}

void DesktopCloudPolicyStore::Store(const em::PolicyFetchResponse& policy) {}

void DesktopCloudPolicyStore::ResetPolicyKey() {}

void DesktopCloudPolicyStore::OnPolicyToStoreValidated(
    UserCloudPolicyValidator* validator) {}

UserCloudPolicyStore::UserCloudPolicyStore(
    const base::FilePath& policy_path,
    const base::FilePath& key_path,
    scoped_refptr<base::SequencedTaskRunner> background_task_runner)
    :{}

UserCloudPolicyStore::~UserCloudPolicyStore() {}

// static
std::unique_ptr<UserCloudPolicyStore> UserCloudPolicyStore::Create(
    const base::FilePath& profile_path,
    scoped_refptr<base::SequencedTaskRunner> background_task_runner) {}

void UserCloudPolicyStore::SetSigninAccountId(const AccountId& account_id) {}

void UserCloudPolicyStore::Validate(
    std::unique_ptr<em::PolicyFetchResponse> policy,
    std::unique_ptr<em::PolicySigningKey> cached_key,
    UserCloudPolicyValidator::CompletionCallback callback) {}

}  // namespace policy