Commit 3706d6bd authored by Marina Sakai's avatar Marina Sakai Committed by Commit Bot

Remove macro-generated functions for private properties of CustomElementLifecycle

This CL removes macro-generated fucntions for private properties of CustomElementLifecycle, and replaces them with the new API GetSymbol, which uses an instance address of V8PrivateProperty::SymbolKey as a key to get Symbol.

Bug: 715418
Change-Id: If4cd6487c11e4999f2165bf1ea684c573465a248
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1892315
Commit-Queue: Marina Sakai <marinasakai@google.com>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711186}
parent 049b7ef8
......@@ -60,14 +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) \
V8PrivateProperty::Symbol symbol##Name = \
V8PrivateProperty::GetCustomElementLifecycle##Name(isolate); \
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 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); \
}
CALLBACK_LIST(SET_PRIVATE_PROPERTY)
......
......@@ -24,10 +24,6 @@ class ScriptWrappable;
// e.g. IDBCursor.Request.
// Apply |X| for each pair of (InterfaceName, PrivateKeyName).
#define V8_PRIVATE_PROPERTY_FOR_EACH(X) \
X(CustomElementLifecycle, AttachedCallback) \
X(CustomElementLifecycle, AttributeChangedCallback) \
X(CustomElementLifecycle, CreatedCallback) \
X(CustomElementLifecycle, DetachedCallback) \
X(DOMException, Error) \
X(Global, Event) \
X(IDBCursor, Request) \
......
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