• henrika@chromium.org's avatar
    Improved timer implementation in AudioInputController since... · d4049571
    henrika@chromium.org authored
    Improved timer implementation in AudioInputController since AudioInputController::DoResetNoDataTimer() has an extreme task execution count in chrome://profiler.
    
    There is no longer a PostTask in OnData() to reset the data timer. Instead, a simple flag is set and this flag is checked, and reset, on a periodic basis. If packets no longer are generated, the cleared flag will be detected an and OnError() callback will be given to the event handler.
    
    I have verified the new design in different ways:
    
    1) Verified that no AudioInputController function pops up in the profiler.
    2) media_unittest --gtest_filter=AudioInputControllerTest*RecordAndError
    3) Tried out the speech input API and the removed the microphone while recording and verified that it worked.
    4) Same as 3) but for WebRTC in loopback using the https://apprtc.appspot.com/?debug=loopback demo.
    
    BUG=123588
    TEST=media_unittest --gtest_filter=AudioInputControllerTest*RecordAndError
    
    Review URL: http://codereview.chromium.org/9956169
    
    git-svn-id: svn://svn.chromium.org/chrome/trunk/src@132583 0039d316-1c4b-4281-b951-d872f2087c98
    d4049571
audio_input_controller.h 10.1 KB