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; |
} |