Commit fef049ce authored by Adam Rice's avatar Adam Rice Committed by Commit Bot

Don't enable transferable streams for AudioWorklet

AudioWorklet has "MessagePort" on the global object but not
"DOMException". The V8 Extras transferable streams implementation needs
"DOMException" to be on the global object so that it can copy it to the
bindings object and construct a DOMException when an object cannot be
cloned.

Disable transferable streams for audio worklet by not copying
"MessagePort" to the bindings object.

BUG=894838,910471

Change-Id: Ia3bd3a5610d4aa442671fab1c1dc9f20c5c4c5e9
Reviewed-on: https://chromium-review.googlesource.com/c/1356462Reviewed-by: default avatarYuki Shiino <yukishiino@chromium.org>
Reviewed-by: default avatarYutaka Hirano <yhirano@chromium.org>
Commit-Queue: Adam Rice <ricea@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612618}
parent 06537480
...@@ -131,10 +131,12 @@ void AddOriginals(ScriptState* script_state, v8::Local<v8::Object> binding) { ...@@ -131,10 +131,12 @@ void AddOriginals(ScriptState* script_state, v8::Local<v8::Object> binding) {
}; };
v8::Local<v8::Value> message_port = ObjectGet(global, "MessagePort"); v8::Local<v8::Value> message_port = ObjectGet(global, "MessagePort");
v8::Local<v8::Value> dom_exception = ObjectGet(global, "DOMException");
// Some Worklets don't have MessagePort. In this case, serialization will // Most Worklets don't have MessagePort. In this case, serialization will
// be disabled. // fail. AudioWorklet has MessagePort but no DOMException, so it can't use
if (message_port->IsUndefined()) // serialization for now.
if (message_port->IsUndefined() || dom_exception->IsUndefined())
return; return;
v8::Local<v8::Value> event_target_prototype = v8::Local<v8::Value> event_target_prototype =
...@@ -153,7 +155,6 @@ void AddOriginals(ScriptState* script_state, v8::Local<v8::Object> binding) { ...@@ -153,7 +155,6 @@ void AddOriginals(ScriptState* script_state, v8::Local<v8::Object> binding) {
Bind("MessageEvent_data_get", GetOwnPDGet(message_event_prototype, "data")); Bind("MessageEvent_data_get", GetOwnPDGet(message_event_prototype, "data"));
v8::Local<v8::Value> dom_exception = ObjectGet(global, "DOMException");
Bind("DOMException", dom_exception); Bind("DOMException", dom_exception);
v8::Local<v8::Value> dom_exception_prototype = GetPrototype(dom_exception); v8::Local<v8::Value> dom_exception_prototype = GetPrototype(dom_exception);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment