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

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

Issue 1419313003: Track the script state a listener was created in (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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/custom/V8ErrorEventCustom.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8ErrorEventCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8ErrorEventCustom.cpp
index c85cba2d441cd8ef5355fbb8b39a232642804f4b..94273f0734a43b7fb5d8da0998b884b9a844ee88 100644
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8ErrorEventCustom.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8ErrorEventCustom.cpp
@@ -43,27 +43,28 @@
namespace blink {
-static void setHiddenValueAndReturnValue(const v8::FunctionCallbackInfo<v8::Value>& info, v8::Local<v8::Value> error)
+static void setHiddenValueAndReturnValue(ScriptState* scriptState, const v8::FunctionCallbackInfo<v8::Value>& info, v8::Local<v8::Value> error)
{
- V8HiddenValue::setHiddenValue(info.GetIsolate(), info.Holder(), V8HiddenValue::error(info.GetIsolate()), error);
+ V8HiddenValue::setHiddenValue(scriptState, info.Holder(), V8HiddenValue::error(info.GetIsolate()), error);
v8SetReturnValue(info, error);
}
void V8ErrorEvent::errorAttributeGetterCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
v8::Isolate* isolate = info.GetIsolate();
- v8::Local<v8::Value> cachedError = V8HiddenValue::getHiddenValue(isolate, info.Holder(), V8HiddenValue::error(isolate));
+ v8::Local<v8::Value> cachedError = V8HiddenValue::getHiddenValue(ScriptState::current(isolate), info.Holder(), V8HiddenValue::error(isolate));
if (!cachedError.IsEmpty()) {
v8SetReturnValue(info, cachedError);
return;
}
ErrorEvent* event = V8ErrorEvent::toImpl(info.Holder());
- ScriptValue error = event->error(ScriptState::current(isolate));
+ ScriptState* scriptState = ScriptState::current(isolate);
+ ScriptValue error = event->error(scriptState);
if (!error.isEmpty())
- setHiddenValueAndReturnValue(info, error.v8Value());
+ setHiddenValueAndReturnValue(scriptState, info, error.v8Value());
else
- setHiddenValueAndReturnValue(info, v8::Null(isolate));
+ setHiddenValueAndReturnValue(scriptState, info, v8::Null(isolate));
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698