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

Unified Diff: third_party/WebKit/Source/core/events/EventTarget.cpp

Issue 2683993003: Move toEventTarget to EventTarget (Closed)
Patch Set: Format, remove header Created 3 years, 10 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/core/events/EventTarget.cpp
diff --git a/third_party/WebKit/Source/core/events/EventTarget.cpp b/third_party/WebKit/Source/core/events/EventTarget.cpp
index 427a8d917dc407f1f8f605423bffd08c5a9c1975..0e69098d272f67988352058bfc3149d7b4c0ef9a 100644
--- a/third_party/WebKit/Source/core/events/EventTarget.cpp
+++ b/third_party/WebKit/Source/core/events/EventTarget.cpp
@@ -737,6 +737,15 @@ DispatchEventResult EventTarget::dispatchEventResult(const Event& event) {
return DispatchEventResult::NotCanceled;
}
+// static
+EventTarget* EventTarget::toEventTarget(v8::Local<v8::Object> object) {
+ const WrapperTypeInfo* wrapperTypeInfo = toWrapperTypeInfo(object);
+ if (wrapperTypeInfo->eventTargetInheritance ==
+ WrapperTypeInfo::NotInheritFromEventTarget)
+ return nullptr;
+ return static_cast<EventTarget*>(toScriptWrappable(object));
+}
+
EventListenerVector* EventTarget::getEventListeners(
const AtomicString& eventType) {
EventTargetData* data = eventTargetData();

Powered by Google App Engine
This is Rietveld 408576698