Changeset 83931 in webkit


Ignore:
Timestamp:
Apr 14, 2011 7:12:05 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-04-14 Grzegorz Czajkowski <g.czajkowski@samsung.com>

Reviewed by Antonio Gomes.

Memory cache API
https://bugs.webkit.org/show_bug.cgi?id=58016

  • ewk/ewk_settings.cpp: (ewk_settings_cache_enable_get): (ewk_settings_cache_enable_set): (ewk_settings_cache_capacity_set):
  • ewk/ewk_settings.h:
Location:
trunk/Source/WebKit/efl
Files:
3 edited

Legend:

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

    r83727 r83931  
     12011-04-14  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
     2
     3        Reviewed by Antonio Gomes.
     4
     5        Memory cache API
     6        https://bugs.webkit.org/show_bug.cgi?id=58016
     7
     8        * ewk/ewk_settings.cpp:
     9        (ewk_settings_cache_enable_get):
     10        (ewk_settings_cache_enable_set):
     11        (ewk_settings_cache_capacity_set):
     12        * ewk/ewk_settings.h:
     13
    1142011-04-13  Grzegorz Czajkowski  <g.czajkowski@samsung.com>
    215
  • trunk/Source/WebKit/efl/ewk/ewk_settings.cpp

    r81824 r83931  
    3030#include "IntSize.h"
    3131#include "KURL.h"
     32#include "MemoryCache.h"
    3233#include "ewk_private.h"
    3334
     
    327328
    328329/**
     330 * Gets status of the memory cache of WebCore.
     331 *
     332 * @return @c EINA_TRUE if the cache is enabled or @c EINA_FALSE if not
     333 */
     334Eina_Bool ewk_settings_cache_enable_get(void)
     335{
     336    WebCore::MemoryCache* cache = WebCore::memoryCache();
     337    return !cache->disabled();
     338}
     339
     340/**
     341 * Enables/disables the memory cache of WebCore, possibly clearing it.
     342 *
     343 * Disabling the cache will remove all resources from the cache.
     344 * They may still live on if they are referenced by some Web page though.
     345 *
     346 * @param set @c EINA_TRUE to enable memory cache, @c EINA_FALSE to disable
     347 */
     348void ewk_settings_cache_enable_set(Eina_Bool set)
     349{
     350    WebCore::MemoryCache* cache = WebCore::memoryCache();
     351    set = !set;
     352    if (cache->disabled() != set)
     353        cache->setDisabled(set);
     354}
     355
     356/**
     357 * Sets capacity of memory cache of WebCore.
     358 *
     359 * WebCore sets default value of memory cache on 8192 * 1024 bytes.
     360 *
     361 * @param capacity the maximum number of bytes that the cache should consume overall
     362 */
     363void ewk_settings_cache_capacity_set(unsigned capacity)
     364{
     365    WebCore::MemoryCache* cache = WebCore::memoryCache();
     366    cache->setCapacities(0, capacity, capacity);
     367}
     368
     369/**
    329370 * @internal
    330371 *
  • trunk/Source/WebKit/efl/ewk/ewk_settings.h

    r81658 r83931  
    5555EAPI const char*      ewk_settings_proxy_uri_get(void);
    5656
     57EAPI Eina_Bool        ewk_settings_cache_enable_get(void);
     58EAPI void             ewk_settings_cache_enable_set(Eina_Bool set);
     59EAPI void             ewk_settings_cache_capacity_set(unsigned capacity);
     60
    5761#ifdef __cplusplus
    5862}
Note: See TracChangeset for help on using the changeset viewer.