#include "extensions/common/features/feature_provider.h"
#include <map>
#include <memory>
#include <string_view>
#include "base/containers/map_util.h"
#include "base/debug/alias.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/trace_event/trace_event.h"
#include "extensions/common/extensions_client.h"
#include "extensions/common/features/feature.h"
namespace extensions {
namespace {
#define CRASH_WITH_MINIDUMP(message) …
class FeatureProviderStatic { … };
base::LazyInstance<FeatureProviderStatic>::Leaky g_feature_provider_static = …;
const Feature* GetFeatureFromProviderByName(const std::string& provider_name,
const std::string& feature_name) { … }
}
FeatureProvider::FeatureProvider() = default;
FeatureProvider::~FeatureProvider() = default;
const FeatureProvider* FeatureProvider::GetByName(const std::string& name) { … }
const FeatureProvider* FeatureProvider::GetAPIFeatures() { … }
const FeatureProvider* FeatureProvider::GetManifestFeatures() { … }
const FeatureProvider* FeatureProvider::GetPermissionFeatures() { … }
const FeatureProvider* FeatureProvider::GetBehaviorFeatures() { … }
const Feature* FeatureProvider::GetAPIFeature(const std::string& name) { … }
const Feature* FeatureProvider::GetManifestFeature(const std::string& name) { … }
const Feature* FeatureProvider::GetPermissionFeature(const std::string& name) { … }
const Feature* FeatureProvider::GetBehaviorFeature(const std::string& name) { … }
const Feature* FeatureProvider::GetFeature(const std::string& name) const { … }
const Feature* FeatureProvider::GetParent(const Feature& feature) const { … }
std::vector<const Feature*> FeatureProvider::GetChildren(
const Feature& parent) const { … }
const FeatureMap& FeatureProvider::GetAllFeatures() const { … }
void FeatureProvider::AddFeature(std::string_view name,
std::unique_ptr<Feature> feature) { … }
void FeatureProvider::AddFeature(std::string_view name, Feature* feature) { … }
}