From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 25 Mar 2018 21:49:37 +0200
Subject: AudioBuffer, AnalyserNode: fp mitigations

Truncate base latency precision to two digits

License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
 .../blink/renderer/modules/webaudio/analyser_node.idl     | 8 ++++----
 .../blink/renderer/modules/webaudio/audio_buffer.idl      | 6 ------
 .../blink/renderer/modules/webaudio/audio_context.cc      | 4 +++-
 3 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/third_party/blink/renderer/modules/webaudio/analyser_node.idl b/third_party/blink/renderer/modules/webaudio/analyser_node.idl
--- a/third_party/blink/renderer/modules/webaudio/analyser_node.idl
+++ b/third_party/blink/renderer/modules/webaudio/analyser_node.idl
@@ -40,10 +40,10 @@
 
     // Copies the current frequency data into the passed array.
     // If the array has fewer elements than the frequencyBinCount, the excess elements will be dropped.
-    [HighEntropy, Measure] void getFloatFrequencyData(Float32Array array);
-    [HighEntropy, Measure] void getByteFrequencyData(Uint8Array array);
+    //[HighEntropy, Measure] void getFloatFrequencyData(Float32Array array);
+    //[HighEntropy, Measure] void getByteFrequencyData(Uint8Array array);
 
     // Real-time waveform data
-    [HighEntropy, Measure] void getFloatTimeDomainData(Float32Array array);
-    [HighEntropy, Measure] void getByteTimeDomainData(Uint8Array array);
+    //[HighEntropy, Measure] void getFloatTimeDomainData(Float32Array array);
+    //[HighEntropy, Measure] void getByteTimeDomainData(Uint8Array array);
 };
diff --git a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
--- a/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
+++ b/third_party/blink/renderer/modules/webaudio/audio_buffer.idl
@@ -37,12 +37,6 @@
 
     // Channel access
     readonly attribute unsigned long numberOfChannels;
-    [HighEntropy=Direct, Measure, RaisesException] Float32Array getChannelData(
-        unsigned long channelIndex);
-    [HighEntropy, Measure, RaisesException] void copyFromChannel(
-        Float32Array destination,
-        unsigned long channelNumber,
-        optional unsigned long bufferOffset = 0);
     [RaisesException] void copyToChannel(
         Float32Array source,
         unsigned long channelNumber,
diff --git a/third_party/blink/renderer/modules/webaudio/audio_context.cc b/third_party/blink/renderer/modules/webaudio/audio_context.cc
--- a/third_party/blink/renderer/modules/webaudio/audio_context.cc
+++ b/third_party/blink/renderer/modules/webaudio/audio_context.cc
@@ -508,7 +508,9 @@ double AudioContext::baseLatency() const {
   DCHECK(IsMainThread());
   DCHECK(destination());
 
-  return base_latency_;
+  // remove precision past two decimal digits
+  int l = base_latency_ * 100;
+  return double(l)/100;
 }
 
 double AudioContext::outputLatency() const {
--
2.25.1
