Changeset 100472 in webkit


Ignore:
Timestamp:
Nov 16, 2011, 11:03:49 AM (14 years ago)
Author:
commit-queue@webkit.org
Message:

[EFL] Add ewk_settings_memory_cache_clear().
https://bugs.webkit.org/show_bug.cgi?id=72141

Patch by Raphael Kubo da Costa <kubo@profusion.mobi> on 2011-11-16
Reviewed by Kenneth Rohde Christiansen.

This is the same as Qt's QWebSettings::clearMemoryCaches() and is
responsible for clearing, among others, the page, memory and font
caches.

  • ewk/ewk_settings.cpp:

(ewk_settings_memory_cache_clear):

  • ewk/ewk_settings.h:
Location:
trunk/Source/WebKit/efl
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/efl/ChangeLog

    r100463 r100472  
     12011-11-16  Raphael Kubo da Costa  <kubo@profusion.mobi>
     2
     3        [EFL] Add ewk_settings_memory_cache_clear().
     4        https://bugs.webkit.org/show_bug.cgi?id=72141
     5
     6        Reviewed by Kenneth Rohde Christiansen.
     7
     8        This is the same as Qt's QWebSettings::clearMemoryCaches() and is
     9        responsible for clearing, among others, the page, memory and font
     10        caches.
     11
     12        * ewk/ewk_settings.cpp:
     13        (ewk_settings_memory_cache_clear):
     14        * ewk/ewk_settings.h:
     15
    1162011-11-16  Raphael Kubo da Costa  <kubo@profusion.mobi>
    217
  • trunk/Source/WebKit/efl/ewk/ewk_settings.cpp

    r100463 r100472  
    2222#include "ewk_settings.h"
    2323
     24#include "CrossOriginPreflightResultCache.h"
    2425#include "DatabaseTracker.h"
    2526#include "EWebKit.h"
     27#include "FontCache.h"
    2628#include "FrameView.h"
    2729#include "IconDatabase.h"
     
    3032#include "KURL.h"
    3133#include "MemoryCache.h"
     34#include "PageCache.h"
    3235// FIXME: Why is there a directory in this include?
    3336#include "appcache/ApplicationCacheStorage.h"
     
    210213}
    211214
     215void ewk_settings_memory_cache_clear()
     216{
     217    // Turn the cache on and off. Disabling the object cache will remove all
     218    // resources from the cache. They may still live on if they are referenced
     219    // by some Web page though.
     220    if (!WebCore::memoryCache()->disabled()) {
     221        WebCore::memoryCache()->setDisabled(true);
     222        WebCore::memoryCache()->setDisabled(false);
     223    }
     224
     225    int pageCapacity = WebCore::pageCache()->capacity();
     226    // Setting size to 0, makes all pages be released.
     227    WebCore::pageCache()->setCapacity(0);
     228    WebCore::pageCache()->releaseAutoreleasedPagesNow();
     229    WebCore::pageCache()->setCapacity(pageCapacity);
     230
     231    // Invalidating the font cache and freeing all inactive font data.
     232    WebCore::fontCache()->invalidate();
     233
     234    // Empty the Cross-Origin Preflight cache
     235    WebCore::CrossOriginPreflightResultCache::shared().empty();
     236}
     237
    212238void ewk_settings_repaint_throttling_set(double deferredRepaintDelay, double initialDeferredRepaintDelayDuringLoading, double maxDeferredRepaintDelayDuringLoading, double deferredRepaintDelayIncrementDuringLoading)
    213239{
  • trunk/Source/WebKit/efl/ewk/ewk_settings.h

    r100463 r100472  
    185185 */
    186186EAPI void             ewk_settings_cache_capacity_set(unsigned capacity);
     187
     188/**
     189 * Clears all memory caches.
     190 *
     191 * This function clears all memory caches, which include the object cache (for resources such as
     192 * images, scripts and stylesheets), the page cache, the font cache and the Cross-Origin Preflight
     193 * cache.
     194 */
     195EAPI void             ewk_settings_memory_cache_clear(void);
    187196
    188197/**
Note: See TracChangeset for help on using the changeset viewer.