#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;
size_t CalculateAllocatedGlobalRuleCount(
ExtensionPrefs* extension_prefs,
const ExtensionRegistry* extension_registry) { … }
size_t CalculateInitialAllocatedGlobalRuleCount(
ExtensionPrefs* extension_prefs) { … }
}
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 { … }
}