Bug 1613147 - Console API on worker dispatches messages to the main-thread behind prefs, r=asuth

Differential Revision: https://phabricator.services.mozilla.com/D61578

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andrea Marchesini 2020-02-04 16:04:08 +00:00
parent 3a88855e32
commit 79a7598f57
2 changed files with 12 additions and 3 deletions

View file

@ -1573,9 +1573,11 @@ void Console::MethodInternal(JSContext* aCx, MethodName aMethodName,
// We do this only in workers for now.
NotifyHandler(aCx, aData, callData);
RefPtr<ConsoleCallDataWorkerRunnable> runnable =
new ConsoleCallDataWorkerRunnable(this, callData);
Unused << NS_WARN_IF(!runnable->Dispatch(aCx));
if (StaticPrefs::dom_worker_console_dispatch_events_to_main_thread()) {
RefPtr<ConsoleCallDataWorkerRunnable> runnable =
new ConsoleCallDataWorkerRunnable(this, callData);
Unused << NS_WARN_IF(!runnable->Dispatch(aCx));
}
}
// We store information to lazily compute the stack in the reserved slots of

View file

@ -2910,6 +2910,13 @@
value: true
mirror: always
# Enables the dispatching of console log events from worker threads to the
# main-thread.
- name: dom.worker.console.dispatch_events_to_main_thread
type: RelaxedAtomicBool
value: true
mirror: always
- name: dom.worklet.enabled
type: bool
value: false