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

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

Issue 2851053002: Fix detached event listener attribute updating. (Closed)
Patch Set: Push Document lookup down Created 3 years, 8 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/V8AbstractEventListener.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp
index f37c4371737d9f5b7e06eff8289acb743fc36895..45fa39bd1a223062c8bb5feb21fc313d750e3a2c 100644
--- a/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/V8AbstractEventListener.cpp
@@ -198,16 +198,15 @@ v8::Local<v8::Object> V8AbstractEventListener::GetReceiverObject(
}
bool V8AbstractEventListener::BelongsToTheCurrentWorld(
- ExecutionContext* execution_context) const {
+ Document* document) const {
if (!GetIsolate()->GetCurrentContext().IsEmpty() &&
&World() == &DOMWrapperWorld::Current(GetIsolate()))
return true;
// If currently parsing, the parser could be accessing this listener
// outside of any v8 context; check if it belongs to the main world.
- if (!GetIsolate()->InContext() && execution_context->IsDocument()) {
- Document* document = ToDocument(execution_context);
- if (document->Parser() && document->Parser()->IsParsing())
- return World().IsMainWorld();
+ if (!GetIsolate()->InContext() && document && document->Parser() &&
+ document->Parser()->IsParsing()) {
+ return World().IsMainWorld();
}
return false;
}

Powered by Google App Engine
This is Rietveld 408576698