• Max Morin's avatar
    Reland "Refactor flow of audio platform errors to renderer". · 6b683a83
    Max Morin authored
    Original description, (original code is PS 1):
    
    Currently, errors from the platform (e.g. device disconnected), are sent
    directly to the renderer (AudioOutputStreamClient). When moving to the audio
    service, this becomes suboptimal. It is tricky to signal an error occurring
    before the ClientPtr is set up, and sometimes we may not want it torn down due
    to a platform error (in case we want to try some sort of recovery operation
    such as restarting the audio service). This CL instead signals the error to the
    browser (AudioOutputStreamObserver), which signals it to the client through the
    new AudioOutputStreamProviderClient interface. That interface also gets the
    "stream created" callback as a method rather than a mojo response, so that we
    will be able to call it multiple times in the future.
    
    Diff PS 1 -> PS 2 removes a call to a sequence checker that was accidentally
    added when rebasing the original CL.
    
    Diff PS 2 -> last PS fixes an issue when pepper would call Start before the
    stream is created. This is solved by storing the state that the client
    expects in the MojoAudioOutputIPC object. That object then initializes the
    state when the stream has been created. As an aside, it is a great preparation
    for restarting stream, since MojoAudioOutputIPC will be able to restore the
    volume and playing state without involvement from AudioOutputDevice.
    
    Bug: 787806,830493,834242
    Change-Id: Iee3a3902e9086cc9df4c5d210e43e65c162273fe
    Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
    Reviewed-on: https://chromium-review.googlesource.com/1023397
    Commit-Queue: Max Morin <maxmorin@chromium.org>
    Reviewed-by: default avatarYuri Wiitala <miu@chromium.org>
    Reviewed-by: default avatarDale Curtis <dalecurtis@chromium.org>
    Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#553965}
    6b683a83
audio_output_ipc.h 4.57 KB