A lot of cache files are created while running the API unit tests, which makes performance slow. https://bugs.webkit.org/show_bug.cgi?id=104665 So, we need to implement ewk_context_cache_clear in order to clear the caches before running the tests.
ewk_context_cache_clear is a very vague name? What cache are we talking about? page cache, http cache, etc; there are lots of caches around
(In reply to comment #1) > ewk_context_cache_clear is a very vague name? What cache are we talking about? page cache, http cache, etc; there are lots of caches around In this particular case we're talking about the HTTP cache.
(In reply to comment #2) > (In reply to comment #1) > > ewk_context_cache_clear is a very vague name? What cache are we talking about? page cache, http cache, etc; there are lots of caches around > > In this particular case we're talking about the HTTP cache. Yes, this API will call the following method: void WebProcess::platformClearResourceCaches(ResourceCachesToClear cachesToClear) { if (cachesToClear == InMemoryResourceCachesOnly) return; SoupSession* session = WebCore::ResourceHandle::defaultSession(); soup_cache_clear(SOUP_CACHE(soup_session_get_feature(session, SOUP_TYPE_CACHE))); } The API name is very vague, but WebKitGtk+ also has the same API. void webkit_web_context_clear_cache(WebKitWebContext* context) Anyway, we can use ewk_context_http_cache_clear, which is more explicit.
Created attachment 180627 [details] Patch
Comment on attachment 180627 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=180627&action=review > Source/WebKit2/UIProcess/API/efl/ewk_context.h:317 > + * Clears all resources currently cached in memory and local storage for @a context. > + * > + * @param context context object to clear all resource caches. I think this needs more explanation. Why clear, not purge or so... clear doesnt mean remove, but could be just clearing (zeroing out or similar). Clears all resources cached in memory such as local storage, HTTP cache, ...
(In reply to comment #5) > (From update of attachment 180627 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=180627&action=review > > > Source/WebKit2/UIProcess/API/efl/ewk_context.h:317 > > + * Clears all resources currently cached in memory and local storage for @a context. > > + * > > + * @param context context object to clear all resource caches. > > I think this needs more explanation. > > Why clear, not purge or so... clear doesnt mean remove, but could be just clearing (zeroing out or similar). > > Clears all resources cached in memory such as local storage, HTTP cache, ... The reason why I use "Clear" is that this API calls WebProcess::clearResourceCaches in the end. All resources mean images, CSS, JavaScript, XSL, and fonts, which are cached in memory and they are also cached as HTTP caches in local storage. http://trac.webkit.org/browser/trunk/Source/WebCore/loader/cache/MemoryCache.cpp#L693 How about this API description? Clears HTTP caches in local storage and all resources cached in memory such as images, CSS, JavaScript, XSL, and fonts.
Sounds good to me
(In reply to comment #7) > Sounds good to me +1
Comment on attachment 180627 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=180627&action=review > Source/WebKit2/UIProcess/API/efl/ewk_context.cpp:339 > +void ewk_context_resource_cache_clear(Ewk_Context *ewkContext) star on wrong side
Comment on attachment 180627 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=180627&action=review >>> Source/WebKit2/UIProcess/API/efl/ewk_context.h:317 >>> + * @param context context object to clear all resource caches. >> >> I think this needs more explanation. >> >> Why clear, not purge or so... clear doesnt mean remove, but could be just clearing (zeroing out or similar). >> >> Clears all resources cached in memory such as local storage, HTTP cache, ... > > The reason why I use "Clear" is that this API calls WebProcess::clearResourceCaches in the end. > > All resources mean images, CSS, JavaScript, XSL, and fonts, which are cached in memory and they are also cached as HTTP caches in local storage. > http://trac.webkit.org/browser/trunk/Source/WebCore/loader/cache/MemoryCache.cpp#L693 > > How about this API description? > > Clears HTTP caches in local storage and all resources cached in memory such as images, CSS, JavaScript, XSL, and fonts. Nit: We don't use . at the end of @param field. > Source/WebKit2/UIProcess/API/efl/ewk_context.h:318 > + * This line isn't needed.
Thanks for your comments. I will update the patch soon.
Created attachment 180892 [details] Updated Patch
Comment on attachment 180892 [details] Updated Patch LGTM.
Comment on attachment 180892 [details] Updated Patch Clearing flags on attachment: 180892 Committed r138554: <http://trac.webkit.org/changeset/138554>
All reviewed patches have been landed. Closing bug.