Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Unified Diff: third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl

Issue 2329463004: ABANDONED CL: Changes needed to make things compile after running rewrite_to_chrome_style tool. (Closed)
Patch Set: Rebasing the fixes... Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
diff --git a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
index c10b0ff334ebd57882ba29dabfa52f8a1ebca18e..afbd111734947d0db4588610c4c48135cc62fd4b 100644
--- a/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
+++ b/third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
@@ -4,7 +4,7 @@
unscopables or has_conditional_attributes_on_prototype or
methods | conditionally_exposed(is_partial) %}
{% set prepare_prototype_and_interface_object_func =
- '%s::preparePrototypeAndInterfaceObject' % v8_class
+ '%s::prepare_prototype_and_interface_object' % v8_class
if has_prepare_prototype_and_interface_object
else 'nullptr' %}
@@ -15,7 +15,7 @@
{% set getter = indexed_property_getter %}
static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info) {
{% if getter.is_raises_exception %}
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::IndexedGetterContext, "{{interface_name}}");
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kIndexedGetterContext, "{{interface_name}}");
{% endif %}
{{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
@@ -27,10 +27,10 @@ static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
if (index >= impl->length())
return; // Returns undefined due to out-of-range.
- {% set getter_name = getter.name or 'anonymousIndexedGetter' %}
+ {% set getter_name = getter.name or 'AnonymousIndexedGetter' %}
{% set getter_arguments = ['index'] %}
{% if getter.is_call_with_script_state %}
- ScriptState* scriptState = ScriptState::forReceiverObject(info);
+ ScriptState* scriptState = ScriptState::ForReceiverObject(info);
{% set getter_arguments = ['scriptState'] + getter_arguments %}
{% endif %}
{% if getter.is_raises_exception %}
@@ -59,7 +59,7 @@ void {{v8_class_or_partial}}::indexedPropertyGetterCallback(uint32_t index, cons
{% else %}{# otherwise, named property #}
- const AtomicString& propertyName = AtomicString::number(index);
+ const AtomicString& propertyName = AtomicString::Number(index);
{% if getter.is_custom %}
{{v8_class}}::namedPropertyGetterCustom(propertyName, info);
@@ -81,7 +81,7 @@ void {{v8_class_or_partial}}::indexedPropertyGetterCallback(uint32_t index, cons
{% set setter = indexed_property_setter %}
static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) {
{% if setter.has_exception_state %}
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::IndexedSetterContext, "{{interface_name}}");
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kIndexedSetterContext, "{{interface_name}}");
{% endif %}
{{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
@@ -89,16 +89,16 @@ static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
{% if setter.has_type_checking_interface %}
{# Type checking for interface types (if interface not implemented, throw
TypeError), per http://www.w3.org/TR/WebIDL/#es-interface #}
- if (!propertyValue{% if setter.is_nullable %} && !isUndefinedOrNull(v8Value){% endif %}) {
- exceptionState.throwTypeError("The provided value is not of type '{{setter.idl_type}}'.");
+ if (!propertyValue{% if setter.is_nullable %} && !IsUndefinedOrNull(v8Value){% endif %}) {
+ exceptionState.ThrowTypeError("The provided value is not of type '{{setter.idl_type}}'.");
return;
}
{% endif %}
- {% set setter_name = setter.name or 'anonymousIndexedSetter' %}
+ {% set setter_name = setter.name or 'AnonymousIndexedSetter' %}
{% set setter_arguments = ['index', 'propertyValue'] %}
{% if setter.is_call_with_script_state %}
- ScriptState* scriptState = ScriptState::forReceiverObject(info);
+ ScriptState* scriptState = ScriptState::ForReceiverObject(info);
{% set setter_arguments = ['scriptState'] + setter_arguments %}
{% endif %}
{% if setter.is_raises_exception %}
@@ -106,12 +106,12 @@ static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
{% endif %}
bool result = impl->{{setter_name}}({{setter_arguments | join(', ')}});
{% if setter.is_raises_exception %}
- if (exceptionState.hadException())
+ if (exceptionState.HadException())
return;
{% endif %}
if (!result)
return;
- v8SetReturnValue(info, v8Value);
+ V8SetReturnValue(info, v8Value);
}
{% endif %}
@@ -137,7 +137,7 @@ void {{v8_class_or_partial}}::indexedPropertySetterCallback(uint32_t index, v8::
{% else %}{# otherwise, named property #}
- const AtomicString& propertyName = AtomicString::number(index);
+ const AtomicString& propertyName = AtomicString::Number(index);
{% if setter.is_custom %}
{{v8_class}}::namedPropertySetterCustom(propertyName, v8Value, info);
@@ -158,15 +158,15 @@ void {{v8_class_or_partial}}::indexedPropertySetterCallback(uint32_t index, v8::
{% set deleter = indexed_property_deleter %}
static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info) {
{% if deleter.is_raises_exception %}
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::IndexedDeletionContext, "{{interface_name}}");
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kIndexedDeletionContext, "{{interface_name}}");
{% endif %}
{{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
- {% set deleter_name = deleter.name or 'anonymousIndexedDeleter' %}
+ {% set deleter_name = deleter.name or 'AnonymousIndexedDeleter' %}
{% set deleter_arguments = ['index'] %}
{% if deleter.is_call_with_script_state %}
- ScriptState* scriptState = ScriptState::forReceiverObject(info);
+ ScriptState* scriptState = ScriptState::ForReceiverObject(info);
{% set deleter_arguments = ['scriptState'] + deleter_arguments %}
{% endif %}
{% if deleter.is_raises_exception %}
@@ -174,12 +174,12 @@ static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
{% endif %}
DeleteResult result = impl->{{deleter_name}}({{deleter_arguments | join(', ')}});
{% if deleter.is_raises_exception %}
- if (exceptionState.hadException())
+ if (exceptionState.HadException())
return;
{% endif %}
- if (result == DeleteUnknownProperty)
+ if (result == kDeleteUnknownProperty)
return;
- v8SetReturnValue(info, result == DeleteSuccess);
+ V8SetReturnValue(info, result == kDeleteSuccess);
}
{% endif %}
@@ -205,7 +205,7 @@ void {{v8_class_or_partial}}::indexedPropertyDeleterCallback(uint32_t index, con
{% else %}{# otherwise, named property #}
- const AtomicString& propertyName = AtomicString::number(index);
+ const AtomicString& propertyName = AtomicString::Number(index);
{% if deleter.is_custom %}
{{v8_class}}::namedPropertyDeleterCustom(propertyName, info);
@@ -226,11 +226,11 @@ void {{v8_class_or_partial}}::indexedPropertyDeleterCallback(uint32_t index, con
{% set getter = named_property_getter %}
static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCallbackInfo<v8::Value>& info) {
{% if getter.is_raises_exception %}
- const CString& nameInUtf8 = name.utf8();
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext, "{{interface_name}}", nameInUtf8.data());
+ const CString& nameInUtf8 = name.Utf8();
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kGetterContext, "{{interface_name}}", nameInUtf8.Data());
{% endif %}
{% if getter.is_call_with_script_state %}
- ScriptState* scriptState = ScriptState::forReceiverObject(info);
+ ScriptState* scriptState = ScriptState::ForReceiverObject(info);
{% endif %}
{{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
@@ -256,7 +256,7 @@ static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCall
void {{v8_class_or_partial}}::namedPropertyGetterCallback(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>());
{% if getter.is_custom %}
{{v8_class}}::namedPropertyGetterCustom(propertyName, info);
@@ -276,11 +276,11 @@ void {{v8_class_or_partial}}::namedPropertyGetterCallback(v8::Local<v8::Name> na
{% set setter = named_property_setter %}
static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) {
{% if setter.has_exception_state %}
- const CString& nameInUtf8 = name.utf8();
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "{{interface_name}}", nameInUtf8.data());
+ const CString& nameInUtf8 = name.Utf8();
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kSetterContext, "{{interface_name}}", nameInUtf8.Data());
{% endif %}
{% if setter.is_call_with_script_state %}
- ScriptState* scriptState = ScriptState::forReceiverObject(info);
+ ScriptState* scriptState = ScriptState::ForReceiverObject(info);
{% endif %}
{{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
@@ -288,13 +288,13 @@ static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v
{% if setter.has_type_checking_interface %}
{# Type checking for interface types (if interface not implemented, throw
TypeError), per http://www.w3.org/TR/WebIDL/#es-interface #}
- if (!propertyValue{% if setter.is_nullable %} && !isUndefinedOrNull(v8Value){% endif %}) {
- exceptionState.throwTypeError("The provided value is not of type '{{setter.idl_type}}'.");
+ if (!propertyValue{% if setter.is_nullable %} && !IsUndefinedOrNull(v8Value){% endif %}) {
+ exceptionState.ThrowTypeError("The provided value is not of type '{{setter.idl_type}}'.");
return;
}
{% endif %}
- {% set setter_name = setter.name or 'anonymousNamedSetter' %}
+ {% set setter_name = setter.name or 'AnonymousNamedSetter' %}
{% set setter_arguments = ['name', 'propertyValue'] %}
{% if setter.is_call_with_script_state %}
{% set setter_arguments = ['scriptState'] + setter_arguments %}
@@ -304,12 +304,12 @@ static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v
{% endif %}
bool result = impl->{{setter_name}}({{setter_arguments | join(', ')}});
{% if setter.is_raises_exception %}
- if (exceptionState.hadException())
+ if (exceptionState.HadException())
return;
{% endif %}
if (!result)
return;
- v8SetReturnValue(info, v8Value);
+ V8SetReturnValue(info, v8Value);
}
{% endif %}
@@ -323,7 +323,7 @@ static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v
void {{v8_class_or_partial}}::namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value> v8Value, 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>());
{% if setter.is_ce_reactions %}
CEReactionsScope ceReactionsScope;
@@ -346,16 +346,16 @@ void {{v8_class_or_partial}}::namedPropertySetterCallback(v8::Local<v8::Name> na
{% set deleter = named_property_deleter %}
static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCallbackInfo<v8::Boolean>& info) {
{% if deleter.is_raises_exception %}
- const CString& nameInUtf8 = name.utf8();
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::DeletionContext, "{{interface_name}}", nameInUtf8.data());
+ const CString& nameInUtf8 = name.Utf8();
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kDeletionContext, "{{interface_name}}", nameInUtf8.Data());
{% endif %}
{% if deleter.is_call_with_script_state %}
- ScriptState* scriptState = ScriptState::forReceiverObject(info);
+ ScriptState* scriptState = ScriptState::ForReceiverObject(info);
{% endif %}
{{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
- {% set deleter_name = deleter.name or 'anonymousNamedDeleter' %}
+ {% set deleter_name = deleter.name or 'AnonymousNamedDeleter' %}
{% set deleter_arguments = ['name'] %}
{% if deleter.is_call_with_script_state %}
{% set deleter_arguments = ['scriptState'] + deleter_arguments %}
@@ -365,12 +365,12 @@ static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCal
{% endif %}
DeleteResult result = impl->{{deleter_name}}({{deleter_arguments | join(', ')}});
{% if deleter.is_raises_exception %}
- if (exceptionState.hadException())
+ if (exceptionState.HadException())
return;
{% endif %}
- if (result == DeleteUnknownProperty)
+ if (result == kDeleteUnknownProperty)
return;
- v8SetReturnValue(info, result == DeleteSuccess);
+ V8SetReturnValue(info, result == kDeleteSuccess);
}
{% endif %}
@@ -384,7 +384,7 @@ static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCal
void {{v8_class_or_partial}}::namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Boolean>& info) {
if (!name->IsString())
return;
- const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
+ const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>());
{% if deleter.is_ce_reactions %}
CEReactionsScope ceReactionsScope;
@@ -409,10 +409,10 @@ void {{v8_class_or_partial}}::namedPropertyDeleterCallback(v8::Local<v8::Name> n
{# If there is an enumerator, there MUST be a query method to properly
communicate property attributes. #}
static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallbackInfo<v8::Integer>& info) {
- const CString& nameInUtf8 = name.utf8();
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext, "{{interface_name}}", nameInUtf8.data());
+ const CString& nameInUtf8 = name.Utf8();
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kGetterContext, "{{interface_name}}", nameInUtf8.Data());
{% if getter.is_call_with_script_state %}
- ScriptState* scriptState = ScriptState::forReceiverObject(info);
+ ScriptState* scriptState = ScriptState::ForReceiverObject(info);
{% endif %}
{{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
@@ -421,10 +421,10 @@ static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallb
{% if getter.is_call_with_script_state %}
{% set getter_arguments = ['scriptState'] + getter_arguments %}
{% endif %}
- bool result = impl->namedPropertyQuery({{getter_arguments | join(', ')}});
+ bool result = impl->NamedPropertyQuery({{getter_arguments | join(', ')}});
if (!result)
return;
- v8SetReturnValueInt(info, v8::None);
+ V8SetReturnValueInt(info, v8::None);
}
{% endif %}
@@ -438,7 +438,7 @@ static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallb
void {{v8_class_or_partial}}::namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Integer>& info) {
if (!name->IsString())
return;
- const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
+ const AtomicString& propertyName = ToCoreAtomicString(name.As<v8::String>());
{% if getter.is_custom_property_query %}
{{v8_class}}::namedPropertyQueryCustom(propertyName, info);
@@ -456,15 +456,15 @@ void {{v8_class_or_partial}}::namedPropertyQueryCallback(v8::Local<v8::Name> nam
{% if named_property_getter and named_property_getter.is_enumerable and
not named_property_getter.is_custom_property_enumerator %}
static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info) {
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::EnumerationContext, "{{interface_name}}");
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kEnumerationContext, "{{interface_name}}");
{{cpp_class}}* impl = {{v8_class}}::toImpl(info.Holder());
Vector<String> names;
- impl->namedPropertyEnumerator(names, exceptionState);
- if (exceptionState.hadException())
+ impl->NamedPropertyEnumerator(names, exceptionState);
+ if (exceptionState.HadException())
return;
- v8SetReturnValue(info, ToV8(names, info.Holder(), info.GetIsolate()).As<v8::Array>());
+ V8SetReturnValue(info, ToV8(names, info.Holder(), info.GetIsolate()).As<v8::Array>());
}
{% endif %}
@@ -501,13 +501,13 @@ static void {{cpp_class}}OriginSafeMethodSetter(v8::Local<v8::Name> name, v8::Lo
return;
{{cpp_class}}* impl = {{v8_class}}::toImpl(holder);
v8::String::Utf8Value attributeName(name);
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext, "{{interface_name}}", *attributeName);
- if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), impl, exceptionState)) {
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kSetterContext, "{{interface_name}}", *attributeName);
+ if (!BindingSecurity::ShouldAllowAccessTo(CurrentDOMWindow(info.GetIsolate()), impl, exceptionState)) {
return;
}
{# The findInstanceInPrototypeChain() call above only returns a non-empty handle if info.Holder() is an Object. #}
- V8HiddenValue::setHiddenValue(ScriptState::current(info.GetIsolate()), v8::Local<v8::Object>::Cast(info.Holder()), name.As<v8::String>(), v8Value);
+ V8HiddenValue::SetHiddenValue(ScriptState::Current(info.GetIsolate()), v8::Local<v8::Object>::Cast(info.Holder()), name.As<v8::String>(), v8Value);
}
{% endif %}
{% endblock %}
@@ -526,16 +526,16 @@ void {{v8_class_or_partial}}::{{cpp_class}}OriginSafeMethodSetterCallback(v8::Lo
{% from 'methods.cpp.tmpl' import generate_constructor with context %}
{% if named_constructor %}
{% set active_scriptwrappable_inheritance =
- 'InheritFromActiveScriptWrappable'
+ 'kInheritFromActiveScriptWrappable'
if active_scriptwrappable else
- 'NotInheritFromActiveScriptWrappable' %}
+ 'kNotInheritFromActiveScriptWrappable' %}
// Suppress warning: global constructors, because struct WrapperTypeInfo is trivial
// and does not depend on another global objects.
#if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wglobal-constructors"
#endif
-const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedderBlink, {{v8_class}}Constructor::domTemplate, {{v8_class}}::trace, {{v8_class}}::traceWrappers, {{prepare_prototype_and_interface_object_func}}, "{{interface_name}}", 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::{{wrapper_class_id}}, WrapperTypeInfo::{{active_scriptwrappable_inheritance}}, WrapperTypeInfo::{{event_target_inheritance}}, WrapperTypeInfo::{{lifetime}} };
+const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedderBlink, {{v8_class}}Constructor::domTemplate, {{v8_class}}::Trace, {{v8_class}}::TraceWrappers, {{prepare_prototype_and_interface_object_func}}, "{{interface_name}}", 0, WrapperTypeInfo::kWrapperTypeObjectPrototype, 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
@@ -543,17 +543,17 @@ const WrapperTypeInfo {{v8_class}}Constructor::wrapperTypeInfo = { gin::kEmbedde
{{generate_constructor(named_constructor)}}
v8::Local<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) {
static int domTemplateKey; // This address is used for a key to look up the dom template.
- V8PerIsolateData* data = V8PerIsolateData::from(isolate);
- v8::Local<v8::FunctionTemplate> result = data->findInterfaceTemplate(world, &domTemplateKey);
+ V8PerIsolateData* data = V8PerIsolateData::From(isolate);
+ v8::Local<v8::FunctionTemplate> result = data->FindInterfaceTemplate(world, &domTemplateKey);
if (!result.IsEmpty())
return result;
result = v8::FunctionTemplate::New(isolate, {{v8_class}}ConstructorCallback);
v8::Local<v8::ObjectTemplate> instanceTemplate = result->InstanceTemplate();
instanceTemplate->SetInternalFieldCount({{v8_class}}::internalFieldCount);
- result->SetClassName(v8AtomicString(isolate, "{{cpp_class}}"));
+ result->SetClassName(V8AtomicString(isolate, "{{cpp_class}}"));
result->Inherit({{v8_class}}::domTemplate(isolate, world));
- data->setInterfaceTemplate(world, &domTemplateKey, result);
+ data->SetInterfaceTemplate(world, &domTemplateKey, result);
return result;
}
@@ -564,7 +564,7 @@ v8::Local<v8::FunctionTemplate> {{v8_class}}Constructor::domTemplate(v8::Isolate
{% block overloaded_constructor %}
{% if constructor_overloads %}
static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) {
- ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ConstructionContext, "{{interface_name}}");
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kConstructionContext, "{{interface_name}}");
{# 2. Initialize argcount to be min(maxarg, n). #}
switch (std::min({{constructor_overloads.maxarg}}, info.Length())) {
{# 3. Remove from S all entries whose type list is not of length argcount. #}
@@ -585,16 +585,16 @@ static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) {
{# Report full list of valid arities if gaps and above minimum #}
{% if constructor_overloads.valid_arities %}
if (info.Length() >= {{constructor_overloads.length}}) {
- exceptionState.throwTypeError(ExceptionMessages::invalidArity("{{constructor_overloads.valid_arities}}", info.Length()));
+ exceptionState.ThrowTypeError(ExceptionMessages::InvalidArity("{{constructor_overloads.valid_arities}}", info.Length()));
return;
}
{% endif %}
{# Otherwise just report "not enough arguments" #}
- exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments({{constructor_overloads.length}}, info.Length()));
+ exceptionState.ThrowTypeError(ExceptionMessages::NotEnoughArguments({{constructor_overloads.length}}, info.Length()));
return;
}
{# No match, throw error #}
- exceptionState.throwTypeError("No matching constructor signature.");
+ exceptionState.ThrowTypeError("No matching constructor signature.");
}
{% endif %}
@@ -606,22 +606,22 @@ static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) {
{% if constructors or has_custom_constructor or has_event_constructor or has_html_constructor %}
void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
{% if measure_as %}
- UseCounter::count(currentExecutionContext(info.GetIsolate()), UseCounter::{{measure_as('Constructor')}});
+ UseCounter::Count(CurrentExecutionContext(info.GetIsolate()), UseCounter::k{{measure_as('Constructor')}});
{% endif %}
if (!info.IsConstructCall()) {
- V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::constructorNotCallableAsFunction("{{interface_name}}"));
+ V8ThrowException::ThrowTypeError(info.GetIsolate(), ExceptionMessages::ConstructorNotCallableAsFunction("{{interface_name}}"));
return;
}
- if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) {
- v8SetReturnValue(info, info.Holder());
+ if (ConstructorMode::Current(info.GetIsolate()) == ConstructorMode::kWrapExistingObject) {
+ V8SetReturnValue(info, info.Holder());
return;
}
{% if has_custom_constructor %}
{{v8_class}}::constructorCustom(info);
{% elif has_html_constructor %}
- V8HTMLConstructor::htmlConstructor(info, {{v8_class}}::wrapperTypeInfo, HTMLElementType::k{{interface_name}});
+ V8HTMLConstructor::HtmlConstructor(info, {{v8_class}}::wrapperTypeInfo, HTMLElementType::k{{interface_name}});
{% else %}
{{cpp_class}}V8Internal::constructor(info);
{% endif %}
@@ -654,11 +654,11 @@ void {{v8_class}}::constructorCallback(const v8::FunctionCallbackInfo<v8::Value>
{% set property_attribute =
'static_cast<v8::PropertyAttribute>(%s)' %
' | '.join(method.property_attributes or ['v8::None']) %}
-{% set holder_check = 'V8DOMConfiguration::CheckHolder' %}
+{% set holder_check = 'V8DOMConfiguration::kCheckHolder' %}
const V8DOMConfiguration::AttributeConfiguration {{method.name}}OriginSafeAttributeConfiguration = {
"{{method.name}}", {{getter_callback}}, {{setter_callback}}, {{getter_callback_for_main_world}}, {{setter_callback_for_main_world}}, nullptr, &{{v8_class}}::wrapperTypeInfo, {{property_attribute}}, {{property_location(method)}}, {{holder_check}}
};
-V8DOMConfiguration::installAttribute(isolate, world, {{instance_template}}, {{prototype_template}}, {{method.name}}OriginSafeAttributeConfiguration);
+V8DOMConfiguration::InstallAttribute(isolate, world, {{instance_template}}, {{prototype_template}}, {{method.name}}OriginSafeAttributeConfiguration);
{%- endmacro %}
@@ -674,7 +674,7 @@ V8DOMConfiguration::installAttribute(isolate, world, {{instance_template}}, {{pr
'%s::indexedPropertyDeleterCallback' % v8_class_or_partial
if indexed_property_deleter or named_property_deleter else 'nullptr' %}
{% set indexed_property_enumerator_callback =
- 'indexedPropertyEnumerator<%s>' % cpp_class
+ 'IndexedPropertyEnumerator<%s>' % cpp_class
if indexed_property_getter.is_enumerable else 'nullptr' %}
{% set property_handler_flags =
'v8::PropertyHandlerFlags::kNone' %}
@@ -718,7 +718,7 @@ v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig({{named_propert
{% if not is_array_buffer_or_view %}
v8::Local<v8::FunctionTemplate> {{v8_class}}::domTemplate(v8::Isolate* isolate, const DOMWrapperWorld& world) {
{% set installTemplateFunction = '%s::install%sTemplateFunction' % (v8_class, v8_class) if has_partial_interface else 'install%sTemplate' % v8_class %}
- return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), {{installTemplateFunction}});
+ return V8DOMConfiguration::DomClassTemplate(isolate, world, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), {{installTemplateFunction}});
}
{% endif %}
@@ -731,15 +731,15 @@ v8::Local<v8::FunctionTemplate> {{v8_class}}::domTemplate(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> {{v8_class}}::domTemplateForNamedPropertiesObject(v8::Isolate* isolate, const DOMWrapperWorld& world) {
v8::Local<v8::FunctionTemplate> parentTemplate = V8{{parent_interface}}::domTemplate(isolate, world);
- v8::Local<v8::FunctionTemplate> namedPropertiesObjectFunctionTemplate = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidConstructorMode);
- namedPropertiesObjectFunctionTemplate->SetClassName(v8AtomicString(isolate, "{{interface_name}}Properties"));
+ v8::Local<v8::FunctionTemplate> namedPropertiesObjectFunctionTemplate = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::IsValidConstructorMode);
+ namedPropertiesObjectFunctionTemplate->SetClassName(V8AtomicString(isolate, "{{interface_name}}Properties"));
namedPropertiesObjectFunctionTemplate->Inherit(parentTemplate);
v8::Local<v8::ObjectTemplate> namedPropertiesObjectTemplate = namedPropertiesObjectFunctionTemplate->PrototypeTemplate();
namedPropertiesObjectTemplate->SetInternalFieldCount({{v8_class}}::internalFieldCount);
// Named Properties object has SetPrototype method of Immutable Prototype Exotic Objects
namedPropertiesObjectTemplate->SetImmutableProto();
- V8DOMConfiguration::setClassString(isolate, namedPropertiesObjectTemplate, "{{interface_name}}Properties");
+ V8DOMConfiguration::SetClassString(isolate, namedPropertiesObjectTemplate, "{{interface_name}}Properties");
{{install_named_property_handler('namedPropertiesObjectTemplate') | indent(2)}}
return namedPropertiesObjectFunctionTemplate;
@@ -754,11 +754,11 @@ v8::Local<v8::FunctionTemplate> {{v8_class}}::domTemplateForNamedPropertiesObjec
{% if not is_array_buffer_or_view %}
bool {{v8_class}}::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) {
- return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
+ return V8PerIsolateData::From(isolate)->HasInstance(&wrapperTypeInfo, v8Value);
}
v8::Local<v8::Object> {{v8_class}}::findInstanceInPrototypeChain(v8::Local<v8::Value> v8Value, v8::Isolate* isolate) {
- return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
+ return V8PerIsolateData::From(isolate)->FindInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
}
{% endif %}
@@ -772,18 +772,18 @@ v8::Local<v8::Object> {{v8_class}}::findInstanceInPrototypeChain(v8::Local<v8::V
DCHECK(object->Is{{interface_name}}());
v8::Local<v8::{{interface_name}}> v8buffer = object.As<v8::{{interface_name}}>();
if (v8buffer->IsExternal()) {
- const WrapperTypeInfo* wrapperTypeInfo = toWrapperTypeInfo(object);
+ const WrapperTypeInfo* wrapperTypeInfo = ToWrapperTypeInfo(object);
CHECK(wrapperTypeInfo);
- CHECK_EQ(wrapperTypeInfo->ginEmbedder, gin::kEmbedderBlink);
- return toScriptWrappable(object)->toImpl<{{cpp_class}}>();
+ CHECK_EQ(wrapperTypeInfo->gin_embedder, gin::kEmbedderBlink);
+ return ToScriptWrappable(object)->ToImpl<{{cpp_class}}>();
}
// Transfer the ownership of the allocated memory to an {{interface_name}} without
// copying.
v8::{{interface_name}}::Contents v8Contents = v8buffer->Externalize();
- WTF::ArrayBufferContents contents(v8Contents.Data(), v8Contents.ByteLength(), WTF::ArrayBufferContents::{% if interface_name == 'ArrayBuffer' %}Not{% endif %}Shared);
- {{cpp_class}}* buffer = {{cpp_class}}::create(contents);
- v8::Local<v8::Object> associatedWrapper = buffer->associateWithWrapper(v8::Isolate::GetCurrent(), buffer->wrapperTypeInfo(), object);
+ WTF::ArrayBufferContents contents(v8Contents.Data(), v8Contents.ByteLength(), WTF::ArrayBufferContents::k{% if interface_name == 'ArrayBuffer' %}Not{% endif %}Shared);
+ {{cpp_class}}* buffer = {{cpp_class}}::Create(contents);
+ v8::Local<v8::Object> associatedWrapper = buffer->AssociateWithWrapper(v8::Isolate::GetCurrent(), buffer->GetWrapperTypeInfo(), object);
DCHECK(associatedWrapper == object);
return buffer;
@@ -792,9 +792,9 @@ v8::Local<v8::Object> {{v8_class}}::findInstanceInPrototypeChain(v8::Local<v8::V
{% elif interface_name == 'ArrayBufferView' %}
{{cpp_class}}* V8ArrayBufferView::toImpl(v8::Local<v8::Object> object) {
DCHECK(object->IsArrayBufferView());
- ScriptWrappable* scriptWrappable = toScriptWrappable(object);
+ ScriptWrappable* scriptWrappable = ToScriptWrappable(object);
if (scriptWrappable)
- return scriptWrappable->toImpl<{{cpp_class}}>();
+ return scriptWrappable->ToImpl<{{cpp_class}}>();
if (object->IsInt8Array())
return V8Int8Array::toImpl(object);
@@ -824,24 +824,24 @@ v8::Local<v8::Object> {{v8_class}}::findInstanceInPrototypeChain(v8::Local<v8::V
{% elif is_array_buffer_or_view %}
{{cpp_class}}* {{v8_class}}::toImpl(v8::Local<v8::Object> object) {
DCHECK(object->Is{{interface_name}}());
- ScriptWrappable* scriptWrappable = toScriptWrappable(object);
+ ScriptWrappable* scriptWrappable = ToScriptWrappable(object);
if (scriptWrappable)
- return scriptWrappable->toImpl<{{cpp_class}}>();
+ return scriptWrappable->ToImpl<{{cpp_class}}>();
v8::Local<v8::{{interface_name}}> v8View = object.As<v8::{{interface_name}}>();
v8::Local<v8::Object> arrayBuffer = v8View->Buffer();
{{cpp_class}}* typedArray = nullptr;
if (arrayBuffer->IsArrayBuffer()) {
- typedArray = {{cpp_class}}::create(V8ArrayBuffer::toImpl(arrayBuffer), v8View->ByteOffset(), v8View->{% if interface_name == 'DataView' %}Byte{% endif %}Length());
+ typedArray = {{cpp_class}}::Create(V8ArrayBuffer::toImpl(arrayBuffer), v8View->ByteOffset(), v8View->{% if interface_name == 'DataView' %}Byte{% endif %}Length());
} else if (arrayBuffer->IsSharedArrayBuffer()) {
- typedArray = {{cpp_class}}::create(V8SharedArrayBuffer::toImpl(arrayBuffer), v8View->ByteOffset(), v8View->{% if interface_name == 'DataView' %}Byte{% endif %}Length());
+ typedArray = {{cpp_class}}::Create(V8SharedArrayBuffer::toImpl(arrayBuffer), v8View->ByteOffset(), v8View->{% if interface_name == 'DataView' %}Byte{% endif %}Length());
} else {
NOTREACHED();
}
- v8::Local<v8::Object> associatedWrapper = typedArray->associateWithWrapper(v8::Isolate::GetCurrent(), typedArray->wrapperTypeInfo(), object);
+ v8::Local<v8::Object> associatedWrapper = typedArray->AssociateWithWrapper(v8::Isolate::GetCurrent(), typedArray->GetWrapperTypeInfo(), object);
DCHECK(associatedWrapper == object);
- return typedArray->toImpl<{{cpp_class}}>();
+ return typedArray->ToImpl<{{cpp_class}}>();
}
{% endif %}
@@ -886,13 +886,13 @@ void {{v8_class}}::preparePrototypeAndInterfaceObject(v8::Local<v8::Context> con
{% macro install_unscopables() %}
v8::Local<v8::Name> unscopablesSymbol(v8::Symbol::GetUnscopables(isolate));
v8::Local<v8::Object> unscopables;
-if (v8CallBoolean(prototypeObject->HasOwnProperty(context, unscopablesSymbol)))
+if (V8CallBoolean(prototypeObject->HasOwnProperty(context, unscopablesSymbol)))
unscopables = prototypeObject->Get(context, unscopablesSymbol).ToLocalChecked().As<v8::Object>();
else
unscopables = v8::Object::New(isolate);
{% for name, runtime_enabled_feature_name in unscopables %}
{% filter runtime_enabled(runtime_enabled_feature_name) %}
-unscopables->CreateDataProperty(context, v8AtomicString(isolate, "{{name}}"), v8::True(isolate)).FromJust();
+unscopables->CreateDataProperty(context, V8AtomicString(isolate, "{{name}}"), v8::True(isolate)).FromJust();
{% endfilter %}
{% endfor %}
prototypeObject->CreateDataProperty(context, unscopablesSymbol, unscopables).FromJust();
@@ -902,14 +902,14 @@ prototypeObject->CreateDataProperty(context, unscopablesSymbol, unscopables).Fro
{##############################################################################}
{% macro install_conditionally_enabled_attributes_on_prototype() %}
{% from 'attributes.cpp.tmpl' import attribute_configuration with context %}
-ExecutionContext* executionContext = toExecutionContext(context);
+ExecutionContext* executionContext = ToExecutionContext(context);
v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemplate);
{% for attribute in attributes if (attribute.exposed_test or attribute.secure_context_test) and attribute.on_prototype %}
{% filter exposed(attribute.exposed_test) %}
{% filter secure_context(attribute.secure_context_test) %}
{% filter runtime_enabled(attribute.runtime_enabled_feature_name) %}
const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {{attribute_configuration(attribute)}};
-V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(), prototypeObject, interfaceObject, signature, accessorConfiguration);
+V8DOMConfiguration::InstallAccessor(isolate, world, v8::Local<v8::Object>(), prototypeObject, interfaceObject, signature, accessorConfiguration);
{% endfilter %}{# runtime_enabled #}
{% endfilter %}{# secure_context #}
{% endfilter %}{# exposed #}
@@ -925,7 +925,7 @@ InstallTemplateFunction {{v8_class}}::install{{v8_class}}TemplateFunction = (Ins
void {{v8_class}}::updateWrapperTypeInfo(InstallTemplateFunction installTemplateFunction, PreparePrototypeAndInterfaceObjectFunction preparePrototypeAndInterfaceObjectFunction) {
{{v8_class}}::install{{v8_class}}TemplateFunction = installTemplateFunction;
if (preparePrototypeAndInterfaceObjectFunction)
- {{v8_class}}::wrapperTypeInfo.preparePrototypeAndInterfaceObjectFunction = preparePrototypeAndInterfaceObjectFunction;
+ {{v8_class}}::wrapperTypeInfo.prepare_prototype_and_interface_object_function = preparePrototypeAndInterfaceObjectFunction;
}
{% for method in methods if method.overloads and method.overloads.has_partial_overloads %}

Powered by Google App Engine
This is Rietveld 408576698