Bug 220407

Summary: [GStreamer] Do not use the registry scanner singleton from the UI process
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: PlatformAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, calvaris, Hironori.Fujii, vjaquez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 209332    
Attachments:
Description Flags
Patch calvaris: review+

Description Carlos Garcia Campos 2021-01-07 04:37:47 PST
The registry scanner is used from the UI process only to initialize the MIME type registry, so it's called once and the results are cached forever. Using the singleton keeps the instance alive forever, so we can just create a temporary registry to get the supported types.
Comment 1 Carlos Garcia Campos 2021-01-07 04:44:45 PST
Created attachment 417173 [details]
Patch
Comment 2 Víctor M. Jáquez L. 2021-01-08 06:15:00 PST
Comment on attachment 417173 [details]
Patch

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

> Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.h:44
> +    ~GStreamerRegistryScanner() = default;

I wonder if it 's worth to have a 

if (!isInWebProcess())
    gst_deinit()

In the destructor
Comment 3 Carlos Garcia Campos 2021-01-11 00:20:07 PST
(In reply to Víctor M. Jáquez L. from comment #2)
> Comment on attachment 417173 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=417173&action=review
> 
> > Source/WebCore/platform/graphics/gstreamer/GStreamerRegistryScanner.h:44
> > +    ~GStreamerRegistryScanner() = default;
> 
> I wonder if it 's worth to have a 
> 
> if (!isInWebProcess())
>     gst_deinit()
> 
> In the destructor

No, init and deinit are not balanced. It's ok to call init even if the app already called it, because it does nothing, but not the other way around.
Comment 4 Carlos Garcia Campos 2021-01-11 00:35:50 PST
Committed r271353: <https://trac.webkit.org/changeset/271353>
Comment 5 Radar WebKit Bug Importer 2021-01-11 00:36:13 PST
<rdar://problem/72988084>
Comment 6 Fujii Hironori 2021-01-11 16:12:05 PST
Committed r271385: <https://trac.webkit.org/changeset/271385>
Comment 7 Fujii Hironori 2021-01-11 21:04:40 PST
Comment on attachment 417173 [details]
Patch

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

> Source/WebCore/ChangeLog:11
> +        * platform/glib/RuntimeApplicationChecksGLib.cpp: Added.

I'd like to remove this file.
  Bug 220529 – Reimplement WebCore::isInWebProcess() family as cross-platform by using AuxiliaryProcessInitializationParameters.processType