| Index: third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl
|
| diff --git a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl
|
| index a4fb97619af188d899c3abdbb07e50c4dd40c0f0..1ece049240397a058f6e5ef2280e00a46073adff 100644
|
| --- a/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl
|
| +++ b/third_party/WebKit/Source/bindings/templates/methods.cpp.tmpl
|
| @@ -7,7 +7,7 @@ static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
|
| 'ExceptionState exceptionState',
|
| 'ScriptState* scriptState = ']) %}
|
| {% set define_exception_state -%}
|
| - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "{{interface_name}}", "{{method.name}}");
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "{{interface_name}}", "{{method.name}}");
|
| {%- endset %}
|
|
|
| {% set function_call = func_call_with_prep_of_args(method, world_suffix) %}
|
| @@ -22,7 +22,7 @@ static void {{method.name}}{{method.overload_index}}Method{{world_suffix}}(const
|
|
|
| {% if not method.is_static %}
|
| {% if method.returns_promise %}
|
| - // V8DOMConfiguration::DoNotCheckHolder
|
| + // V8DOMConfiguration::kDoNotCheckHolder
|
| // Make sure that info.Holder() really points to an instance of the type.
|
| if (!{{v8_class}}::hasInstance(info.Holder(), info.GetIsolate())) {
|
| {{throw_type_error(method, '"Illegal invocation"')}}
|
| @@ -151,9 +151,9 @@ if (UNLIKELY(numArgsPassed <= {{argument.index}})) {
|
| {# FIXME: remove EventListener special case #}
|
| {% if argument.idl_type == 'EventListener' %}
|
| {% if method.name == 'removeEventListener' or method.name == 'removeListener' %}
|
| -{{argument.name}} = V8EventListenerHelper::getEventListener(ScriptState::current(info.GetIsolate()), info[{{argument.index}}], false, ListenerFindOnly);
|
| +{{argument.name}} = V8EventListenerHelper::getEventListener(ScriptState::current(info.GetIsolate()), info[{{argument.index}}], false, kListenerFindOnly);
|
| {% else %}{# method.name == 'addEventListener' #}
|
| -{{argument.name}} = V8EventListenerHelper::getEventListener(ScriptState::current(info.GetIsolate()), info[{{argument.index}}], false, ListenerFindOrCreate);
|
| +{{argument.name}} = V8EventListenerHelper::getEventListener(ScriptState::current(info.GetIsolate()), info[{{argument.index}}], false, kListenerFindOrCreate);
|
| {% endif %}{# method.name #}
|
| {% else %}{# argument.idl_type == 'EventListener' #}
|
| {# Callback functions must be functions:
|
| @@ -349,10 +349,10 @@ static void {{overloads.name}}Method{{world_suffix}}(const v8::FunctionCallbackI
|
| {% set fall_through_to_partial_overloads = not is_partial and overloads.has_partial_overloads %}
|
|
|
| {% if overloads.measure_all_as %}
|
| - UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{overloads.measure_all_as}});
|
| + UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::k{{overloads.measure_all_as}});
|
| {% endif %}
|
| {% if overloads.deprecate_all_as %}
|
| - Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseCounter::{{overloads.deprecate_all_as}});
|
| + Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseCounter::k{{overloads.deprecate_all_as}});
|
| {% endif %}
|
|
|
| {# First resolve by length #}
|
| @@ -371,10 +371,10 @@ static void {{overloads.name}}Method{{world_suffix}}(const v8::FunctionCallbackI
|
| {% filter runtime_enabled(not overloads.runtime_enabled_all and method.runtime_enabled_feature_name) %}
|
| if ({{test}}) {
|
| {% if method.measure_as and not overloads.measure_all_as %}
|
| - UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{method.measure_as('Method')}});
|
| + UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::k{{method.measure_as('Method')}});
|
| {% endif %}
|
| {% if method.deprecate_as and not overloads.deprecate_all_as %}
|
| - Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseCounter::{{method.deprecate_as}});
|
| + Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseCounter::k{{method.deprecate_as}});
|
| {% endif %}
|
| {{method.name}}{{method.overload_index}}Method{{world_suffix}}(info);
|
| return;
|
| @@ -398,7 +398,7 @@ static void {{overloads.name}}Method{{world_suffix}}(const v8::FunctionCallbackI
|
|
|
| {% else %}{# fall_through_to_partial_overloads #}
|
|
|
| - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "{{interface_name}}", "{{overloads.name}}");
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "{{interface_name}}", "{{overloads.name}}");
|
| {% if overloads.returns_promise_all %}
|
| ExceptionToRejectPromiseScope rejectPromiseScope(info, exceptionState);
|
| {% endif %}
|
| @@ -427,7 +427,7 @@ static void {{overloads.name}}Method{{world_suffix}}(const v8::FunctionCallbackI
|
| {##############################################################################}
|
| {% macro generate_post_message_impl(method) %}
|
| static void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance, const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, interfaceName, "postMessage");
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, interfaceName, "postMessage");
|
| if (UNLIKELY(info.Length() < {{method.number_of_required_arguments}})) {
|
| exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments({{method.number_of_required_arguments}}, info.Length()));
|
| return;
|
| @@ -456,10 +456,10 @@ static void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance,
|
| // Clear references to array buffers and image bitmaps from transferables
|
| // so that the serializer can consider the array buffers as
|
| // non-transferable and serialize them into the message.
|
| - ArrayBufferArray transferableArrayBuffers = transferables.arrayBuffers;
|
| - transferables.arrayBuffers.clear();
|
| - ImageBitmapArray transferableImageBitmaps = transferables.imageBitmaps;
|
| - transferables.imageBitmaps.clear();
|
| + ArrayBufferArray transferableArrayBuffers = transferables.array_buffers;
|
| + transferables.array_buffers.clear();
|
| + ImageBitmapArray transferableImageBitmaps = transferables.image_bitmaps;
|
| + transferables.image_bitmaps.clear();
|
| message = SerializedScriptValue::serialize(info.GetIsolate(), info[0], &transferables, nullptr, exceptionState);
|
| if (exceptionState.hadException())
|
| return;
|
| @@ -476,7 +476,7 @@ static void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance,
|
|
|
| // FIXME: Only pass context/exceptionState if instance really requires it.
|
| ExecutionContext* context = currentExecutionContext(info.GetIsolate());
|
| - instance->postMessage(context, message.release(), transferables.messagePorts, exceptionState);
|
| + instance->postMessage(context, message.release(), transferables.message_ports, exceptionState);
|
| }
|
| {% endmacro %}
|
|
|
| @@ -486,10 +486,10 @@ static void postMessageImpl(const char* interfaceName, {{cpp_class}}* instance,
|
| void {{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| {% if not method.overloads %}{# Overloaded methods are measured in overload_resolution_method() #}
|
| {% if method.measure_as %}
|
| - UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{method.measure_as('Method')}});
|
| + UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::k{{method.measure_as('Method')}});
|
| {% endif %}
|
| {% if method.deprecate_as %}
|
| - Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseCounter::{{method.deprecate_as}});
|
| + Deprecation::countDeprecation(currentExecutionContext(info.GetIsolate()), UseCounter::k{{method.deprecate_as}});
|
| {% endif %}
|
| {% endif %}{# not method.overloads #}
|
| {% if world_suffix in method.activity_logging_world_list %}
|
| @@ -500,7 +500,7 @@ void {{method.name}}MethodCallback{{world_suffix}}(const v8::FunctionCallbackInf
|
| {% endif %}
|
| V8PerContextData* contextData = scriptState->perContextData();
|
| if (contextData && contextData->activityLogger()) {
|
| - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionContext, "{{interface_name}}", "{{method.name}}");
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kExecutionContext, "{{interface_name}}", "{{method.name}}");
|
| Vector<v8::Local<v8::Value>> loggerArgs = toImplArguments<Vector<v8::Local<v8::Value>>>(info, 0, exceptionState);
|
| contextData->activityLogger()->logMethod("{{interface_name}}.{{method.name}}", info.Length(), loggerArgs.data());
|
| }
|
| @@ -536,7 +536,7 @@ static void {{method.name}}OriginSafeMethodGetter{{world_suffix}}(const v8::Prop
|
| v8SetReturnValue(info, methodTemplate->GetFunction(info.GetIsolate()->GetCurrentContext()).ToLocalChecked());
|
|
|
| {{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
|
| - if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), impl, BindingSecurity::ErrorReportOption::DoNotReport)) {
|
| + if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), impl, BindingSecurity::ErrorReportOption::kDoNotReport)) {
|
| return;
|
| }
|
|
|
| @@ -566,14 +566,14 @@ static void {{name}}(const v8::FunctionCallbackInfo<v8::Value>& info) {
|
| return;
|
| }
|
|
|
| - if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) {
|
| + if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::kWrapExistingObject) {
|
| v8SetReturnValue(info, info.Holder());
|
| return;
|
| }
|
| {% endif %}
|
|
|
| {% if 'exceptionState' in function_call %}
|
| - ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "{{interface_name}}");
|
| + ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kConstructionContext, "{{interface_name}}");
|
| {% endif %}
|
| {% if 'scriptState' in function_call %}
|
| ScriptState* scriptState = ScriptState::forReceiverObject(info);
|
| @@ -606,8 +606,8 @@ v8SetReturnValue(info, wrapper);
|
| {% set property_attribute =
|
| 'static_cast<v8::PropertyAttribute>(%s)' % ' | '.join(method.property_attributes)
|
| if method.property_attributes else 'v8::None' %}
|
| -{% set holder_check = 'V8DOMConfiguration::DoNotCheckHolder'
|
| - if method.returns_promise else 'V8DOMConfiguration::CheckHolder' %}
|
| +{% set holder_check = 'V8DOMConfiguration::kDoNotCheckHolder'
|
| + if method.returns_promise else 'V8DOMConfiguration::kCheckHolder' %}
|
| {"{{method.name}}", {{method_callback}}, {{method_callback_for_main_world}}, {{method.length}}, {{property_attribute}}, {{property_location(method)}}, {{holder_check}}}
|
| {%- endmacro %}
|
|
|
|
|