Commit 507f170d authored by Yuki Shiino's avatar Yuki Shiino Committed by Commit Bot

bind-gen: Rename V8T::ToBlinkUnsafe to ToWrappableUnsafe

Gives a better name than "Impl" and "Blink(Value)".  V8 object
and Blink object are called "wrapper" and "wrappable"
respectively.  C.f. ScriptWrappable.

Bug: 839389
Change-Id: I9bec47bf5db5f7c46d73dfea92c11fcaf5d65c62
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2098136Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#749561}
parent 2213939f
......@@ -299,13 +299,13 @@ def bind_callback_local_vars(code_node, cg_context):
if (not cg_context.member_like or
"CrossOrigin" in cg_context.member_like.extended_attributes):
text = ("DOMWindow* ${blink_receiver} = "
"${class_name}::ToBlinkUnsafe(${v8_receiver});")
"${class_name}::ToWrappableUnsafe(${v8_receiver});")
else:
text = ("LocalDOMWindow* ${blink_receiver} = To<LocalDOMWindow>("
"${class_name}::ToBlinkUnsafe(${v8_receiver}));")
"${class_name}::ToWrappableUnsafe(${v8_receiver}));")
else:
pattern = ("{_1}* ${blink_receiver} = "
"${class_name}::ToBlinkUnsafe(${v8_receiver});")
"${class_name}::ToWrappableUnsafe(${v8_receiver});")
_1 = blink_class_name(cg_context.class_like)
text = _format(pattern, _1=_1)
local_vars.append(S("blink_receiver", text))
......
......@@ -51,7 +51,13 @@ class PLATFORM_EXPORT V8InterfaceBridgeBase {
template <class V8T, class T>
class V8InterfaceBridge : public V8InterfaceBridgeBase {
public:
static T* ToBlinkUnsafe(v8::Local<v8::Object> value) {
static T* ToWrappable(v8::Isolate* isolate, v8::Local<v8::Value> value) {
return HasInstance(isolate, value)
? ToWrappableUnsafe(value.As<v8::Object>())
: nullptr;
}
static T* ToWrappableUnsafe(v8::Local<v8::Object> value) {
return ToScriptWrappable(value)->ToImpl<T>();
}
......@@ -65,12 +71,13 @@ class V8InterfaceBridge : public V8InterfaceBridgeBase {
return HasInstance(isolate, value);
}
static T* ToImpl(v8::Local<v8::Object> value) { return ToBlinkUnsafe(value); }
static T* ToImpl(v8::Local<v8::Object> value) {
return ToWrappableUnsafe(value);
}
static T* ToImplWithTypeCheck(v8::Isolate* isolate,
v8::Local<v8::Value> value) {
return HasInstance(isolate, value) ? ToBlinkUnsafe(value.As<v8::Object>())
: nullptr;
return ToWrappable(isolate, value);
}
static void InstallContextDependentAdapter(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment