[SOUP] Add initial implementation of NetworkProcess disk cache
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Apr 2015 06:17:05 +0000 (06:17 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 27 Apr 2015 06:17:05 +0000 (06:17 +0000)
commit6472a3bebdd57a43d8f039155b3b4234cb20569e
treebd9f13c421b0e7d5c89ee2e18518d647d9d6b0e1
parent2276566676e3ea38b5dc45771721defa59c4b674
[SOUP] Add initial implementation of NetworkProcess disk cache
https://bugs.webkit.org/show_bug.cgi?id=143872

Reviewed by Martin Robinson.

Source/WebCore:

Allow to create a GRefPtr for SoupBuffer. Even though SoupBuffer
is not a GObject and has copy/free functions instead of ref/unref,
it's internally refcounted, so we could use copy/free as
ref/unref.

* PlatformGTK.cmake:
* platform/network/soup/GRefPtrSoup.cpp: Added.
(WTF::refGPtr):
(WTF::derefGPtr):
* platform/network/soup/GRefPtrSoup.h: Added.

Source/WebKit2:

Implement the platform specific parts of the disk cache
implementation for Soup. It's mainly NetworkCache::Data and
NetworkCache::IOChannel.

* CMakeLists.txt:
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::dumpFileChanged):
(WebKit::NetworkCache::Cache::initialize):
* NetworkProcess/cache/NetworkCacheBlobStorage.cpp:
* NetworkProcess/cache/NetworkCacheData.h:
(WebKit::NetworkCache::Data::soupBuffer):
* NetworkProcess/cache/NetworkCacheDataSoup.cpp: Added.
(WebKit::NetworkCache::Data::Data):
(WebKit::NetworkCache::Data::empty):
(WebKit::NetworkCache::Data::data):
(WebKit::NetworkCache::Data::isNull):
(WebKit::NetworkCache::Data::apply):
(WebKit::NetworkCache::Data::subrange):
(WebKit::NetworkCache::concatenate):
(WebKit::NetworkCache::MapWrapper::~MapWrapper):
(WebKit::NetworkCache::deleteMapWrapper):
(WebKit::NetworkCache::mapFile):
(WebKit::NetworkCache::Data::adoptMap):
(WebKit::NetworkCache::computeSHA1):
(WebKit::NetworkCache::bytesEqual):
* NetworkProcess/cache/NetworkCacheIOChannel.h:
* NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp: Added.
(WebKit::NetworkCache::IOChannel::IOChannel):
(WebKit::NetworkCache::IOChannel::open):
(WebKit::NetworkCache::fillDataFromReadBuffer):
(WebKit::NetworkCache::inputStreamReadReadyCallback):
(WebKit::NetworkCache::IOChannel::read):
(WebKit::NetworkCache::IOChannel::readSync):
(WebKit::NetworkCache::outputStreamWriteReadyCallback):
(WebKit::NetworkCache::IOChannel::write):
* NetworkProcess/cache/NetworkCacheStorageSoup.cpp: Removed.
* NetworkProcess/gtk/NetworkProcessMainGtk.cpp:
* NetworkProcess/soup/NetworkProcessSoup.cpp:
(WebKit::NetworkProcess::platformInitializeNetworkProcess):
(WebKit::NetworkProcess::platformSetCacheModel):
(WebKit::NetworkProcess::clearDiskCache):
* PlatformGTK.cmake:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183387 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/PlatformGTK.cmake
Source/WebCore/platform/network/soup/GRefPtrSoup.cpp [new file with mode: 0644]
Source/WebCore/platform/network/soup/GRefPtrSoup.h [new file with mode: 0644]
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCache.cpp
Source/WebKit2/NetworkProcess/cache/NetworkCacheBlobStorage.cpp
Source/WebKit2/NetworkProcess/cache/NetworkCacheData.h
Source/WebKit2/NetworkProcess/cache/NetworkCacheDataSoup.cpp [new file with mode: 0644]
Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannel.h
Source/WebKit2/NetworkProcess/cache/NetworkCacheIOChannelSoup.cpp [new file with mode: 0644]
Source/WebKit2/NetworkProcess/cache/NetworkCacheStorageSoup.cpp [deleted file]
Source/WebKit2/NetworkProcess/gtk/NetworkProcessMainGtk.cpp
Source/WebKit2/NetworkProcess/soup/NetworkProcessSoup.cpp
Source/WebKit2/PlatformGTK.cmake