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

Unified Diff: third_party/WebKit/Source/modules/webaudio/AudioContext.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/AudioContext.cpp
diff --git a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp
index e45fbf22d878e21d2aca2e1e491cee4fa2fc6e2d..9cca6e0f9f456148eda89b0dee62b58b552b35c8 100644
--- a/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp
+++ b/third_party/WebKit/Source/modules/webaudio/AudioContext.cpp
@@ -10,6 +10,7 @@
#include "core/dom/DOMException.h"
#include "core/dom/ExceptionCode.h"
#include "modules/webaudio/AudioBufferCallback.h"
+#include "platform/Histogram.h"
#include "platform/audio/AudioUtilities.h"
#if DEBUG_AUDIONODE_REFERENCES
@@ -66,6 +67,13 @@ AbstractAudioContext* AudioContext::create(Document& document, ExceptionState& e
audioContext, audioContext->m_contextId, s_hardwareContextCount);
#endif
+ DEFINE_STATIC_LOCAL(SparseHistogram, maxChannelCountHistogram,
+ ("WebAudio.AudioContext.MaxChannelCount"));
+ DEFINE_STATIC_LOCAL(SparseHistogram, sampleRateHistogram,
+ ("WebAudio.AudioContext.SampleRate"));
+ maxChannelCountHistogram.sample(audioContext->destination()->maxChannelCount());
+ sampleRateHistogram.sample(audioContext->sampleRate());
+
return audioContext;
}

Powered by Google App Engine
This is Rietveld 408576698