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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp

Issue 2683993003: Move toEventTarget to EventTarget (Closed)
Patch Set: Inline toEventTarget in V8Binding::toEventTarget 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/bindings/core/v8/V8Binding.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
index 2511fed997fea08cadb67a20585b8969ea65230d..8df616db64ac390ada680866c0801f65b3a9562d 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8Binding.cpp
@@ -796,12 +796,16 @@ EventTarget* toEventTarget(v8::Isolate* isolate, v8::Local<v8::Value> value) {
// We need to handle a DOMWindow specially, because a DOMWindow wrapper
// exists on a prototype chain of v8Value.
if (DOMWindow* window = toDOMWindow(isolate, value))
- return static_cast<EventTarget*>(window);
+ return window;
if (V8EventTarget::hasInstance(value, isolate)) {
v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(value);
- return toWrapperTypeInfo(object)->toEventTarget(object);
+ const WrapperTypeInfo* wrapperTypeInfo = toWrapperTypeInfo(object);
+ if (wrapperTypeInfo->eventTargetInheritance ==
+ WrapperTypeInfo::NotInheritFromEventTarget)
+ return nullptr;
+ return static_cast<EventTarget*>(toScriptWrappable(object));
}
- return 0;
+ return nullptr;
}
void toFlexibleArrayBufferView(v8::Isolate* isolate,

Powered by Google App Engine
This is Rietveld 408576698