chromium/extensions/browser/api/declarative_net_request/install_index_helper.cc

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

#include "extensions/browser/api/declarative_net_request/install_index_helper.h"

#include <iterator>
#include <utility>

#include "base/barrier_closure.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_number_conversions.h"
#include "base/time/time.h"
#include "base/values.h"
#include "extensions/browser/api/declarative_net_request/constants.h"
#include "extensions/browser/api/declarative_net_request/utils.h"
#include "extensions/browser/ruleset_parse_result.h"
#include "extensions/common/api/declarative_net_request.h"
#include "extensions/common/extension.h"
#include "extensions/common/manifest.h"

namespace extensions::declarative_net_request {

namespace {
dnr_api;

// A boolean that indicates if a ruleset should be ignored.
constexpr char kDNRIgnoreRulesetKey[] =;

// Key corresponding to which we store a ruleset's checksum for the Declarative
// Net Request API.
constexpr char kDNRChecksumKey[] =;

// Converts a single ruleset result into a Dict.
base::Value::Dict ConvertRulesetToDict(bool ignored,
                                       std::optional<int> checksum) {}

void SetRulesetDict(base::Value::Dict& dict,
                    RulesetID id,
                    base::Value::Dict ruleset) {}

// Combines indexing results from multiple FileBackedRulesetSources into a
// single InstallIndexHelper::Result.
RulesetParseResult CombineResults(
    std::vector<std::pair<const FileBackedRulesetSource*,
                          IndexAndPersistJSONRulesetResult>> results,
    bool log_histograms) {}

}  // namespace

// static
void InstallIndexHelper::IndexStaticRulesets(
    const Extension& extension,
    FileBackedRulesetSource::RulesetFilter ruleset_filter,
    uint8_t parse_flags,
    IndexCallback callback) {}

// static
RulesetParseResult InstallIndexHelper::IndexStaticRulesetsUnsafe(
    const Extension& extension,
    FileBackedRulesetSource::RulesetFilter ruleset_filter,
    uint8_t parse_flags) {}

InstallIndexHelper::InstallIndexHelper(
    std::vector<FileBackedRulesetSource> sources,
    IndexCallback callback)
    :{}

InstallIndexHelper::~InstallIndexHelper() = default;

void InstallIndexHelper::Start(uint8_t parse_flags) {}

void InstallIndexHelper::OnAllRulesetsIndexed() {}

// Callback invoked when indexing of a single ruleset is completed.
void InstallIndexHelper::OnRulesetIndexed(
    base::OnceClosure ruleset_done_closure,
    size_t source_index,
    IndexAndPersistJSONRulesetResult result) {}

}  // namespace extensions::declarative_net_request