Bug 218251 - [GPUProcess] Use async IPC for RemoteAudioDestinationManager's StartAudioDestination / StopAudioDestination
Summary: [GPUProcess] Use async IPC for RemoteAudioDestinationManager's StartAudioDest...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Audio (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
: 217990 (view as bug list)
Depends on:
Blocks: 212611 217606
  Show dependency treegraph
 
Reported: 2020-10-27 11:55 PDT by Chris Dumez
Modified: 2020-10-27 14:47 PDT (History)
15 users (show)

See Also:


Attachments
Patch (34.87 KB, patch)
2020-10-27 12:59 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (34.84 KB, patch)
2020-10-27 13:46 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2020-10-27 11:55:41 PDT
Use async IPC for RemoteAudioDestinationManager's StartAudioDestination / StopAudioDestination.
Comment 1 Peng Liu 2020-10-27 12:16:00 PDT
*** Bug 217990 has been marked as a duplicate of this bug. ***
Comment 2 Chris Dumez 2020-10-27 12:59:21 PDT
Created attachment 412454 [details]
Patch
Comment 3 Peng Liu 2020-10-27 13:38:32 PDT
Comment on attachment 412454 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=412454&action=review

> Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp:132
> +            completionHandler(Exception { InvalidStateError, "Failed to start the audio device"_s });

Nit. Can be done in one line as in DefaultAudioDestinationNode::resume().

> Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp:148
> +        completionHandler(success ? WTF::nullopt : makeOptional(Exception { InvalidStateError, "Failed to start audio device"_s }));

Nit. Maybe we can use the same error message as in DefaultAudioDestinationNode::startRendering()?
s/"Failed to start audio device"_s/"Failed to start the audio device"_s/

> Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp:163
> +        completionHandler(success ? WTF::nullopt : makeOptional(Exception { InvalidStateError, "Failed to stop audio device"_s }));

Ditto. s/"Failed to stop audio device"_s/"Failed to stop the audio device"_s/

> Source/WebCore/platform/audio/cocoa/AudioDestinationCocoa.cpp:106
> +    auto success = !m_audioOutputUnitAdaptor.start();

Nit. OK as it is. Maybe "auto success = m_audioOutputUnitAdaptor.start() == noErr" is better?

> Source/WebCore/platform/audio/cocoa/AudioDestinationCocoa.cpp:118
> +    auto success = !m_audioOutputUnitAdaptor.stop();

Ditto.
Comment 4 Chris Dumez 2020-10-27 13:43:29 PDT
(In reply to Peng Liu from comment #3)
> Comment on attachment 412454 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=412454&action=review
> 
> > Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp:132
> > +            completionHandler(Exception { InvalidStateError, "Failed to start the audio device"_s });
> 
> Nit. Can be done in one line as in DefaultAudioDestinationNode::resume().
> 
> > Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp:148
> > +        completionHandler(success ? WTF::nullopt : makeOptional(Exception { InvalidStateError, "Failed to start audio device"_s }));
> 
> Nit. Maybe we can use the same error message as in
> DefaultAudioDestinationNode::startRendering()?
> s/"Failed to start audio device"_s/"Failed to start the audio device"_s/
> 
> > Source/WebCore/Modules/webaudio/DefaultAudioDestinationNode.cpp:163
> > +        completionHandler(success ? WTF::nullopt : makeOptional(Exception { InvalidStateError, "Failed to stop audio device"_s }));
> 
> Ditto. s/"Failed to stop audio device"_s/"Failed to stop the audio device"_s/
> 
> > Source/WebCore/platform/audio/cocoa/AudioDestinationCocoa.cpp:106
> > +    auto success = !m_audioOutputUnitAdaptor.start();
> 
> Nit. OK as it is. Maybe "auto success = m_audioOutputUnitAdaptor.start() ==
> noErr" is better?
> 
> > Source/WebCore/platform/audio/cocoa/AudioDestinationCocoa.cpp:118
> > +    auto success = !m_audioOutputUnitAdaptor.stop();
> 
> Ditto.

Thanks for looking. I will fix all these shortly.
Comment 5 Chris Dumez 2020-10-27 13:46:03 PDT
Created attachment 412460 [details]
Patch
Comment 6 Geoffrey Garen 2020-10-27 13:54:33 PDT
Comment on attachment 412460 [details]
Patch

r=me
Comment 7 EWS 2020-10-27 14:46:26 PDT
Committed r269073: <https://trac.webkit.org/changeset/269073>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 412460 [details].
Comment 8 Radar WebKit Bug Importer 2020-10-27 14:47:21 PDT
<rdar://problem/70739259>