mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Update to Chromium version 126.0.6478.0 (#1300313)
This commit is contained in:
@ -579,6 +579,11 @@ void AccessorNameGetterCallbackImpl(
|
||||
return info.GetReturnValue().SetUndefined();
|
||||
}
|
||||
|
||||
// See explanation in https://crbug.com/336325111.
|
||||
void EmptySetterCallbackImpl(v8::Local<v8::Name> property,
|
||||
v8::Local<v8::Value> value,
|
||||
const v8::PropertyCallbackInfo<void>& info) {}
|
||||
|
||||
void AccessorNameSetterCallbackImpl(
|
||||
v8::Local<v8::Name> property,
|
||||
v8::Local<v8::Value> value,
|
||||
@ -625,7 +630,7 @@ int PropertyToIndex(v8::Isolate* isolate, uint32_t index) {
|
||||
// T == v8::Local<v8::Name> for named property handlers and
|
||||
// T == uint32_t for indexed property handlers
|
||||
template <typename T>
|
||||
void InterceptorGetterCallbackImpl(
|
||||
v8::Intercepted InterceptorGetterCallbackImpl(
|
||||
T property,
|
||||
const v8::PropertyCallbackInfo<v8::Value>& info) {
|
||||
v8::Isolate* isolate = info.GetIsolate();
|
||||
@ -639,7 +644,7 @@ void InterceptorGetterCallbackImpl(
|
||||
interceptorPtr = tracker->GetInterceptor();
|
||||
}
|
||||
if (!interceptorPtr.get()) {
|
||||
return;
|
||||
return v8::Intercepted::kNo;
|
||||
}
|
||||
|
||||
CefRefPtr<CefV8Value> object = new CefV8ValueImpl(isolate, context, obj);
|
||||
@ -654,15 +659,18 @@ void InterceptorGetterCallbackImpl(
|
||||
CefV8ValueImpl* retval_impl = static_cast<CefV8ValueImpl*>(retval.get());
|
||||
if (retval_impl && retval_impl->IsValid()) {
|
||||
info.GetReturnValue().Set(retval_impl->GetV8Value(true));
|
||||
return v8::Intercepted::kYes;
|
||||
}
|
||||
}
|
||||
|
||||
return v8::Intercepted::kNo;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void InterceptorSetterCallbackImpl(
|
||||
v8::Intercepted InterceptorSetterCallbackImpl(
|
||||
T property,
|
||||
v8::Local<v8::Value> value,
|
||||
const v8::PropertyCallbackInfo<v8::Value>& info) {
|
||||
const v8::PropertyCallbackInfo<void>& info) {
|
||||
v8::Isolate* isolate = info.GetIsolate();
|
||||
v8::Local<v8::Context> context = isolate->GetCurrentContext();
|
||||
v8::Handle<v8::Object> obj = info.This();
|
||||
@ -674,7 +682,7 @@ void InterceptorSetterCallbackImpl(
|
||||
}
|
||||
|
||||
if (!interceptorPtr.get()) {
|
||||
return;
|
||||
return v8::Intercepted::kNo;
|
||||
}
|
||||
CefRefPtr<CefV8Value> object = new CefV8ValueImpl(isolate, context, obj);
|
||||
CefRefPtr<CefV8Value> cefValue = new CefV8ValueImpl(isolate, context, value);
|
||||
@ -685,6 +693,10 @@ void InterceptorSetterCallbackImpl(
|
||||
isolate->ThrowException(
|
||||
v8::Exception::Error(GetV8String(isolate, exception)));
|
||||
}
|
||||
// Proceed with execution of the Accessor, if any.
|
||||
// TODO(cef): Allow the CefV8Interceptor::Set callback to stop propegation by
|
||||
// returning a bool value.
|
||||
return v8::Intercepted::kNo;
|
||||
}
|
||||
|
||||
// V8 extension registration.
|
||||
@ -1337,8 +1349,11 @@ CefRefPtr<CefV8Value> CefV8Value::CreateObject(
|
||||
nullptr, v8::Local<v8::Value>(),
|
||||
v8::PropertyHandlerFlags::kOnlyInterceptStrings));
|
||||
|
||||
tmpl->SetIndexedPropertyHandler(InterceptorGetterCallbackImpl<uint32_t>,
|
||||
InterceptorSetterCallbackImpl<uint32_t>);
|
||||
// TODO(cef): Implement additional Query and Enumerator callbacks.
|
||||
// See https://crbug.com/328490288#comment6.
|
||||
tmpl->SetHandler(v8::IndexedPropertyHandlerConfiguration(
|
||||
InterceptorGetterCallbackImpl<uint32_t>,
|
||||
InterceptorSetterCallbackImpl<uint32_t>));
|
||||
|
||||
v8::MaybeLocal<v8::Object> maybe_object = tmpl->NewInstance(context);
|
||||
if (!maybe_object.ToLocal<v8::Object>(&obj)) {
|
||||
@ -2124,7 +2139,6 @@ bool CefV8ValueImpl::SetValue(int index, CefRefPtr<CefV8Value> value) {
|
||||
}
|
||||
|
||||
bool CefV8ValueImpl::SetValue(const CefString& key,
|
||||
AccessControl settings,
|
||||
PropertyAttribute attribute) {
|
||||
CEF_V8_REQUIRE_OBJECT_RETURN(false);
|
||||
|
||||
@ -2155,15 +2169,14 @@ bool CefV8ValueImpl::SetValue(const CefString& key,
|
||||
v8::AccessorNameGetterCallback getter = AccessorNameGetterCallbackImpl;
|
||||
v8::AccessorNameSetterCallback setter =
|
||||
(attribute & V8_PROPERTY_ATTRIBUTE_READONLY)
|
||||
? nullptr
|
||||
? EmptySetterCallbackImpl
|
||||
: AccessorNameSetterCallbackImpl;
|
||||
|
||||
v8::TryCatch try_catch(isolate);
|
||||
try_catch.SetVerbose(true);
|
||||
v8::Maybe<bool> set =
|
||||
obj->SetAccessor(context, GetV8String(isolate, key), getter, setter, obj,
|
||||
static_cast<v8::AccessControl>(settings),
|
||||
static_cast<v8::PropertyAttribute>(attribute));
|
||||
v8::Maybe<bool> set = obj->SetNativeDataProperty(
|
||||
context, GetV8String(isolate, key), getter, setter, obj,
|
||||
static_cast<v8::PropertyAttribute>(attribute));
|
||||
return (!HasCaught(context, try_catch) && set.FromJust());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user