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

Unified Diff: media/audio/audio_output_device.cc

Issue 2121223002: AudioOutputDevice authorization timeout UMA histograms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timeout set to 2000, UMA stat added. Created 4 years, 5 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
« no previous file with comments | « media/audio/audio_output_device.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_output_device.cc
diff --git a/media/audio/audio_output_device.cc b/media/audio/audio_output_device.cc
index 6f91756bb42b33b235e775943b80278b62157ca8..de39807d7f8b2250ff8d7354523c9fb46306586e 100644
--- a/media/audio/audio_output_device.cc
+++ b/media/audio/audio_output_device.cc
@@ -14,7 +14,7 @@
#include "base/macros.h"
#include "base/metrics/histogram_macros.h"
#include "base/threading/thread_restrictions.h"
-#include "base/time/time.h"
+#include "base/timer/elapsed_timer.h"
#include "base/timer/timer.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
@@ -169,6 +169,7 @@ void AudioOutputDevice::RequestDeviceAuthorizationOnIOThread() {
ipc_->RequestDeviceAuthorization(this, session_id_, device_id_,
security_origin_);
+ auth_timer_.reset(new base::ElapsedTimer());
if (auth_timeout_ > base::TimeDelta()) {
// Create the timer on the thread it's used on. It's guaranteed to be
// deleted on the same thread since users must call Stop() before deleting
@@ -325,6 +326,13 @@ void AudioOutputDevice::OnDeviceAuthorized(
UMA_HISTOGRAM_BOOLEAN("Media.Audio.Render.OutputDeviceAuthorizationTimedOut",
device_status == OUTPUT_DEVICE_STATUS_ERROR_TIMED_OUT);
+ DCHECK(auth_timer_);
+ UMA_HISTOGRAM_CUSTOM_TIMES("Media.Audio.Render.OutputDeviceAuthorizationTime",
DaleCurtis 2016/07/07 17:39:39 This doesn't allow us to make adjustments without
+ auth_timer_->Elapsed(),
+ base::TimeDelta::FromMilliseconds(1),
+ base::TimeDelta::FromMilliseconds(5000), 100);
+ auth_timer_.reset();
+
DCHECK_EQ(state_, AUTHORIZING);
// It may happen that a second authorization is received as a result to a
« no previous file with comments | « media/audio/audio_output_device.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698