chromium/extensions/browser/api/declarative_net_request/global_rules_tracker.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/global_rules_tracker.h"

#include "extensions/browser/api/declarative_net_request/prefs_helper.h"
#include "extensions/browser/api/declarative_net_request/utils.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/api/declarative_net_request.h"
#include "extensions/common/extension.h"

namespace extensions::declarative_net_request {

namespace {

dnr_api;

// Returns the total allocated global rule count, as maintained in extension
// prefs from the set of installed extensions in the registry.
size_t CalculateAllocatedGlobalRuleCount(
    ExtensionPrefs* extension_prefs,
    const ExtensionRegistry* extension_registry) {}

// Returns the total allocated global rule count, as maintained in extension
// prefs from the set of installed extensions from prefs. This should be called
// only if the extension registry has not been populated yet (e.g. when a
// browser session has just started).
size_t CalculateInitialAllocatedGlobalRuleCount(
    ExtensionPrefs* extension_prefs) {}

}  // namespace

GlobalRulesTracker::GlobalRulesTracker(ExtensionPrefs* extension_prefs,
                                       ExtensionRegistry* extension_registry)
    :{}

GlobalRulesTracker::~GlobalRulesTracker() = default;

size_t GlobalRulesTracker::GetAllocatedGlobalRuleCountForTesting() const {}

bool GlobalRulesTracker::OnExtensionRuleCountUpdated(
    const ExtensionId& extension_id,
    size_t new_rule_count) {}

size_t GlobalRulesTracker::GetUnallocatedRuleCount() const {}

size_t GlobalRulesTracker::GetAvailableAllocation(
    const ExtensionId& extension_id) const {}

void GlobalRulesTracker::ClearExtensionAllocation(
    const ExtensionId& extension_id) {}

size_t GlobalRulesTracker::GetAllocationInPrefs(
    const ExtensionId& extension_id) const {}

}  // namespace extensions::declarative_net_request