#include "third_party/blink/renderer/platform/bindings/dom_wrapper_world.h"
#include <memory>
#include <optional>
#include <utility>
#include "base/notreached.h"
#include "third_party/abseil-cpp/absl/base/attributes.h"
#include "third_party/blink/public/platform/web_isolated_world_info.h"
#include "third_party/blink/renderer/platform/bindings/dom_data_store.h"
#include "third_party/blink/renderer/platform/bindings/v8_object_data_store.h"
#include "third_party/blink/renderer/platform/bindings/v8_per_isolate_data.h"
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"
#include "third_party/blink/renderer/platform/wtf/hash_map.h"
#include "third_party/blink/renderer/platform/wtf/hash_traits.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
#include "third_party/blink/renderer/platform/wtf/text/string_hash.h"
#include "third_party/blink/renderer/platform/wtf/thread_specific.h"
namespace blink {
namespace {
constexpr bool IsMainWorldId(int32_t world_id) { … }
static_assert …;
WorldMap;
static WorldMap& GetWorldMap() { … }
}
unsigned DOMWrapperWorld::number_of_non_main_worlds_in_main_thread_ = …;
DOMWrapperWorld* DOMWrapperWorld::Create(v8::Isolate* isolate,
WorldType world_type,
bool is_default_world_of_isolate) { … }
DOMWrapperWorld* DOMWrapperWorld::EnsureIsolatedWorld(v8::Isolate* isolate,
int32_t world_id) { … }
DOMWrapperWorld::DOMWrapperWorld(PassKey,
v8::Isolate* isolate,
WorldType world_type,
int32_t world_id,
bool is_default_world_of_isolate)
: … { … }
DOMWrapperWorld& DOMWrapperWorld::MainWorld(v8::Isolate* isolate) { … }
void DOMWrapperWorld::AllWorldsInIsolate(
v8::Isolate* isolate,
HeapVector<Member<DOMWrapperWorld>>& worlds) { … }
DOMWrapperWorld::~DOMWrapperWorld() { … }
void DOMWrapperWorld::Dispose() { … }
IsolatedWorldSecurityOriginMap;
static IsolatedWorldSecurityOriginMap& IsolatedWorldSecurityOrigins() { … }
static scoped_refptr<SecurityOrigin> GetIsolatedWorldSecurityOrigin(
int32_t world_id,
const base::UnguessableToken& cluster_id) { … }
scoped_refptr<SecurityOrigin> DOMWrapperWorld::IsolatedWorldSecurityOrigin(
const base::UnguessableToken& cluster_id) { … }
scoped_refptr<const SecurityOrigin>
DOMWrapperWorld::IsolatedWorldSecurityOrigin(
const base::UnguessableToken& cluster_id) const { … }
void DOMWrapperWorld::SetIsolatedWorldSecurityOrigin(
int32_t world_id,
scoped_refptr<SecurityOrigin> security_origin) { … }
IsolatedWorldStableIdMap;
static IsolatedWorldStableIdMap& IsolatedWorldStableIds() { … }
String DOMWrapperWorld::NonMainWorldStableId() const { … }
void DOMWrapperWorld::SetNonMainWorldStableId(int32_t world_id,
const String& stable_id) { … }
IsolatedWorldHumanReadableNameMap;
static IsolatedWorldHumanReadableNameMap& IsolatedWorldHumanReadableNames() { … }
String DOMWrapperWorld::NonMainWorldHumanReadableName() const { … }
void DOMWrapperWorld::SetNonMainWorldHumanReadableName(
int32_t world_id,
const String& human_readable_name) { … }
ABSL_CONST_INIT thread_local int next_world_id = …;
std::optional<int> DOMWrapperWorld::GenerateWorldIdForType(
WorldType world_type) { … }
bool DOMWrapperWorld::ClearWrapperInAnyNonInlineStorageWorldIfEqualTo(
ScriptWrappable* object,
const v8::Local<v8::Object>& handle) { … }
bool DOMWrapperWorld::ClearWrapperInAnyNonInlineStorageWorldIfEqualTo(
ScriptWrappable* object,
const v8::TracedReference<v8::Object>& handle) { … }
void DOMWrapperWorld::Trace(Visitor* visitor) const { … }
}