Commit 33b2724e authored by Marina Sakai's avatar Marina Sakai Committed by Commit Bot

Remove a macro-generated function for a private property of Global

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

Bug: 715418
Change-Id: I12c60681dfa521d30dd4ec88f9cc9887e1770541
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1895094Reviewed-by: default avatarHitoshi Yoshida <peria@chromium.org>
Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Marina Sakai <marinasakai@google.com>
Cr-Commit-Position: refs/heads/master@{#711650}
parent e631c948
......@@ -31,6 +31,7 @@
#include "third_party/blink/renderer/bindings/core/v8/v8_window.h"
#include "third_party/blink/renderer/bindings/core/v8/binding_security.h"
#include "third_party/blink/renderer/bindings/core/v8/js_based_event_listener.h"
#include "third_party/blink/renderer/bindings/core/v8/script_controller.h"
#include "third_party/blink/renderer/bindings/core/v8/script_source_code.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h"
......@@ -57,7 +58,6 @@
#include "third_party/blink/renderer/core/typed_arrays/dom_array_buffer.h"
#include "third_party/blink/renderer/platform/bindings/exception_messages.h"
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
#include "third_party/blink/renderer/platform/bindings/v8_private_property.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/wtf/assertions.h"
......@@ -112,7 +112,7 @@ void V8Window::EventAttributeGetterCustom(
}
v8::Local<v8::Value> js_event;
if (!V8PrivateProperty::GetGlobalEvent(isolate)
if (!V8PrivateProperty::GetSymbol(isolate, kPrivatePropertyGlobalEvent)
.GetOrUndefined(info.Holder())
.ToLocal(&js_event)) {
return;
......
......@@ -11,11 +11,13 @@
#include "third_party/blink/renderer/core/dom/document_parser.h"
#include "third_party/blink/renderer/core/dom/events/event.h"
#include "third_party/blink/renderer/core/dom/events/event_target.h"
#include "third_party/blink/renderer/platform/bindings/v8_private_property.h"
#include "third_party/blink/renderer/platform/instrumentation/instance_counters.h"
namespace blink {
// extern
const V8PrivateProperty::SymbolKey kPrivatePropertyGlobalEvent;
JSBasedEventListener::JSBasedEventListener() {
if (IsMainThread()) {
InstanceCounters::IncrementCounter(
......@@ -128,7 +130,7 @@ void JSBasedEventListener::Invoke(
// If tuple’s item-in-shadow-tree is false, then set global’s current event to
// event.
V8PrivateProperty::Symbol event_symbol =
V8PrivateProperty::GetGlobalEvent(isolate);
V8PrivateProperty::GetSymbol(isolate, kPrivatePropertyGlobalEvent);
ExecutionContext* execution_context_of_listener =
ExecutionContext::From(script_state_of_listener);
v8::Local<v8::Value> current_event;
......
......@@ -7,6 +7,7 @@
#include "third_party/blink/renderer/core/core_export.h"
#include "third_party/blink/renderer/core/dom/events/event_listener.h"
#include "third_party/blink/renderer/platform/bindings/v8_private_property.h"
#include "third_party/blink/renderer/platform/wtf/casting.h"
#include "v8/include/v8.h"
......@@ -90,6 +91,8 @@ struct DowncastTraits<JSBasedEventListener> {
}
};
extern const V8PrivateProperty::SymbolKey kPrivatePropertyGlobalEvent;
} // namespace blink
#endif // THIRD_PARTY_BLINK_RENDERER_BINDINGS_CORE_V8_JS_BASED_EVENT_LISTENER_H_
......@@ -25,7 +25,6 @@ class ScriptWrappable;
// Apply |X| for each pair of (InterfaceName, PrivateKeyName).
#define V8_PRIVATE_PROPERTY_FOR_EACH(X) \
X(DOMException, Error) \
X(Global, Event) \
X(MessageEvent, CachedData) \
X(NamedConstructor, Initialized) \
......
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