Changeset 69084 in webkit


Ignore:
Timestamp:
Oct 4, 2010 11:36:44 PM (14 years ago)
Author:
tonyg@chromium.org
Message:

2010-10-04 Tony Gentilcore <tonyg@chromium.org>

Reviewed by Darin Fisher.

[chromium] Properly clear WebKit cache when chromium cache is cleared
https://bugs.webkit.org/show_bug.cgi?id=47119

Contributed by Ricardo Vargas.

See: http://code.google.com/p/chromium/issues/detail?id=54336

  • src/WebCache.cpp: (WebKit::WebCache::clear):
Location:
trunk/WebKit/chromium
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/chromium/ChangeLog

    r69081 r69084  
     12010-10-04  Tony Gentilcore  <tonyg@chromium.org>
     2
     3        Reviewed by Darin Fisher.
     4
     5        [chromium] Properly clear WebKit cache when chromium cache is cleared
     6        https://bugs.webkit.org/show_bug.cgi?id=47119
     7
     8        Contributed by Ricardo Vargas.
     9
     10        See: http://code.google.com/p/chromium/issues/detail?id=54336
     11
     12        * src/WebCache.cpp:
     13        (WebKit::WebCache::clear):
     14
    1152010-10-04  Nico Weber  <thakis@chromium.org>
    216
  • trunk/WebKit/chromium/src/WebCache.cpp

    r50715 r69084  
    6868    Cache* cache = WebCore::cache();
    6969    if (cache && !cache->disabled()) {
    70         // NOTE: I think using setDisabled() instead of setCapacities() will
    71         // remove from the cache items that won't actually be freed from memory
    72         // (due to other live references to them), so it just results in wasting
    73         // time later and not saving memory compared to the below technique.
    74         unsigned minDeadCapacity = cache->m_minDeadCapacity;
    75         unsigned maxDeadCapacity = cache->m_maxDeadCapacity;
    76         unsigned capacity = cache->m_capacity;
    77         cache->setCapacities(0, 0, 0);  // Will prune the cache.
    78         cache->setCapacities(minDeadCapacity, maxDeadCapacity, capacity);
     70        cache->setDisabled(true);
     71        cache->setDisabled(false);
    7972    }
    8073}
Note: See TracChangeset for help on using the changeset viewer.