Commit cdcce704 authored by Marina Sakai's avatar Marina Sakai Committed by Commit Bot

Rename V8PrivateProperty::SymbolKey variables

"kPrivatePropertyXXX" should be much easire to understand what the variables are for those who are not experts of bindings than "kSymbolKeyXXX".
So, this CL renames the keys.

Bug: 715418
Change-Id: I81d1a840a252184f80c6b4ddf61079fbe144a51f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1893597Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Commit-Queue: Marina Sakai <marinasakai@google.com>
Cr-Commit-Position: refs/heads/master@{#711626}
parent d2fe3087
......@@ -39,8 +39,8 @@
namespace blink {
const V8PrivateProperty::SymbolKey kSymbolKeyPort1;
const V8PrivateProperty::SymbolKey kSymbolKeyPort2;
const V8PrivateProperty::SymbolKey kPrivatePropertyPort1;
const V8PrivateProperty::SymbolKey kPrivatePropertyPort2;
void V8MessageChannel::ConstructorCustom(
const v8::FunctionCallbackInfo<v8::Value>& info) {
......@@ -54,9 +54,9 @@ void V8MessageChannel::ConstructorCustom(
// Create references from the MessageChannel wrapper to the two
// MessagePort wrappers to make sure that the MessagePort wrappers
// stay alive as long as the MessageChannel wrapper is around.
V8PrivateProperty::GetSymbol(isolate, kSymbolKeyPort1)
V8PrivateProperty::GetSymbol(isolate, kPrivatePropertyPort1)
.Set(wrapper, ToV8(channel->port1(), wrapper, isolate));
V8PrivateProperty::GetSymbol(isolate, kSymbolKeyPort2)
V8PrivateProperty::GetSymbol(isolate, kPrivatePropertyPort2)
.Set(wrapper, ToV8(channel->port2(), wrapper, isolate));
V8SetReturnValue(info, V8DOMWrapper::AssociateObjectWithWrapper(
......
......@@ -54,11 +54,11 @@
namespace blink {
const V8PrivateProperty::SymbolKey kSymbolKeyDocument;
const V8PrivateProperty::SymbolKey kSymbolKeyIsInterfacePrototypeObject;
const V8PrivateProperty::SymbolKey kSymbolKeyNamespaceURI;
const V8PrivateProperty::SymbolKey kSymbolKeyTagName;
const V8PrivateProperty::SymbolKey kSymbolKeyType;
const V8PrivateProperty::SymbolKey kPrivatePropertyDocument;
const V8PrivateProperty::SymbolKey kPrivatePropertyIsInterfacePrototypeObject;
const V8PrivateProperty::SymbolKey kPrivatePropertyNamespaceURI;
const V8PrivateProperty::SymbolKey kPrivatePropertyTagName;
const V8PrivateProperty::SymbolKey kPrivatePropertyType;
static void ConstructCustomElement(const v8::FunctionCallbackInfo<v8::Value>&);
......@@ -205,13 +205,14 @@ bool V0CustomElementConstructorBuilder::CreateConstructor(
v8_type = v8::Null(isolate);
v8::Local<v8::Object> data = v8::Object::New(isolate);
V8PrivateProperty::GetSymbol(isolate, kSymbolKeyDocument)
V8PrivateProperty::GetSymbol(isolate, kPrivatePropertyDocument)
.Set(data, ToV8(document, context->Global(), isolate));
V8PrivateProperty::GetSymbol(isolate, kSymbolKeyNamespaceURI)
V8PrivateProperty::GetSymbol(isolate, kPrivatePropertyNamespaceURI)
.Set(data, V8String(isolate, descriptor.NamespaceURI()));
V8PrivateProperty::GetSymbol(isolate, kSymbolKeyTagName)
V8PrivateProperty::GetSymbol(isolate, kPrivatePropertyTagName)
.Set(data, v8_tag_name);
V8PrivateProperty::GetSymbol(isolate, kSymbolKeyType).Set(data, v8_type);
V8PrivateProperty::GetSymbol(isolate, kPrivatePropertyType)
.Set(data, v8_type);
v8::Local<v8::FunctionTemplate> constructor_template =
v8::FunctionTemplate::New(isolate);
......@@ -273,7 +274,8 @@ bool V0CustomElementConstructorBuilder::CreateConstructor(
return false;
}
V8PrivateProperty::GetSymbol(isolate, kSymbolKeyIsInterfacePrototypeObject)
V8PrivateProperty::GetSymbol(isolate,
kPrivatePropertyIsInterfacePrototypeObject)
.Set(prototype_, v8::True(isolate));
bool configured_constructor;
......@@ -296,7 +298,7 @@ bool V0CustomElementConstructorBuilder::PrototypeIsValid(
if (prototype_->InternalFieldCount() ||
V8PrivateProperty::GetSymbol(isolate,
kSymbolKeyIsInterfacePrototypeObject)
kPrivatePropertyIsInterfacePrototypeObject)
.HasValue(prototype_)) {
V0CustomElementException::ThrowException(
V0CustomElementException::kPrototypeInUse, type, exception_state);
......@@ -364,14 +366,14 @@ static void ConstructCustomElement(
v8::Local<v8::Object> data = v8::Local<v8::Object>::Cast(info.Data());
v8::Local<v8::Value> document_value;
if (!V8PrivateProperty::GetSymbol(isolate, kSymbolKeyDocument)
if (!V8PrivateProperty::GetSymbol(isolate, kPrivatePropertyDocument)
.GetOrUndefined(data)
.ToLocal(&document_value)) {
return;
}
Document* document = V8Document::ToImpl(document_value.As<v8::Object>());
v8::Local<v8::Value> namespace_uri_value;
if (!V8PrivateProperty::GetSymbol(isolate, kSymbolKeyNamespaceURI)
if (!V8PrivateProperty::GetSymbol(isolate, kPrivatePropertyNamespaceURI)
.GetOrUndefined(data)
.ToLocal(&namespace_uri_value) ||
namespace_uri_value->IsUndefined()) {
......@@ -379,7 +381,7 @@ static void ConstructCustomElement(
}
TOSTRING_VOID(V8StringResource<>, namespace_uri, namespace_uri_value);
v8::Local<v8::Value> tag_name_value;
if (!V8PrivateProperty::GetSymbol(isolate, kSymbolKeyTagName)
if (!V8PrivateProperty::GetSymbol(isolate, kPrivatePropertyTagName)
.GetOrUndefined(data)
.ToLocal(&tag_name_value) ||
tag_name_value->IsUndefined()) {
......@@ -387,7 +389,7 @@ static void ConstructCustomElement(
}
TOSTRING_VOID(V8StringResource<>, tag_name, tag_name_value);
v8::Local<v8::Value> maybe_type;
if (!V8PrivateProperty::GetSymbol(isolate, kSymbolKeyType)
if (!V8PrivateProperty::GetSymbol(isolate, kPrivatePropertyType)
.GetOrUndefined(data)
.ToLocal(&maybe_type) ||
maybe_type->IsUndefined()) {
......
......@@ -60,15 +60,15 @@ V8V0CustomElementLifecycleCallbacks::Create(
// A given object can only be used as a Custom Element prototype
// once; see customElementIsInterfacePrototypeObject
#define SET_PRIVATE_PROPERTY(Maybe, Name) \
static const V8PrivateProperty::SymbolKey kSymbolKey##Name; \
V8PrivateProperty::Symbol symbol##Name = \
V8PrivateProperty::GetSymbol(isolate, kSymbolKey##Name); \
DCHECK(!symbol##Name.HasValue(prototype)); \
{ \
v8::Local<v8::Function> function; \
if (Maybe.ToLocal(&function)) \
symbol##Name.Set(prototype, function); \
#define SET_PRIVATE_PROPERTY(Maybe, Name) \
static const V8PrivateProperty::SymbolKey kPrivateProperty##Name; \
V8PrivateProperty::Symbol symbol##Name = \
V8PrivateProperty::GetSymbol(isolate, kPrivateProperty##Name); \
DCHECK(!symbol##Name.HasValue(prototype)); \
{ \
v8::Local<v8::Function> function; \
if (Maybe.ToLocal(&function)) \
symbol##Name.Set(prototype, function); \
}
CALLBACK_LIST(SET_PRIVATE_PROPERTY)
......
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