Bug 184259

Summary: [SOUP] Stop using ResourceHandle to load GResources
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: PlatformAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, dbates, ews-watchlist, japhet, svillar, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 184048    
Attachments:
Description Flags
Patch svillar: review+

Description Carlos Garcia Campos 2018-04-03 03:16:39 PDT
GResources are loaded in the WebProcess using ResourceHandle because soup handles them transparently. But now that we no longer use ResourceHandle, we can add a simple loader for GResources, similar to the one used for data URLS, since loading a GResource is a matter of calling g_resources_lookup_data() in the end.
Comment 1 Carlos Garcia Campos 2018-04-03 04:39:27 PDT
Created attachment 337068 [details]
Patch
Comment 2 Sergio Villar Senin 2018-04-03 07:54:38 PDT
Comment on attachment 337068 [details]
Patch

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

> Source/WebCore/platform/glib/SharedBufferGlib.cpp:30
> +SharedBuffer::SharedBuffer(GBytes* bytes)

I guess this can be a reference since it cannot be null.

> Source/WebCore/platform/glib/SharedBufferGlib.cpp:37
> +Ref<SharedBuffer> SharedBuffer::create(GBytes* bytes)

Ditto.
Comment 3 Carlos Garcia Campos 2018-04-03 08:06:40 PDT
(In reply to Sergio Villar Senin from comment #2)
> Comment on attachment 337068 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=337068&action=review
> 
> > Source/WebCore/platform/glib/SharedBufferGlib.cpp:30
> > +SharedBuffer::SharedBuffer(GBytes* bytes)
> 
> I guess this can be a reference since it cannot be null.

Nop, we never use references for C structs.

> > Source/WebCore/platform/glib/SharedBufferGlib.cpp:37
> > +Ref<SharedBuffer> SharedBuffer::create(GBytes* bytes)
> 
> Ditto.
Comment 4 Carlos Garcia Campos 2018-04-03 08:09:21 PDT
Committed r230203: <https://trac.webkit.org/changeset/230203>
Comment 5 Radar WebKit Bug Importer 2018-04-03 08:10:22 PDT
<rdar://problem/39140990>
Comment 6 Sergio Villar Senin 2018-04-04 00:31:38 PDT
(In reply to Carlos Garcia Campos from comment #3)
> (In reply to Sergio Villar Senin from comment #2)
> > Comment on attachment 337068 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=337068&action=review
> > 
> > > Source/WebCore/platform/glib/SharedBufferGlib.cpp:30
> > > +SharedBuffer::SharedBuffer(GBytes* bytes)
> > 
> > I guess this can be a reference since it cannot be null.
> 
> Nop, we never use references for C structs.

:) next time I'll check the actual type