chromium/third_party/blink/renderer/bindings/core/v8/world_safe_v8_reference.h

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_WORLD_SAFE_V8_REFERENCE_H_
#define THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_WORLD_SAFE_V8_REFERENCE_H_

#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/platform/bindings/dom_wrapper_world.h"
#include "third_party/blink/renderer/platform/bindings/trace_wrapper_v8_reference.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "v8/include/v8.h"

namespace blink {

class ScriptState;

// This is a namespace to provide utility functions to WorldSafeV8Reference.
class CORE_EXPORT WorldSafeV8ReferenceInternal final {};

// This class provides safe access to v8::Value across worlds.  This class
// provides accessors that check whether the value is accessed in the same world
// or not, also provides an accessor that clones the value when accessed across
// worlds.
//
// TODO(crbug.com/1008765): Allow WorldSafeV8Reference created/set not in
// context.
template <typename V8Type>
class WorldSafeV8Reference final {};

}  // namespace blink

namespace WTF {

VectorTraits<blink::WorldSafeV8Reference<V8Type>>;

}  // namespace WTF

#endif  // THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_WORLD_SAFE_V8_REFERENCE_H_