• miu's avatar
    AudioMirroringManager becomes a global LazyInstance. · 8b4f7fa7
    miu authored
    While attempting to resolve a flaky browser_test, it became clear that
    AudioMirroringManager was not outliving its use.  In the original change
    that introduced this class, it was instantiated and owned by
    BrowserMainLoop as a matter of convenience.  However, with some
    debugging, it's clear that it must outlive objects that can outlive
    BrowserMainLoop (e.g., WebContentsAudioInputStream).
    
    Side notes: I've checked the feasibility of other solutions, confirming
    that the shutdown of AudioManager does NOT guarantee complete teardown
    of an AudioInputStream, so it's not sufficient to simply change the
    destruction order of the objects in BrowserMainLoop to resolve this
    problem.  As AudioMirroringManager provides a browser-wide service and
    owns no objects, it seems reasonable for it to exist as a global
    LazyInstance.
    
    BUG=396413
    
    Review URL: https://codereview.chromium.org/499483003
    
    Cr-Commit-Position: refs/heads/master@{#292258}
    8b4f7fa7
audio_mirroring_manager.h 4.48 KB