| Index: third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
|
| diff --git a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
|
| index e0807a7bb7f1b50008603ed66e56f95cf9e9afc5..33b4a7be08e19f7fa74473db6a5a5d5726d9ca0d 100644
|
| --- a/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
|
| +++ b/third_party/WebKit/Source/bindings/templates/interface_base.cpp.tmpl
|
| @@ -18,12 +18,12 @@ namespace blink {
|
| else 'nullptr' %}
|
| {% set parent_wrapper_type_info = '&V8%s::wrapperTypeInfo' % parent_interface
|
| if parent_interface else '0' %}
|
| -{% set wrapper_type_prototype = 'WrapperTypeExceptionPrototype' if is_exception else
|
| - 'WrapperTypeObjectPrototype' %}
|
| +{% set wrapper_type_prototype = 'kWrapperTypeExceptionPrototype' if is_exception else
|
| + 'kWrapperTypeObjectPrototype' %}
|
| {% set active_scriptwrappable_inheritance =
|
| - 'InheritFromActiveScriptWrappable'
|
| + 'kInheritFromActiveScriptWrappable'
|
| if active_scriptwrappable else
|
| - 'NotInheritFromActiveScriptWrappable' %}
|
| + 'kNotInheritFromActiveScriptWrappable' %}
|
|
|
| {% set wrapper_type_info_const = '' if has_partial_interface else 'const ' %}
|
| {% if not is_partial %}
|
| @@ -33,7 +33,7 @@ namespace blink {
|
| #pragma clang diagnostic push
|
| #pragma clang diagnostic ignored "-Wglobal-constructors"
|
| #endif
|
| -{{wrapper_type_info_const}}WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{dom_template}}, {{v8_class}}::trace, {{v8_class}}::traceWrappers, {{prepare_prototype_and_interface_object_func}}, "{{interface_name}}", {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{active_scriptwrappable_inheritance}}, WrapperTypeInfo::{{event_target_inheritance}}, WrapperTypeInfo::{{lifetime}} };
|
| +{{wrapper_type_info_const}}WrapperTypeInfo {{v8_class}}::wrapperTypeInfo = { gin::kEmbedderBlink, {{dom_template}}, {{v8_class}}::Trace, {{v8_class}}::TraceWrappers, {{prepare_prototype_and_interface_object_func}}, "{{interface_name}}", {{parent_wrapper_type_info}}, WrapperTypeInfo::{{wrapper_type_prototype}}, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{active_scriptwrappable_inheritance}}, WrapperTypeInfo::{{event_target_inheritance}}, WrapperTypeInfo::{{lifetime}} };
|
| #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
|
| #pragma clang diagnostic pop
|
| #endif
|
| @@ -42,7 +42,7 @@ namespace blink {
|
| // This static member must be declared by DEFINE_WRAPPERTYPEINFO in {{cpp_class}}.h.
|
| // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
|
| // bindings/core/v8/ScriptWrappable.h.
|
| -const WrapperTypeInfo& {{cpp_class}}::s_wrapperTypeInfo = {{v8_class}}::wrapperTypeInfo;
|
| +const WrapperTypeInfo& {{cpp_class}}::wrapper_type_info_ = {{v8_class}}::wrapperTypeInfo;
|
| {% endif %}
|
|
|
| {% if active_scriptwrappable %}
|
| @@ -53,8 +53,8 @@ static_assert(
|
| "[ActiveScriptWrappable] extended attribute in the IDL file. "
|
| "Be consistent.");
|
| static_assert(
|
| - !std::is_same<decltype(&{{cpp_class}}::hasPendingActivity),
|
| - decltype(&ScriptWrappable::hasPendingActivity)>::value,
|
| + !std::is_same<decltype(&{{cpp_class}}::HasPendingActivity),
|
| + decltype(&ScriptWrappable::HasPendingActivity)>::value,
|
| "{{cpp_class}} is not overriding hasPendingActivity(), but is specifying "
|
| "[ActiveScriptWrappable] extended attribute in the IDL file. "
|
| "Be consistent.");
|
| @@ -66,8 +66,8 @@ static_assert(
|
| "[ActiveScriptWrappable] extended attribute in the IDL file. "
|
| "Be consistent.");
|
| static_assert(
|
| - std::is_same<decltype(&{{cpp_class}}::hasPendingActivity),
|
| - decltype(&ScriptWrappable::hasPendingActivity)>::value,
|
| + std::is_same<decltype(&{{cpp_class}}::HasPendingActivity),
|
| + decltype(&ScriptWrappable::HasPendingActivity)>::value,
|
| "{{cpp_class}} is overriding hasPendingActivity(), but is not specifying "
|
| "[ActiveScriptWrappable] extended attribute in the IDL file. "
|
| "Be consistent.");
|
| @@ -251,10 +251,10 @@ bool {{v8_class_or_partial}}::securityCheck(v8::Local<v8::Context> accessingCont
|
| return false; // the frame is gone.
|
|
|
| const DOMWindow* targetWindow = V8Window::toImpl(window);
|
| - return BindingSecurity::shouldAllowAccessTo(toLocalDOMWindow(toDOMWindow(accessingContext)), targetWindow, BindingSecurity::ErrorReportOption::DoNotReport);
|
| + return BindingSecurity::ShouldAllowAccessTo(ToLocalDOMWindow(ToDOMWindow(accessingContext)), targetWindow, BindingSecurity::ErrorReportOption::kDoNotReport);
|
| {% elif interface_name == 'Location' %}
|
| {{cpp_class}}* impl = {{v8_class}}::toImpl(accessedObject);
|
| - return BindingSecurity::shouldAllowAccessTo(toLocalDOMWindow(toDOMWindow(accessingContext)), impl, BindingSecurity::ErrorReportOption::DoNotReport);
|
| + return BindingSecurity::ShouldAllowAccessTo(ToLocalDOMWindow(ToDOMWindow(accessingContext)), impl, BindingSecurity::ErrorReportOption::kDoNotReport);
|
| {% else %}
|
| #error "Unexpected security check for interface {{interface_name}}"
|
| {% endif %}
|
| @@ -264,7 +264,7 @@ bool {{v8_class_or_partial}}::securityCheck(v8::Local<v8::Context> accessingCont
|
| void {{v8_class_or_partial}}::crossOriginNamedGetter(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
|
| if (!name->IsString())
|
| return;
|
| - const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
|
| + const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>());
|
|
|
| for (const auto& attribute : {{cpp_class_or_partial}}V8Internal::kCrossOriginAttributeTable) {
|
| if (propertyName == attribute.name && attribute.getter) {
|
| @@ -280,9 +280,9 @@ void {{v8_class_or_partial}}::crossOriginNamedGetter(v8::Local<v8::Name> name, c
|
| {{cpp_class}}V8Internal::namedPropertyGetter(propertyName, info);
|
| {% endif %}
|
| {% else %}
|
| - BindingSecurity::failedAccessCheckFor(
|
| + BindingSecurity::FailedAccessCheckFor(
|
| info.GetIsolate(),
|
| - {{v8_class}}::toImpl(info.Holder())->frame());
|
| + {{v8_class}}::toImpl(info.Holder())->GetFrame());
|
| {% endif %}
|
| }
|
| {% endif %}
|
| @@ -291,7 +291,7 @@ void {{v8_class_or_partial}}::crossOriginNamedGetter(v8::Local<v8::Name> name, c
|
| void {{v8_class_or_partial}}::crossOriginNamedSetter(v8::Local<v8::Name> name, v8::Local<v8::Value> value, const v8::PropertyCallbackInfo<v8::Value>& info) {
|
| if (!name->IsString())
|
| return;
|
| - const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
|
| + const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>());
|
|
|
| for (const auto& attribute : {{cpp_class_or_partial}}V8Internal::kCrossOriginAttributeTable) {
|
| if (propertyName == attribute.name && attribute.setter) {
|
| @@ -304,9 +304,9 @@ void {{v8_class_or_partial}}::crossOriginNamedSetter(v8::Local<v8::Name> name, v
|
| an access check failure: there are no custom named setters that are
|
| accessible from a cross-origin context. #}
|
|
|
| - BindingSecurity::failedAccessCheckFor(
|
| + BindingSecurity::FailedAccessCheckFor(
|
| info.GetIsolate(),
|
| - {{v8_class}}::toImpl(info.Holder())->frame());
|
| + {{v8_class}}::toImpl(info.Holder())->GetFrame());
|
| }
|
| {% endif %}
|
|
|
| @@ -318,7 +318,7 @@ void {{v8_class_or_partial}}::crossOriginNamedEnumerator(const v8::PropertyCallb
|
|
|
| // Use the current context as the creation context, as a cross-origin access
|
| // may involve an object that does not have a creation context.
|
| - v8SetReturnValue(info,
|
| + V8SetReturnValue(info,
|
| ToV8(names, info.GetIsolate()->GetCurrentContext()->Global(),
|
| info.GetIsolate()).As<v8::Array>());
|
| }
|
| @@ -428,7 +428,7 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo
|
| 'V8%s::domTemplate(isolate, world)' % parent_interface
|
| if parent_interface else
|
| 'v8::Local<v8::FunctionTemplate>()' %}
|
| - V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, {{v8_class}}::wrapperTypeInfo.interfaceName, {{parent_interface_template}}, {{v8_class}}::internalFieldCount);
|
| + V8DOMConfiguration::InitializeDOMInterfaceTemplate(isolate, interfaceTemplate, {{v8_class}}::wrapperTypeInfo.interface_name, {{parent_interface_template}}, {{v8_class}}::internalFieldCount);
|
| {% if constructors or has_custom_constructor or has_event_constructor or has_html_constructor %}
|
| interfaceTemplate->SetCallHandler({{v8_class}}::constructorCallback);
|
| interfaceTemplate->SetLength({{interface_length}});
|
| @@ -467,16 +467,16 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo
|
| {{install_constants() | indent(2)}}
|
| {% endif %}
|
| {% if data_attributes %}
|
| - V8DOMConfiguration::installAttributes(isolate, world, instanceTemplate, prototypeTemplate, {{'%sAttributes' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sAttributes)' % v8_class}});
|
| + V8DOMConfiguration::InstallAttributes(isolate, world, instanceTemplate, prototypeTemplate, {{'%sAttributes' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sAttributes)' % v8_class}});
|
| {% endif %}
|
| {% if lazy_data_attributes %}
|
| - V8DOMConfiguration::installLazyDataAttributes(isolate, world, instanceTemplate, prototypeTemplate, {{'%sLazyDataAttributes' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sLazyDataAttributes)' % v8_class}});
|
| + V8DOMConfiguration::InstallLazyDataAttributes(isolate, world, instanceTemplate, prototypeTemplate, {{'%sLazyDataAttributes' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sLazyDataAttributes)' % v8_class}});
|
| {% endif %}
|
| {% if accessors %}
|
| - V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, {{'%sAccessors' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sAccessors)' % v8_class}});
|
| + V8DOMConfiguration::InstallAccessors(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, {{'%sAccessors' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sAccessors)' % v8_class}});
|
| {% endif %}
|
| {% if methods | has_method_configuration(is_partial) %}
|
| - V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, {{'%sMethods' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sMethods)' % v8_class}});
|
| + V8DOMConfiguration::InstallMethods(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, {{'%sMethods' % v8_class}}, {{'WTF_ARRAY_LENGTH(%sMethods)' % v8_class}});
|
| {% endif %}
|
|
|
| {% if has_access_check_callbacks and not is_partial %}
|
| @@ -493,10 +493,10 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo
|
| {% for attribute in attribute_list | unique_by('name') | sort %}
|
| {% if attribute.is_data_type_property %}
|
| const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}}Configuration = {{attribute_configuration(attribute)}};
|
| - V8DOMConfiguration::installAttribute(isolate, world, instanceTemplate, prototypeTemplate, attribute{{attribute.name}}Configuration);
|
| + V8DOMConfiguration::InstallAttribute(isolate, world, instanceTemplate, prototypeTemplate, attribute{{attribute.name}}Configuration);
|
| {% else %}
|
| const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Configuration = {{attribute_configuration(attribute)}};
|
| - V8DOMConfiguration::installAccessor(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, accessor{{attribute.name}}Configuration);
|
| + V8DOMConfiguration::InstallAccessor(isolate, world, instanceTemplate, prototypeTemplate, interfaceTemplate, signature, accessor{{attribute.name}}Configuration);
|
| {% endif %}
|
| {% endfor %}
|
| {% endfilter %}
|
| @@ -520,8 +520,8 @@ static void install{{v8_class}}Template(v8::Isolate* isolate, const DOMWrapperWo
|
| {% filter exposed(iterator_method.exposed_test) %}
|
| {% filter runtime_enabled(iterator_method.runtime_enabled_feature_name) %}
|
| // Iterator (@@iterator)
|
| - const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorConfiguration = { v8::Symbol::GetIterator, {{v8_class_or_partial}}::iteratorMethodCallback, 0, v8::DontEnum, V8DOMConfiguration::OnPrototype };
|
| - V8DOMConfiguration::installMethod(isolate, world, prototypeTemplate, signature, symbolKeyedIteratorConfiguration);
|
| + const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorConfiguration = { v8::Symbol::GetIterator, {{v8_class_or_partial}}::iteratorMethodCallback, 0, v8::DontEnum, V8DOMConfiguration::kOnPrototype };
|
| + V8DOMConfiguration::InstallMethod(isolate, world, prototypeTemplate, signature, symbolKeyedIteratorConfiguration);
|
| {% endfilter %}
|
| {% endfilter %}
|
| {% endif %}
|
| @@ -596,10 +596,10 @@ void {{v8_class_or_partial}}::installRuntimeEnabledFeatures(v8::Isolate* isolate
|
| {% for attribute in attrs | unique_by('name') | sort %}
|
| {% if attribute.is_data_type_property %}
|
| const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}}Configuration = {{attribute_configuration(attribute)}};
|
| - V8DOMConfiguration::installAttribute(isolate, world, instance, prototype, attribute{{attribute.name}}Configuration);
|
| + V8DOMConfiguration::InstallAttribute(isolate, world, instance, prototype, attribute{{attribute.name}}Configuration);
|
| {% else %}
|
| const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Configuration = {{attribute_configuration(attribute)}};
|
| - V8DOMConfiguration::installAccessor(isolate, world, instance, prototype, interface, signature, accessor{{attribute.name}}Configuration);
|
| + V8DOMConfiguration::InstallAccessor(isolate, world, instance, prototype, interface, signature, accessor{{attribute.name}}Configuration);
|
| {% endif %}
|
| {% endfor %}
|
| {% endfilter %}
|
| @@ -652,32 +652,32 @@ void {{v8_class_or_partial}}::install{{feature.name}}(v8::Isolate* isolate, cons
|
| {% for attribute in feature.attributes %}
|
| {% if attribute.is_data_type_property %}
|
| const V8DOMConfiguration::AttributeConfiguration attribute{{attribute.name}}Configuration = {{attribute_configuration(attribute)}};
|
| - V8DOMConfiguration::installAttribute(isolate, world, instance, prototype, attribute{{attribute.name}}Configuration);
|
| + V8DOMConfiguration::InstallAttribute(isolate, world, instance, prototype, attribute{{attribute.name}}Configuration);
|
| {% else %}
|
| const V8DOMConfiguration::AccessorConfiguration accessor{{attribute.name}}Configuration = {{attribute_configuration(attribute)}};
|
| - V8DOMConfiguration::installAccessor(isolate, world, instance, prototype, interface, signature, accessor{{attribute.name}}Configuration);
|
| + V8DOMConfiguration::InstallAccessor(isolate, world, instance, prototype, interface, signature, accessor{{attribute.name}}Configuration);
|
| {% endif %}
|
| {% endfor %}
|
| {# Origin-Trial-enabled constants #}
|
| {% for constant in feature.constants %}
|
| {% set constant_name = constant.name.title().replace('_', '') %}
|
| const V8DOMConfiguration::ConstantConfiguration constant{{constant_name}}Configuration = {{constant_configuration(constant)}};
|
| - V8DOMConfiguration::installConstant(isolate, interface, prototype, constant{{constant_name}}Configuration);
|
| + V8DOMConfiguration::InstallConstant(isolate, interface, prototype, constant{{constant_name}}Configuration);
|
| {% endfor %}
|
| {# Origin-Trial-enabled methods (no overloads) #}
|
| {% for method in feature.methods %}
|
| {% set method_name = method.name.title().replace('_', '') %}
|
| const V8DOMConfiguration::MethodConfiguration method{{method_name}}Configuration = {{method_configuration(method)}};
|
| - V8DOMConfiguration::installMethod(isolate, world, instance, prototype, interface, signature, method{{method_name}}Configuration);
|
| + V8DOMConfiguration::InstallMethod(isolate, world, instance, prototype, interface, signature, method{{method_name}}Configuration);
|
| {% endfor %}
|
| }
|
|
|
| void {{v8_class_or_partial}}::install{{feature.name}}(ScriptState* scriptState, v8::Local<v8::Object> instance) {
|
| - V8PerContextData* perContextData = V8PerContextData::from(scriptState->context());
|
| - v8::Local<v8::Object> prototype = perContextData->prototypeForType(&{{v8_class}}::wrapperTypeInfo);
|
| - v8::Local<v8::Function> interface = perContextData->constructorForType(&{{v8_class}}::wrapperTypeInfo);
|
| + V8PerContextData* perContextData = V8PerContextData::From(scriptState->GetContext());
|
| + v8::Local<v8::Object> prototype = perContextData->PrototypeForType(&{{v8_class}}::wrapperTypeInfo);
|
| + v8::Local<v8::Function> interface = perContextData->ConstructorForType(&{{v8_class}}::wrapperTypeInfo);
|
| ALLOW_UNUSED_LOCAL(interface);
|
| - install{{feature.name}}(scriptState->isolate(), scriptState->world(), instance, prototype, interface);
|
| + install{{feature.name}}(scriptState->GetIsolate(), scriptState->World(), instance, prototype, interface);
|
| }
|
| {% if not feature.needs_instance %}
|
|
|
|
|