[SOUP] Stop using ResourceHandle to load GResources
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2018 15:09:10 +0000 (15:09 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2018 15:09:10 +0000 (15:09 +0000)
commit5d01f39de0930eff451f2f5698045d1a268a0c64
treef1d46599f2ae6d26b0f3387347ca7af72b1faf29
parent3a8491840a6a0595209b807198830249af551686
[SOUP] Stop using ResourceHandle to load GResources
https://bugs.webkit.org/show_bug.cgi?id=184259

Reviewed by Sergio Villar Senin.

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.

* SourcesGTK.txt:
* SourcesWPE.txt:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::start): Check if resource to load is a GResource and call loadGResource().
* loader/ResourceLoader.h:
* loader/soup/ResourceLoaderSoup.cpp: Added.
(WebCore::ResourceLoader::loadGResource): Load the GResource in a GTask thread.
* platform/SharedBuffer.cpp:
(WebCore::SharedBuffer::DataSegment::data const):
(WebCore::SharedBuffer::DataSegment::size const):
* platform/SharedBuffer.h:
* platform/glib/SharedBufferGlib.cpp:
(WebCore::SharedBuffer::SharedBuffer):
(WebCore::SharedBuffer::create):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@230203 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/SourcesGTK.txt
Source/WebCore/SourcesWPE.txt
Source/WebCore/loader/ResourceLoader.cpp
Source/WebCore/loader/ResourceLoader.h
Source/WebCore/loader/soup/ResourceLoaderSoup.cpp [new file with mode: 0644]
Source/WebCore/platform/SharedBuffer.cpp
Source/WebCore/platform/SharedBuffer.h
Source/WebCore/platform/glib/SharedBufferGlib.cpp