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

Unified Diff: media/audio/audio_output_device.cc

Issue 2116443002: Restricting output device authorization timeout to Windows only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebasing to the revert Created 4 years, 6 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 | « content/renderer/media/audio_device_factory.cc ('k') | no next file » | 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 e5e3513a413645ab5eee6fa6c446ae3a6eaeddf1..6f91756bb42b33b235e775943b80278b62157ca8 100644
--- a/media/audio/audio_output_device.cc
+++ b/media/audio/audio_output_device.cc
@@ -169,15 +169,17 @@ void AudioOutputDevice::RequestDeviceAuthorizationOnIOThread() {
ipc_->RequestDeviceAuthorization(this, session_id_, device_id_,
security_origin_);
- // 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
- // AudioOutputDevice; see ShutDownOnIOThread().
- auth_timeout_action_.reset(new base::OneShotTimer());
- auth_timeout_action_->Start(
- FROM_HERE, auth_timeout_,
- base::Bind(&AudioOutputDevice::OnDeviceAuthorized, this,
- OUTPUT_DEVICE_STATUS_ERROR_TIMED_OUT, media::AudioParameters(),
- std::string()));
+ 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
+ // AudioOutputDevice; see ShutDownOnIOThread().
+ auth_timeout_action_.reset(new base::OneShotTimer());
+ auth_timeout_action_->Start(
+ FROM_HERE, auth_timeout_,
+ base::Bind(&AudioOutputDevice::OnDeviceAuthorized, this,
+ OUTPUT_DEVICE_STATUS_ERROR_TIMED_OUT,
+ media::AudioParameters(), std::string()));
+ }
}
void AudioOutputDevice::CreateStreamOnIOThread(const AudioParameters& params) {
« no previous file with comments | « content/renderer/media/audio_device_factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698