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

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

Issue 2611823003: ABANDONED CL: Changes to compile and pass tests after Big Blink Rename (excluding functions). (Closed)
Patch Set: Inducing merge conflicts to force human review and changes after rename. Created 3 years, 11 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 f5c4467d013bbe48bc57df7082ca88adc30b0ae1..73c49df7bff4ca94e6fa06c04856c79623a8fe3e 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());
@@ -81,7 +81,7 @@ void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInf
{% 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());
@@ -158,7 +158,7 @@ void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value,
{% 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());
@@ -177,9 +177,9 @@ static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
if (exceptionState.hadException())
return;
{% endif %}
- if (result == DeleteUnknownProperty)
+ if (result == kDeleteUnknownProperty)
return;
- v8SetReturnValue(info, result == DeleteSuccess);
+ v8SetReturnValue(info, result == kDeleteSuccess);
}
{% endif %}
@@ -227,7 +227,7 @@ void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackIn
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());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kGetterContext, "{{interface_name}}", nameInUtf8.data());
{% endif %}
{% if getter.is_call_with_script_state %}
ScriptState* scriptState = ScriptState::forReceiverObject(info);
@@ -277,7 +277,7 @@ void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCal
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());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kSetterContext, "{{interface_name}}", nameInUtf8.data());
{% endif %}
{% if setter.is_call_with_script_state %}
ScriptState* scriptState = ScriptState::forReceiverObject(info);
@@ -347,7 +347,7 @@ void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8::Value>
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());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kDeletionContext, "{{interface_name}}", nameInUtf8.data());
{% endif %}
{% if deleter.is_call_with_script_state %}
ScriptState* scriptState = ScriptState::forReceiverObject(info);
@@ -368,9 +368,9 @@ static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCal
if (exceptionState.hadException())
return;
{% endif %}
- if (result == DeleteUnknownProperty)
+ if (result == kDeleteUnknownProperty)
return;
- v8SetReturnValue(info, result == DeleteSuccess);
+ v8SetReturnValue(info, result == kDeleteSuccess);
}
{% endif %}
@@ -410,7 +410,7 @@ void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::PropertyCa
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());
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kGetterContext, "{{interface_name}}", nameInUtf8.data());
{% if getter.is_call_with_script_state %}
ScriptState* scriptState = ScriptState::forReceiverObject(info);
{% endif %}
@@ -456,7 +456,7 @@ void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::PropertyCall
{% 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());
@@ -501,7 +501,7 @@ 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);
+ ExceptionState exceptionState(info.GetIsolate(), ExceptionState::kSetterContext, "{{interface_name}}", *attributeName);
if (!BindingSecurity::shouldAllowAccessTo(currentDOMWindow(info.GetIsolate()), impl, exceptionState)) {
return;
}
@@ -523,16 +523,16 @@ void {{cpp_class}}OriginSafeMethodSetterCallback(v8::Local<v8::Name> name, v8::L
{% 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, 0, {{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, 0, {{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
@@ -561,7 +561,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. #}
@@ -633,14 +633,14 @@ void {{v8_class}}::visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* script
{% 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}}"));
return;
}
- if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::WrapExistingObject) {
+ if (ConstructorMode::current(info.GetIsolate()) == ConstructorMode::kWrapExistingObject) {
v8SetReturnValue(info, info.Holder());
return;
}
@@ -681,7 +681,7 @@ 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, v8::DEFAULT, {{property_attribute}}, {{property_location(method)}}, {{holder_check}}
};
@@ -801,14 +801,14 @@ v8::Local<v8::Object> {{v8_class}}::findInstanceInPrototypeChain(v8::Local<v8::V
if (v8buffer->IsExternal()) {
const WrapperTypeInfo* wrapperTypeInfo = toWrapperTypeInfo(object);
CHECK(wrapperTypeInfo);
- CHECK_EQ(wrapperTypeInfo->ginEmbedder, gin::kEmbedderBlink);
+ 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);
+ 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->wrapperTypeInfo(), object);
DCHECK(associatedWrapper == object);
@@ -952,7 +952,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