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

Side by Side Diff: media/audio/audio_input_controller.h

Issue 2954323002: Fixed AudioInputController muted state related tsan bug. (Closed)
Patch Set: Rebased Created 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | media/audio/audio_input_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_
6 #define MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ 6 #define MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // The silence report sent as UMA stat at the end of a session. 371 // The silence report sent as UMA stat at the end of a session.
372 SilenceState silence_state_ = SILENCE_STATE_NO_MEASUREMENT; 372 SilenceState silence_state_ = SILENCE_STATE_NO_MEASUREMENT;
373 #endif 373 #endif
374 374
375 size_t prev_key_down_count_ = 0; 375 size_t prev_key_down_count_ = 0;
376 376
377 // Time when the stream started recording. 377 // Time when the stream started recording.
378 base::TimeTicks stream_create_time_; 378 base::TimeTicks stream_create_time_;
379 379
380 bool is_muted_ = false; 380 bool is_muted_ = false;
381 base::RepeatingTimer check_muted_state_timer_; 381
382 // Timer cannot be destroyed in destructor, due to threading, so keep it in an
383 // Optional.
384 base::Optional<base::RepeatingTimer> check_muted_state_timer_;
382 385
383 #if BUILDFLAG(ENABLE_WEBRTC) 386 #if BUILDFLAG(ENABLE_WEBRTC)
384 // Used for audio debug recordings. Accessed on audio thread. 387 // Used for audio debug recordings. Accessed on audio thread.
385 AudioDebugRecordingHelper debug_recording_helper_; 388 AudioDebugRecordingHelper debug_recording_helper_;
386 #endif 389 #endif
387 390
388 class AudioCallback; 391 class AudioCallback;
389 // Holds a pointer to the callback object that receives audio data from 392 // Holds a pointer to the callback object that receives audio data from
390 // the lower audio layer. Valid only while 'recording' (between calls to 393 // the lower audio layer. Valid only while 'recording' (between calls to
391 // stream_->Start() and stream_->Stop()). 394 // stream_->Start() and stream_->Stop()).
(...skipping 15 matching lines...) Expand all
407 // The weak_ptr_factory_ and all outstanding weak pointers, are invalidated 410 // The weak_ptr_factory_ and all outstanding weak pointers, are invalidated
408 // at the end of DoClose. 411 // at the end of DoClose.
409 base::WeakPtrFactory<AudioInputController> weak_ptr_factory_; 412 base::WeakPtrFactory<AudioInputController> weak_ptr_factory_;
410 413
411 DISALLOW_COPY_AND_ASSIGN(AudioInputController); 414 DISALLOW_COPY_AND_ASSIGN(AudioInputController);
412 }; 415 };
413 416
414 } // namespace media 417 } // namespace media
415 418
416 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_ 419 #endif // MEDIA_AUDIO_AUDIO_INPUT_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | media/audio/audio_input_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698