Bug 220407 - [GStreamer] Do not use the registry scanner singleton from the UI process
Summary: [GStreamer] Do not use the registry scanner singleton from the UI process
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 209332
  Show dependency treegraph
 
Reported: 2021-01-07 04:37 PST by Carlos Garcia Campos
Modified: 2021-01-11 21:04 PST (History)
5 users (show)

See Also:


Attachments
Patch (13.12 KB, patch)
2021-01-07 04:44 PST, Carlos Garcia Campos
calvaris: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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