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

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

Issue 2849373002: Stop storing ScriptValue in MessageEvent (Closed)
Patch Set: Fix tests Created 3 years, 7 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/events/MessageEvent.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp
diff --git a/third_party/WebKit/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp b/third_party/WebKit/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp
index 1a228b44a5a7c087598309f5c9fece7feb010d4a..cd59229595250d5a75b69baf6dcf3ade955bdf90 100644
--- a/third_party/WebKit/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/custom/V8MessageEventCustom.cpp
@@ -55,12 +55,12 @@ void V8MessageEvent::dataAttributeGetterCustom(
}
MessageEvent* event = V8MessageEvent::toImpl(info.Holder());
+ ScriptState* script_state = ScriptState::Current(isolate);
v8::Local<v8::Value> result;
switch (event->GetDataType()) {
- case MessageEvent::kDataTypeScriptValue:
- result =
- event->DataAsScriptValue().V8ValueFor(ScriptState::Current(isolate));
+ case MessageEvent::kDataTypeV8Reference:
+ result = event->DataAsScriptValue(script_state).V8Value();
if (result.IsEmpty())
result = v8::Null(isolate);
break;
@@ -126,10 +126,11 @@ void V8MessageEvent::initMessageEventMethodCustom(
if (exception_state.HadException())
return;
}
- event->initMessageEvent(
- type_arg, can_bubble_arg, cancelable_arg,
- ScriptValue(ScriptState::Current(info.GetIsolate()), data_arg),
- origin_arg, last_event_id_arg, source_arg, port_array);
+ ScriptState* script_state = ScriptState::Current(info.GetIsolate());
+ event->initMessageEvent(script_state, type_arg, can_bubble_arg,
+ cancelable_arg, ScriptValue(script_state, data_arg),
+ origin_arg, last_event_id_arg, source_arg,
+ port_array);
}
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/events/MessageEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698