Commit 7c275cad authored by Marina Sakai's avatar Marina Sakai Committed by Commit Bot

Rename all the const variables of V8PrivateProperty::SymbolKey

The name of const variables should be "k{{camel case name}}".
This CL follows the style.


Bug: 715418
Change-Id: I54c37152cebee1a863fceabb685480cdf08f93f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893603Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Marina Sakai <marinasakai@google.com>
Cr-Commit-Position: refs/heads/master@{#711664}
parent dfd0e0a0
......@@ -146,7 +146,6 @@ def attribute_context(interface, attribute, interfaces, component_info):
use_private_property_in_getter and
use_private_property_in_setter
)
private_property_key_name = create_private_property_key_name(attribute)
does_use_private_property = (
use_private_property_in_getter or
......@@ -240,7 +239,6 @@ def attribute_context(interface, attribute, interfaces, component_info):
'origin_trial_feature_name':
v8_utilities.origin_trial_feature_name(attribute, runtime_features), # [RuntimeEnabled] for origin trial
'private_property_is_shared_between_getter_and_setter': private_property_is_shared_between_getter_and_setter,
'private_property_key_name': private_property_key_name,
'property_attributes': property_attributes(interface, attribute),
'reflect_empty': extended_attributes.get('ReflectEmpty'),
'reflect_invalid': extended_attributes.get('ReflectInvalid', ''),
......@@ -277,10 +275,6 @@ def attribute_context(interface, attribute, interfaces, component_info):
return context
def create_private_property_key_name(attribute):
return NameStyleConverter(attribute.name + '_key').to_snake_case()
def runtime_call_stats_context(interface, attribute, context):
includes.add('platform/bindings/runtime_call_stats.h')
generic_counter_name = 'Blink_' + v8_utilities.cpp_name(interface) + '_' + attribute.name
......
......@@ -41,9 +41,9 @@ const v8::FunctionCallbackInfo<v8::Value>& info
{% if attribute.is_save_same_object %}
// [SaveSameObject]
static const V8PrivateProperty::SymbolKey save_same_object_key;
static const V8PrivateProperty::SymbolKey kSaveSameObjectKey;
auto private_same_object =
V8PrivateProperty::GetSymbol(info.GetIsolate(), save_same_object_key);
V8PrivateProperty::GetSymbol(info.GetIsolate(), kSaveSameObjectKey);
{
v8::Local<v8::Value> v8_value;
if (private_same_object.GetOrUndefined(holder).ToLocal(&v8_value) && !v8_value->IsUndefined()) {
......@@ -76,12 +76,12 @@ const v8::FunctionCallbackInfo<v8::Value>& info
V8PrivateProperty::GetHistoryStateSymbol(info.GetIsolate());
{% else %}
{% if not attribute.private_property_is_shared_between_getter_and_setter %}
static const V8PrivateProperty::SymbolKey {{attribute.private_property_key_name}};
static const V8PrivateProperty::SymbolKey kPrivateProperty{{attribute.camel_case_name}};
{% endif %}
V8PrivateProperty::Symbol property_symbol =
V8PrivateProperty::GetSymbol(info.GetIsolate(),
{{attribute.private_property_key_name}});
kPrivateProperty{{attribute.camel_case_name}});
{% endif %}
if (!static_cast<const {{cpp_class}}*>(impl)->{{attribute.cached_attribute_validation_method}}()) {
v8::Local<v8::Value> v8_value;
......@@ -182,8 +182,8 @@ const v8::FunctionCallbackInfo<v8::Value>& info
if ({{attribute.cpp_value}} && DOMDataStore::SetReturnValue{{world_suffix}}(info.GetReturnValue(), {{attribute.cpp_value_to_script_wrappable}}))
return;
v8::Local<v8::Value> v8_value(ToV8({{attribute.cpp_value_to_script_wrappable}}, holder, info.GetIsolate()));
static const V8PrivateProperty::SymbolKey keep_alive_key;
V8PrivateProperty::GetSymbol(info.GetIsolate(), keep_alive_key)
static const V8PrivateProperty::SymbolKey kKeepAliveKey;
V8PrivateProperty::GetSymbol(info.GetIsolate(), kKeepAliveKey)
.Set(holder, v8_value);
{% endif %}
......@@ -472,7 +472,7 @@ static void {{attribute.camel_case_name}}AttributeSetter{{world_suffix}}(
// Invalidate the cached value.
V8PrivateProperty::GetSymbol(
isolate,
{{attribute.private_property_key_name}})
kPrivateProperty{{attribute.camel_case_name}})
.DeleteProperty(holder, v8::Undefined(isolate));
{% endif %}
{% endif %}{# attribute.is_put_forwards #}
......
......@@ -92,7 +92,7 @@ static void (*{{method.name}}MethodForPartialInterface)(const v8::FunctionCallba
{% for world_suffix in attribute.world_suffixes %}
{% if attribute.private_property_is_shared_between_getter_and_setter %}
// Define a private property key shared between getter and setter.
static const V8PrivateProperty::SymbolKey {{attribute.private_property_key_name}};
static const V8PrivateProperty::SymbolKey k{{attribute.camel_case_name}};
{% endif %}
{% if attribute.does_generate_getter %}
......
......@@ -152,8 +152,8 @@ class PLATFORM_EXPORT V8PrivateProperty {
// This is a hack for PopStateEvent to get the same private property of
// History, named State.
static Symbol GetHistoryStateSymbol(v8::Isolate* isolate) {
static const SymbolKey private_property_key;
return GetSymbol(isolate, private_property_key);
static const SymbolKey kPrivatePropertyKey;
return GetSymbol(isolate, kPrivatePropertyKey);
}
// Returns a Symbol to access a private property. Symbol instances from same
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment