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

Unified Diff: Source/bindings/core/v8/V8ErrorHandler.cpp

Issue 823263002: ScriptState used by EventListener::handleEvent() is wrong (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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: Source/bindings/core/v8/V8ErrorHandler.cpp
diff --git a/Source/bindings/core/v8/V8ErrorHandler.cpp b/Source/bindings/core/v8/V8ErrorHandler.cpp
index 1fd00bc1c5b926ac062e65044fc65379f779aee7..f482e4873c3fb080343ade5d5e2d20a8d79eec7a 100644
--- a/Source/bindings/core/v8/V8ErrorHandler.cpp
+++ b/Source/bindings/core/v8/V8ErrorHandler.cpp
@@ -47,21 +47,20 @@ V8ErrorHandler::V8ErrorHandler(v8::Local<v8::Object> listener, bool isInline, Sc
{
}
-v8::Local<v8::Value> V8ErrorHandler::callListenerFunction(v8::Handle<v8::Value> jsEvent, Event* event)
+v8::Local<v8::Value> V8ErrorHandler::callListenerFunction(ScriptState* scriptState, v8::Handle<v8::Value> jsEvent, Event* event)
{
if (!event->hasInterface(EventNames::ErrorEvent))
- return V8EventListener::callListenerFunction(jsEvent, event);
+ return V8EventListener::callListenerFunction(scriptState, jsEvent, event);
ErrorEvent* errorEvent = static_cast<ErrorEvent*>(event);
-
if (errorEvent->world() && errorEvent->world() != &world())
return v8::Null(isolate());
- v8::Local<v8::Object> listener = getListenerObject(scriptState()->executionContext());
+ v8::Local<v8::Object> listener = getListenerObject(scriptState->executionContext());
v8::Local<v8::Value> returnValue;
if (!listener.IsEmpty() && listener->IsFunction()) {
v8::Local<v8::Function> callFunction = v8::Local<v8::Function>::Cast(listener);
- v8::Local<v8::Object> thisValue = scriptState()->context()->Global();
+ v8::Local<v8::Object> thisValue = scriptState->context()->Global();
v8::Local<v8::Value> error = V8HiddenValue::getHiddenValue(isolate(), jsEvent->ToObject(isolate()), V8HiddenValue::error(isolate()));
if (error.IsEmpty())
@@ -70,10 +69,10 @@ v8::Local<v8::Value> V8ErrorHandler::callListenerFunction(v8::Handle<v8::Value>
v8::Handle<v8::Value> parameters[5] = { v8String(isolate(), errorEvent->message()), v8String(isolate(), errorEvent->filename()), v8::Integer::New(isolate(), errorEvent->lineno()), v8::Integer::New(isolate(), errorEvent->colno()), error };
v8::TryCatch tryCatch;
tryCatch.SetVerbose(true);
- if (scriptState()->executionContext()->isWorkerGlobalScope())
- returnValue = V8ScriptRunner::callFunction(callFunction, scriptState()->executionContext(), thisValue, WTF_ARRAY_LENGTH(parameters), parameters, isolate());
+ if (scriptState->executionContext()->isWorkerGlobalScope())
+ returnValue = V8ScriptRunner::callFunction(callFunction, scriptState->executionContext(), thisValue, WTF_ARRAY_LENGTH(parameters), parameters, isolate());
else
- returnValue = ScriptController::callFunction(scriptState()->executionContext(), callFunction, thisValue, WTF_ARRAY_LENGTH(parameters), parameters, isolate());
+ returnValue = ScriptController::callFunction(scriptState->executionContext(), callFunction, thisValue, WTF_ARRAY_LENGTH(parameters), parameters, isolate());
}
return returnValue;
}

Powered by Google App Engine
This is Rietveld 408576698