chromium/components/os_crypt/async/browser/os_crypt_async.cc

// Copyright 2023 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/os_crypt/async/browser/os_crypt_async.h"

#include <memory>
#include <vector>

#include "base/callback_list.h"
#include "base/check_op.h"
#include "base/dcheck_is_on.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/ranges/algorithm.h"
#include "base/sequence_checker.h"
#include "components/os_crypt/async/browser/key_provider.h"
#include "components/os_crypt/async/common/encryptor.h"

namespace os_crypt_async {

namespace {

// Sorts `input_providers` by the `Precedence`, from lowest (beginning of
// vector) to highest (at the end), then returns a new vector that contains just
// the KeyProvider unique_ptrs in that new order.
std::vector<std::unique_ptr<KeyProvider>> SortProviders(
    std::vector<std::pair<OSCryptAsync::Precedence,
                          std::unique_ptr<KeyProvider>>> input_providers) {}

}  // namespace

OSCryptAsync::OSCryptAsync(
    std::vector<std::pair<Precedence, std::unique_ptr<KeyProvider>>> providers)
    :{}

OSCryptAsync::~OSCryptAsync() = default;

// CallbackHelper is needed so the sequence checker member can be accessed in
// the callback, which it can't from a lambda without breaking the
// sequence_checker abstraction.
void OSCryptAsync::CallbackHelper(InitCallback callback,
                                  Encryptor::Option option) const {}

void OSCryptAsync::HandleKey(ProviderIterator current,
                             const std::string& tag,
                             std::optional<Encryptor::Key> key) {}

base::CallbackListSubscription OSCryptAsync::GetInstance(
    InitCallback callback) {}

base::CallbackListSubscription OSCryptAsync::GetInstance(
    InitCallback callback,
    Encryptor::Option option) {}

}  // namespace os_crypt_async