RESOLVED FIXED 224725
Use WebProcess::existingGPUProcessConnection() whenever possible
https://bugs.webkit.org/show_bug.cgi?id=224725
Summary Use WebProcess::existingGPUProcessConnection() whenever possible
Chris Dumez
Reported 2021-04-17 18:58:33 PDT
Use WebProcess::existingGPUProcessConnection() whenever possible, instead of WebProcess::ensureGPUProcessConnection(). This avoids relaunching the GPUProcess if it has already exited.
Attachments
Patch (5.33 KB, patch)
2021-04-17 18:59 PDT, Chris Dumez
no flags
Patch (5.23 KB, patch)
2021-04-17 20:08 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2021-04-17 18:59:54 PDT
Darin Adler
Comment 2 2021-04-17 20:04:40 PDT
Comment on attachment 426360 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426360&action=review > Source/WebKit/WebProcess/GPU/media/RemoteAudioHardwareListener.cpp:58 > + if (auto* gpuProcessConnection = WebProcess::singleton().existingGPUProcessConnection()) { I don’t think it’s an improvement to use the multi-word name for the local variable. Yes, it’s the GPU Process connection, but the name can just be connection in such tight if statements. You may not agree, but I really prefer simple single-word names when possible, even if there is some slight ambiguity.
Chris Dumez
Comment 3 2021-04-17 20:06:01 PDT
Comment on attachment 426360 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=426360&action=review >> Source/WebKit/WebProcess/GPU/media/RemoteAudioHardwareListener.cpp:58 >> + if (auto* gpuProcessConnection = WebProcess::singleton().existingGPUProcessConnection()) { > > I don’t think it’s an improvement to use the multi-word name for the local variable. Yes, it’s the GPU Process connection, but the name can just be connection in such tight if statements. You may not agree, but I really prefer simple single-word names when possible, even if there is some slight ambiguity. Ok. I went this way because connection->connection() looks a bit weird. The ambiguity between IPC::Connection and GPUProcessConnection is a bit annoying.
Chris Dumez
Comment 4 2021-04-17 20:08:37 PDT
Chris Dumez
Comment 5 2021-04-17 20:11:14 PDT
(In reply to Chris Dumez from comment #4) > Created attachment 426362 [details] > Patch Renamed to "connection".
EWS
Comment 6 2021-04-17 20:41:05 PDT
Committed r276218 (236700@main): <https://commits.webkit.org/236700@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 426362 [details].
Radar WebKit Bug Importer
Comment 7 2021-04-24 15:06:36 PDT
Note You need to log in before you can comment on or make changes to this bug.