mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
91 lines
4.3 KiB
Diff
91 lines
4.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Michael Wilson <mjwilson@chromium.org>
|
|
Date: Thu, 30 Jan 2025 14:09:57 -0800
|
|
Subject: Remove DenormalEnabler from ScriptProcessorNode
|
|
|
|
This is a follow-up to https://crrev.com/c/6077677
|
|
|
|
After experimenting, ScriptProcessorNode JavaScript is already running
|
|
in a complaint mode so the DenormalEnabler is not necessary.
|
|
|
|
Bug: 382005099
|
|
Change-Id: If9774e60640446c567270a8f065500beecc8a40b
|
|
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6219685
|
|
Commit-Queue: Michael Wilson <mjwilson@chromium.org>
|
|
Reviewed-by: Alvin Ji <alvinji@chromium.org>
|
|
Cr-Commit-Position: refs/heads/main@{#1413754}
|
|
|
|
diff --git a/third_party/blink/renderer/modules/webaudio/script_processor_handler.cc b/third_party/blink/renderer/modules/webaudio/script_processor_handler.cc
|
|
index ea04e2cd2bfb553a58ba6fb9c63c70c5a2690442..d3d44d2a4c87bf5d4191807ec31d87c7e597fef9 100644
|
|
--- a/third_party/blink/renderer/modules/webaudio/script_processor_handler.cc
|
|
+++ b/third_party/blink/renderer/modules/webaudio/script_processor_handler.cc
|
|
@@ -26,7 +26,6 @@
|
|
#include "third_party/blink/renderer/modules/webaudio/base_audio_context.h"
|
|
#include "third_party/blink/renderer/modules/webaudio/realtime_audio_destination_node.h"
|
|
#include "third_party/blink/renderer/modules/webaudio/script_processor_node.h"
|
|
-#include "third_party/blink/renderer/platform/audio/denormal_disabler.h"
|
|
#include "third_party/blink/renderer/platform/bindings/exception_state.h"
|
|
#include "third_party/blink/renderer/platform/scheduler/public/post_cross_thread_task.h"
|
|
#include "third_party/blink/renderer/platform/wtf/cross_thread_copier_base.h"
|
|
@@ -49,9 +48,7 @@ ScriptProcessorHandler::ScriptProcessorHandler(
|
|
internal_input_bus_(AudioBus::Create(
|
|
number_of_input_channels,
|
|
node.context()->GetDeferredTaskHandler().RenderQuantumFrames(),
|
|
- false)),
|
|
- allow_denormal_in_processing_(base::FeatureList::IsEnabled(
|
|
- features::kWebAudioAllowDenormalInProcessing)) {
|
|
+ false)) {
|
|
DCHECK_GE(buffer_size_,
|
|
node.context()->GetDeferredTaskHandler().RenderQuantumFrames());
|
|
DCHECK_LE(number_of_input_channels, BaseAudioContext::MaxNumberOfChannels());
|
|
@@ -112,7 +109,7 @@ void ScriptProcessorHandler::Initialize() {
|
|
AudioHandler::Initialize();
|
|
}
|
|
|
|
-void ScriptProcessorHandler::ProcessInternal(uint32_t frames_to_process) {
|
|
+void ScriptProcessorHandler::Process(uint32_t frames_to_process) {
|
|
TRACE_EVENT_BEGIN0(TRACE_DISABLED_BY_DEFAULT("webaudio.audionode"),
|
|
"ScriptProcessorHandler::Process");
|
|
|
|
@@ -241,15 +238,6 @@ void ScriptProcessorHandler::ProcessInternal(uint32_t frames_to_process) {
|
|
"ScriptProcessorHandler::Process");
|
|
}
|
|
|
|
-void ScriptProcessorHandler::Process(uint32_t frames_to_process) {
|
|
- if (allow_denormal_in_processing_) {
|
|
- DenormalEnabler denormal_enabler;
|
|
- ProcessInternal(frames_to_process);
|
|
- } else {
|
|
- ProcessInternal(frames_to_process);
|
|
- }
|
|
-}
|
|
-
|
|
void ScriptProcessorHandler::FireProcessEvent(uint32_t double_buffer_index) {
|
|
DCHECK(IsMainThread());
|
|
|
|
diff --git a/third_party/blink/renderer/modules/webaudio/script_processor_handler.h b/third_party/blink/renderer/modules/webaudio/script_processor_handler.h
|
|
index 99103e947ade50f07a16a61bc8702d6097266296..78deeb9219e3d5a98ac4d3b5cd4c98dd403407e3 100644
|
|
--- a/third_party/blink/renderer/modules/webaudio/script_processor_handler.h
|
|
+++ b/third_party/blink/renderer/modules/webaudio/script_processor_handler.h
|
|
@@ -66,10 +66,6 @@ class ScriptProcessorHandler final : public AudioHandler {
|
|
const HeapVector<Member<AudioBuffer>>& input_buffers,
|
|
const HeapVector<Member<AudioBuffer>>& output_buffers);
|
|
|
|
- // Used to avoid code duplication when using scoped objects that affect
|
|
- // `Process`.
|
|
- void ProcessInternal(uint32_t frames_to_process);
|
|
-
|
|
double TailTime() const override;
|
|
double LatencyTime() const override;
|
|
bool RequiresTailProcessing() const final;
|
|
@@ -97,9 +93,6 @@ class ScriptProcessorHandler final : public AudioHandler {
|
|
|
|
scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
|
|
|
|
- // Cached feature flag value
|
|
- const bool allow_denormal_in_processing_;
|
|
-
|
|
base::WeakPtrFactory<ScriptProcessorHandler> weak_ptr_factory_{this};
|
|
|
|
FRIEND_TEST_ALL_PREFIXES(ScriptProcessorNodeTest, BufferLifetime);
|