#include "extensions/renderer/isolated_world_manager.h"
#include <map>
#include <string>
#include "base/check.h"
#include "base/no_destructor.h"
#include "base/ranges/algorithm.h"
#include "extensions/common/mojom/execution_world.mojom.h"
#include "extensions/renderer/extensions_renderer_client.h"
#include "extensions/renderer/injection_host.h"
#include "third_party/blink/public/platform/web_isolated_world_info.h"
#include "third_party/blink/public/platform/web_security_origin.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/platform/web_url.h"
namespace extensions {
IsolatedWorldManager::IsolatedWorldInfo::IsolatedWorldInfo() = default;
IsolatedWorldManager::IsolatedWorldInfo::~IsolatedWorldInfo() = default;
IsolatedWorldManager::IsolatedWorldInfo::IsolatedWorldInfo(
IsolatedWorldInfo&&) = default;
IsolatedWorldManager::PendingWorldInfo::PendingWorldInfo() = default;
IsolatedWorldManager::PendingWorldInfo::~PendingWorldInfo() = default;
IsolatedWorldManager::PendingWorldInfo::PendingWorldInfo(PendingWorldInfo&&) =
default;
IsolatedWorldManager::IsolatedWorldManager() = default;
IsolatedWorldManager::~IsolatedWorldManager() = default;
IsolatedWorldManager& IsolatedWorldManager::GetInstance() { … }
std::string IsolatedWorldManager::GetHostIdForIsolatedWorld(int world_id) { … }
std::optional<mojom::ExecutionWorld>
IsolatedWorldManager::GetExecutionWorldForIsolatedWorld(int world_id) { … }
void IsolatedWorldManager::RemoveIsolatedWorlds(const std::string& host_id) { … }
void IsolatedWorldManager::SetUserScriptWorldProperties(
const std::string& host_id,
const std::optional<std::string>& world_id,
std::optional<std::string> csp,
bool enable_messaging) { … }
void IsolatedWorldManager::ClearUserScriptWorldProperties(
const std::string& host_id,
const std::optional<std::string>& world_id) { … }
bool IsolatedWorldManager::IsMessagingEnabledInUserScriptWorld(
int blink_world_id) { … }
int IsolatedWorldManager::GetOrCreateIsolatedWorldForHost(
const InjectionHost& injection_host,
mojom::ExecutionWorld execution_world,
const std::optional<std::string>& world_id) { … }
bool IsolatedWorldManager::IsExtensionIsolatedWorld(int blink_world_id) { … }
IsolatedWorldManager::IsolatedWorldInfo*
IsolatedWorldManager::FindIsolatedWorldInfo(
const std::string& host_id,
mojom::ExecutionWorld execution_world,
const std::optional<std::string>& world_id) { … }
IsolatedWorldManager::PendingWorldInfo*
IsolatedWorldManager::FindPendingWorldInfo(
const std::string& host_id,
const std::optional<std::string>& world_id) { … }
void IsolatedWorldManager::UpdateBlinkIsolatedWorldInfo(
int world_id,
const IsolatedWorldInfo& world_info) { … }
}