Skip to content

Commit

Permalink
bindings: Remove unused IDLDictionaryBase
Browse files Browse the repository at this point in the history
IDLDictionaryBase was used to implement IDL dictionary types in
the old bindings code generator, which was retired.  Removes it.

Change-Id: I9854517af319c4f30dc81c3c512efadf4648abc3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3565581
Reviewed-by: Kentaro Hara <haraken@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/main@{#988343}
  • Loading branch information
yuki3 authored and Chromium LUCI CQ committed Apr 4, 2022
1 parent 51b30c1 commit d239a9c
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 137 deletions.
2 changes: 0 additions & 2 deletions third_party/blink/renderer/bindings/bindings.gni
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ blink_core_sources_bindings =
"core/v8/dictionary_helper_for_core.cc",
"core/v8/generated_code_helper.cc",
"core/v8/generated_code_helper.h",
"core/v8/idl_dictionary_base.cc",
"core/v8/idl_dictionary_base.h",
"core/v8/idl_types.h",
"core/v8/idl_types_base.h",
"core/v8/isolated_world_csp.cc",
Expand Down
19 changes: 0 additions & 19 deletions third_party/blink/renderer/bindings/core/v8/idl_dictionary_base.cc

This file was deleted.

34 changes: 0 additions & 34 deletions third_party/blink/renderer/bindings/core/v8/idl_dictionary_base.h

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ class CallbackFunctionBase;
class CallbackInterfaceBase;
class EventListener;
class FlexibleArrayBufferView;
class IDLDictionaryBase;
class ScriptWrappable;
class XPathNSResolver;
struct WrapperTypeInfo;
Expand Down Expand Up @@ -1298,13 +1297,6 @@ struct NativeValueTraits<
typename std::enable_if_t<
std::is_base_of<bindings::DictionaryBase, T>::value>>;

// Migration Adapters: Nullable dictionary types generated by the old bindings
// generator.
template <typename T>
struct NativeValueTraits<
IDLNullable<T>,
typename std::enable_if_t<std::is_base_of<IDLDictionaryBase, T>::value>>;

// Enumeration types
template <typename T>
struct NativeValueTraits<
Expand Down
72 changes: 0 additions & 72 deletions third_party/blink/renderer/bindings/core/v8/to_v8_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace blink {

class CallbackFunctionBase;
class CallbackInterfaceBase;
class IDLDictionaryBase;
class ScriptWrappable;

namespace bindings {
Expand Down Expand Up @@ -281,21 +280,6 @@ struct ToV8Traits<
}
};

// Old implementation of Dictionary
template <typename T>
struct ToV8Traits<
T,
std::enable_if_t<std::is_base_of<IDLDictionaryBase, T>::value>> {
[[nodiscard]] static v8::MaybeLocal<v8::Value> ToV8(ScriptState* script_state,
const T* dictionary) {
// TODO(crbug.com/1185018): Change this if-branch to DCHECK(dictionary).
if (!dictionary)
return v8::Null(script_state->GetIsolate());
return dictionary->ToV8Impl(script_state->GetContext()->Global(),
script_state->GetIsolate());
}
};

// Callback function
template <typename T>
struct ToV8Traits<
Expand Down Expand Up @@ -528,48 +512,6 @@ struct ToV8Traits<
}
};

template <typename T>
struct ToV8Traits<
IDLSequence<T>,
std::enable_if_t<std::is_base_of<IDLDictionaryBase, T>::value>> {
[[nodiscard]] static v8::MaybeLocal<v8::Value> ToV8(
ScriptState* script_state,
const HeapVector<Member<T>>& value) {
return bindings::ToV8HelperSequenceWithMemberUpcast<IDLDictionaryBase>(
script_state, &value);
}

[[nodiscard]] static v8::MaybeLocal<v8::Value> ToV8(
ScriptState* script_state,
const HeapVector<Member<const T>>& value) {
return bindings::ToV8HelperSequenceWithMemberUpcast<IDLDictionaryBase>(
script_state, &value);
}

[[nodiscard]] static v8::MaybeLocal<v8::Value> ToV8(
ScriptState* script_state,
const HeapVector<Member<T>>* value) {
DCHECK(value);
return bindings::ToV8HelperSequenceWithMemberUpcast<IDLDictionaryBase>(
script_state, value);
}

[[nodiscard]] static v8::MaybeLocal<v8::Value> ToV8(
ScriptState* script_state,
const HeapVector<Member<const T>>* value) {
DCHECK(value);
return bindings::ToV8HelperSequenceWithMemberUpcast<IDLDictionaryBase>(
script_state, value);
}

// TODO(crbug.com/1185046): Remove this overload.
[[nodiscard]] static v8::MaybeLocal<v8::Value> ToV8(
ScriptState* script_state,
const Vector<v8::Local<v8::Value>>& value) {
return bindings::ToV8HelperSequence<IDLAny>(script_state, value);
}
};

template <typename T>
struct ToV8Traits<
IDLSequence<T>,
Expand Down Expand Up @@ -644,7 +586,6 @@ template <typename T>
struct ToV8Traits<
IDLSequence<T>,
std::enable_if_t<!std::is_base_of<bindings::DictionaryBase, T>::value &&
!std::is_base_of<IDLDictionaryBase, T>::value &&
!std::is_base_of<ScriptWrappable, T>::value &&
!std::is_base_of<bindings::UnionBase, T>::value>> {
template <typename VectorType>
Expand Down Expand Up @@ -852,19 +793,6 @@ struct ToV8Traits<
}
};

// Nullable Dictionary (Old implementation)
template <typename T>
struct ToV8Traits<
IDLNullable<T>,
std::enable_if_t<std::is_base_of<IDLDictionaryBase, T>::value>> {
[[nodiscard]] static v8::MaybeLocal<v8::Value> ToV8(ScriptState* script_state,
const T* dictionary) {
if (!dictionary)
return v8::Null(script_state->GetIsolate());
return ToV8Traits<T>::ToV8(script_state, dictionary);
}
};

// Nullable Callback function
template <typename T>
struct ToV8Traits<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,6 @@ TEST(ToV8TraitsTest, NullableDictionary) {
// bindings::DictionaryBase
TEST_TOV8_TRAITS(scope, IDLNullable<bindings::DictionaryBase>, "null",
nullptr);
// IDLDictionaryBase
DOMPointInit* dom_point_init = DOMPointInit::Create();
TEST_TOV8_TRAITS(scope, IDLNullable<DOMPointInit>, "null", nullptr);
TEST_TOV8_TRAITS(scope, IDLNullable<DOMPointInit>, "[object Object]",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_TESTING_ORIGIN_TRIALS_TEST_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_TESTING_ORIGIN_TRIALS_TEST_H_

#include "third_party/blink/renderer/bindings/core/v8/idl_dictionary_base.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_origin_trials_test_dictionary.h"
#include "third_party/blink/renderer/platform/bindings/script_wrappable.h"

Expand Down

0 comments on commit d239a9c

Please sign in to comment.