#include "extensions/common/manifest_handlers/shared_module_info.h"
#include <stddef.h>
#include <iterator>
#include <memory>
#include <utility>
#include "base/containers/contains.h"
#include "base/lazy_instance.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/version.h"
#include "components/crx_file/id_util.h"
#include "extensions/common/api/shared_module.h"
#include "extensions/common/constants.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/permissions/permission_set.h"
#include "extensions/common/permissions/permissions_data.h"
namespace extensions {
keys;
values;
errors;
namespace {
const char kSharedModule[] = …;
const char kAllowlist[] = …;
ManifestKeys;
static base::LazyInstance<SharedModuleInfo>::DestructorAtExit
g_empty_shared_module_info = …;
const SharedModuleInfo& GetSharedModuleInfo(const Extension* extension) { … }
}
SharedModuleInfo::SharedModuleInfo() { … }
SharedModuleInfo::~SharedModuleInfo() { … }
void SharedModuleInfo::ParseImportedPath(const std::string& path,
ExtensionId* import_id,
std::string* import_relative_path) { … }
bool SharedModuleInfo::IsImportedPath(const std::string& path) { … }
bool SharedModuleInfo::IsSharedModule(const Extension* extension) { … }
bool SharedModuleInfo::IsExportAllowedByAllowlist(const Extension* extension,
const ExtensionId& other_id) { … }
bool SharedModuleInfo::ImportsExtensionById(const Extension* extension,
const ExtensionId& other_id) { … }
bool SharedModuleInfo::ImportsModules(const Extension* extension) { … }
const std::vector<SharedModuleInfo::ImportInfo>& SharedModuleInfo::GetImports(
const Extension* extension) { … }
SharedModuleHandler::SharedModuleHandler() = default;
SharedModuleHandler::~SharedModuleHandler() = default;
bool SharedModuleHandler::Parse(Extension* extension, std::u16string* error) { … }
bool SharedModuleHandler::Validate(
const Extension* extension,
std::string* error,
std::vector<InstallWarning>* warnings) const { … }
base::span<const char* const> SharedModuleHandler::Keys() const { … }
}