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

Unified Diff: third_party/WebKit/Source/bindings/modules/v8/custom/V8ServiceWorkerMessageEventCustom.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/modules/v8/custom/V8ServiceWorkerMessageEventCustom.cpp
diff --git a/third_party/WebKit/Source/bindings/modules/v8/custom/V8ServiceWorkerMessageEventCustom.cpp b/third_party/WebKit/Source/bindings/modules/v8/custom/V8ServiceWorkerMessageEventCustom.cpp
index 5746d7ef35db2f0f3f8bd7ccc6d81b3b9b1afa84..ddc53b5765f03f42358ff26cad4df65cd77e0046 100644
--- a/third_party/WebKit/Source/bindings/modules/v8/custom/V8ServiceWorkerMessageEventCustom.cpp
+++ b/third_party/WebKit/Source/bindings/modules/v8/custom/V8ServiceWorkerMessageEventCustom.cpp
@@ -14,7 +14,8 @@ void V8ServiceWorkerMessageEvent::dataAttributeGetterCustom(const v8::FunctionCa
{
ServiceWorkerMessageEvent* event = V8ServiceWorkerMessageEvent::toImpl(info.Holder());
v8::Isolate* isolate = info.GetIsolate();
- v8::Local<v8::Value> result = V8HiddenValue::getHiddenValue(isolate, info.Holder(), V8HiddenValue::data(isolate));
+ ScriptState* scriptState = ScriptState::current(isolate);
+ v8::Local<v8::Value> result = V8HiddenValue::getHiddenValue(scriptState, info.Holder(), V8HiddenValue::data(isolate));
if (!result.IsEmpty()) {
v8SetReturnValue(info, result);
@@ -26,11 +27,11 @@ void V8ServiceWorkerMessageEvent::dataAttributeGetterCustom(const v8::FunctionCa
MessagePortArray ports = event->ports();
data = serializedValue->deserialize(isolate, &ports);
} else {
- data = event->data().v8ValueFor(ScriptState::current(isolate));
+ data = event->data().v8ValueFor(scriptState);
}
if (data.IsEmpty())
data = v8::Null(isolate);
- V8HiddenValue::setHiddenValue(isolate, info.Holder(), V8HiddenValue::data(isolate), data);
+ V8HiddenValue::setHiddenValue(scriptState, info.Holder(), V8HiddenValue::data(isolate), data);
v8SetReturnValue(info, data);
}

Powered by Google App Engine
This is Rietveld 408576698