chromium/third_party/blink/renderer/platform/bindings/dom_wrapper_world.cc

/*
 * Copyright (C) 2009 Google Inc. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *     * Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above
 * copyright notice, this list of conditions and the following disclaimer
 * in the documentation and/or other materials provided with the
 * distribution.
 *     * Neither the name of Google Inc. nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#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;

// This does not contain the main world because the WorldMap needs
// non-default hashmap traits (WTF::IntWithZeroKeyHashTraits) to contain
// it for the main world's id (0), and it may change the performance trends.
// (see https://crbug.com/704778#c6).
WorldMap;
static WorldMap& GetWorldMap() {}

}  // namespace

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 =;

// static
std::optional<int> DOMWrapperWorld::GenerateWorldIdForType(
    WorldType world_type) {}

// static
bool DOMWrapperWorld::ClearWrapperInAnyNonInlineStorageWorldIfEqualTo(
    ScriptWrappable* object,
    const v8::Local<v8::Object>& handle) {}

// static
bool DOMWrapperWorld::ClearWrapperInAnyNonInlineStorageWorldIfEqualTo(
    ScriptWrappable* object,
    const v8::TracedReference<v8::Object>& handle) {}

void DOMWrapperWorld::Trace(Visitor* visitor) const {}

}  // namespace blink