summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h')
-rw-r--r--chromium/third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h41
1 files changed, 6 insertions, 35 deletions
diff --git a/chromium/third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h b/chromium/third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h
index a3f90daa95c..8fcde3226b4 100644
--- a/chromium/third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h
+++ b/chromium/third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h
@@ -180,35 +180,8 @@ inline void V8SetReturnValueFast(const CallbackInfo& callbackInfo,
// Specialized overload, used by interface indexed property handlers in their
// descriptor callbacks, which need an actual V8 Object with the properties of
// a property descriptor.
-template <typename CallbackInfo>
-inline void V8SetReturnValue(const CallbackInfo& callback_info,
- const v8::PropertyDescriptor& descriptor) {
- DCHECK(descriptor.has_configurable());
- DCHECK(descriptor.has_enumerable());
- DCHECK(descriptor.has_value());
- DCHECK(descriptor.has_writable());
- v8::Local<v8::Object> desc = v8::Object::New(callback_info.GetIsolate());
- desc->Set(callback_info.GetIsolate()->GetCurrentContext(),
- V8AtomicString(callback_info.GetIsolate(), "configurable"),
- ToV8(descriptor.configurable(), callback_info.Holder(),
- callback_info.GetIsolate()))
- .ToChecked();
- desc->Set(callback_info.GetIsolate()->GetCurrentContext(),
- V8AtomicString(callback_info.GetIsolate(), "enumerable"),
- ToV8(descriptor.enumerable(), callback_info.Holder(),
- callback_info.GetIsolate()))
- .ToChecked();
- desc->Set(callback_info.GetIsolate()->GetCurrentContext(),
- V8AtomicString(callback_info.GetIsolate(), "value"),
- descriptor.value())
- .ToChecked();
- desc->Set(callback_info.GetIsolate()->GetCurrentContext(),
- V8AtomicString(callback_info.GetIsolate(), "writable"),
- ToV8(descriptor.writable(), callback_info.Holder(),
- callback_info.GetIsolate()))
- .ToChecked();
- callback_info.GetReturnValue().Set(desc);
-}
+CORE_EXPORT void V8SetReturnValue(const v8::PropertyCallbackInfo<v8::Value>&,
+ const v8::PropertyDescriptor&);
// Conversion flags, used in toIntXX/toUIntXX.
enum IntegerConversionConfiguration {
@@ -218,15 +191,12 @@ enum IntegerConversionConfiguration {
};
// Convert a value to a boolean.
-CORE_EXPORT bool ToBooleanSlow(v8::Isolate*,
- v8::Local<v8::Value>,
- ExceptionState&);
inline bool ToBoolean(v8::Isolate* isolate,
v8::Local<v8::Value> value,
ExceptionState& exception_state) {
if (LIKELY(value->IsBoolean()))
return value.As<v8::Boolean>()->Value();
- return ToBooleanSlow(isolate, value, exception_state);
+ return value->BooleanValue(isolate);
}
// Convert a value to a 8-bit signed integer. The conversion fails if the
@@ -466,8 +436,8 @@ CORE_EXPORT bool HasCallableIteratorSymbol(v8::Isolate*,
v8::Local<v8::Value>,
ExceptionState&);
-CORE_EXPORT v8::Isolate* ToIsolate(ExecutionContext*);
-CORE_EXPORT v8::Isolate* ToIsolate(LocalFrame*);
+CORE_EXPORT v8::Isolate* ToIsolate(const ExecutionContext*);
+CORE_EXPORT v8::Isolate* ToIsolate(const LocalFrame*);
CORE_EXPORT DOMWindow* ToDOMWindow(v8::Isolate*, v8::Local<v8::Value>);
CORE_EXPORT LocalDOMWindow* ToLocalDOMWindow(v8::Local<v8::Context>);
@@ -493,6 +463,7 @@ CORE_EXPORT v8::Local<v8::Context> ToV8ContextEvenIfDetached(LocalFrame*,
// These methods can return nullptr if the context associated with the
// ScriptState has already been detached.
+CORE_EXPORT ScriptState* ToScriptState(ExecutionContext*, DOMWrapperWorld&);
CORE_EXPORT ScriptState* ToScriptState(LocalFrame*, DOMWrapperWorld&);
// Do not use this method unless you are sure you should use the main world's
// ScriptState