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

Unified Diff: third_party/WebKit/Source/modules/webaudio/PannerNode.cpp

Issue 1978403004: Add UMA histograms for WebAudio (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
Index: third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp b/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
index 5754b0cf59ad26bab5003361c26dd4994dc3ab73..d74b06453ba8afe6fbbf82743434184353f0a743 100644
--- a/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/PannerNode.cpp
@@ -31,6 +31,7 @@
#include "modules/webaudio/AudioBufferSourceNode.h"
#include "modules/webaudio/AudioNodeInput.h"
#include "modules/webaudio/AudioNodeOutput.h"
+#include "platform/Histogram.h"
#include "platform/audio/HRTFPanner.h"
#include "wtf/MathExtras.h"
@@ -52,7 +53,6 @@ PannerHandler::PannerHandler(
AudioParamHandler& orientationZ)
: AudioHandler(NodeTypePanner, node, sampleRate)
, m_listener(node.context()->listener())
- , m_panningModel(Panner::PanningModelEqualPower)
, m_distanceModel(DistanceEffect::ModelInverse)
, m_isAzimuthElevationDirty(true)
, m_isDistanceConeGainDirty(true)
@@ -79,6 +79,10 @@ PannerHandler::PannerHandler(
m_channelCountMode = ClampedMax;
m_channelInterpretation = AudioBus::Speakers;
+ // Explicitly set the default panning model here so that the histograms
+ // include the default value.
+ setPanningModel("equalpower");
+
initialize();
}
@@ -279,6 +283,9 @@ void PannerHandler::setPanningModel(const String& model)
bool PannerHandler::setPanningModel(unsigned model)
{
+ DEFINE_STATIC_LOCAL(SparseHistogram, panningModelHistogram, ("WebAudio.PannerNode.PanningModel"));
+ panningModelHistogram.sample(model);
+
switch (model) {
case Panner::PanningModelEqualPower:
case Panner::PanningModelHRTF:

Powered by Google App Engine
This is Rietveld 408576698