2011-01-14 Yuzo Fujishima <yuzo@google.com>
authoryuzo@google.com <yuzo@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Jan 2011 01:59:05 +0000 (01:59 +0000)
committeryuzo@google.com <yuzo@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Jan 2011 01:59:05 +0000 (01:59 +0000)
        Reviewed by Antti Koivisto.

        Rename cache() to memoryCache()
        https://bugs.webkit.org/show_bug.cgi?id=52433

        No new tests because the behavior remains the same.

        * WebCore.exp.in:
        * WebCore.order:
        * history/PageCache.cpp:
        (WebCore::PageCache::releaseAutoreleasedPagesNow):
        * inspector/InspectorResourceAgent.cpp:
        (WebCore::InspectorResourceAgent::cachedResource):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::tellClientAboutPastMemoryCacheLoads):
        * loader/archive/cf/LegacyWebArchive.cpp:
        (WebCore::LegacyWebArchive::create):
        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::allClientsRemoved):
        (WebCore::CachedImage::data):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::~CachedResource):
        (WebCore::CachedResource::addClientToSet):
        (WebCore::CachedResource::removeClient):
        (WebCore::CachedResource::setDecodedSize):
        (WebCore::CachedResource::setEncodedSize):
        (WebCore::CachedResource::didAccessDecodedData):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::CachedResourceLoader):
        (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
        (WebCore::CachedResourceLoader::requestResource):
        (WebCore::CachedResourceLoader::revalidateResource):
        (WebCore::CachedResourceLoader::loadResource):
        (WebCore::CachedResourceLoader::clearPreloads):
        (WebCore::CachedResourceLoader::printPreloadStats):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::load):
        (WebCore::CachedResourceRequest::didFail):
        (WebCore::CachedResourceRequest::didReceiveResponse):
        * loader/cache/MemoryCache.cpp:
        (WebCore::memoryCache):
        * loader/cache/MemoryCache.h:
2011-01-14  Yuzo Fujishima  <yuzo@google.com>

        Reviewed by Antti Koivisto.

        Rename cache() to memoryCache()
        https://bugs.webkit.org/show_bug.cgi?id=52433

        * src/WebCache.cpp:
        (WebKit::WebCache::setCapacities):
        (WebKit::WebCache::clear):
        (WebKit::WebCache::getUsageStats):
        (WebKit::WebCache::getResourceTypeStats):
2011-01-14  Yuzo Fujishima  <yuzo@google.com>

        Reviewed by Antti Koivisto.

        Rename cache() to memoryCache()
        https://bugs.webkit.org/show_bug.cgi?id=52433

        * webkit/webkitglobals.cpp:
        (webkit_set_cache_model):
2011-01-14  Yuzo Fujishima  <yuzo@google.com>

        Reviewed by Antti Koivisto.

        Rename cache() to memoryCache()
        https://bugs.webkit.org/show_bug.cgi?id=52433

        * Misc/WebCache.mm:
        (+[WebCache statistics]):
        (+[WebCache setDisabled:]):
        (+[WebCache isDisabled]):
        * WebView/WebView.mm:
        (+[WebView _setCacheModel:]):
2011-01-14  Yuzo Fujishima  <yuzo@google.com>

        Reviewed by Antti Koivisto.

        Rename cache() to memoryCache()
        https://bugs.webkit.org/show_bug.cgi?id=52433

        * Api/qwebpage.cpp:
        (QWebPagePrivate::_q_cleanupLeakMessages):
        * Api/qwebsettings.cpp:
        (QWebSettings::clearMemoryCaches):
        (QWebSettings::setObjectCacheCapacities):
2011-01-14  Yuzo Fujishima  <yuzo@google.com>

        Reviewed by Antti Koivisto.

        Rename cache() to memoryCache()
        https://bugs.webkit.org/show_bug.cgi?id=52433

        * WebCache.cpp:
        (WebCache::statistics):
        (WebCache::empty):
        (WebCache::setDisabled):
        (WebCache::disabled):
        * WebView.cpp:
        (WebView::setCacheModel):
2011-01-14  Yuzo Fujishima  <yuzo@google.com>

        Reviewed by Antti Koivisto.

        Rename cache() to memoryCache()
        https://bugs.webkit.org/show_bug.cgi?id=52433

        * WebView.cpp:
        (wxWebView::SetCachePolicy):
2011-01-14  Yuzo Fujishima  <yuzo@google.com>

        Reviewed by Antti Koivisto.

        Rename cache() to memoryCache()
        https://bugs.webkit.org/show_bug.cgi?id=52433

        * WebProcess/WebProcess.cpp:
        (WebKit::WebProcess::shutdownIfPossible):
        (WebKit::WebProcess::didClose):
        * WebProcess/mac/WebProcessMac.mm:
        (WebKit::WebProcess::platformSetCacheModel):
        * WebProcess/win/WebProcessWin.cpp:
        (WebKit::WebProcess::platformSetCacheModel):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@75857 268f45cc-cd09-0410-ab3c-d52691b4dbfc

32 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.order
Source/WebCore/history/PageCache.cpp
Source/WebCore/inspector/InspectorResourceAgent.cpp
Source/WebCore/loader/FrameLoader.cpp
Source/WebCore/loader/archive/cf/LegacyWebArchive.cpp
Source/WebCore/loader/cache/CachedImage.cpp
Source/WebCore/loader/cache/CachedResource.cpp
Source/WebCore/loader/cache/CachedResourceLoader.cpp
Source/WebCore/loader/cache/CachedResourceRequest.cpp
Source/WebCore/loader/cache/MemoryCache.cpp
Source/WebCore/loader/cache/MemoryCache.h
WebKit/chromium/ChangeLog
WebKit/chromium/src/WebCache.cpp
WebKit/gtk/ChangeLog
WebKit/gtk/webkit/webkitglobals.cpp
WebKit/mac/ChangeLog
WebKit/mac/Misc/WebCache.mm
WebKit/mac/WebView/WebView.mm
WebKit/qt/Api/qwebpage.cpp
WebKit/qt/Api/qwebsettings.cpp
WebKit/qt/ChangeLog
WebKit/win/ChangeLog
WebKit/win/WebCache.cpp
WebKit/win/WebView.cpp
WebKit/wx/ChangeLog
WebKit/wx/WebView.cpp
WebKit2/ChangeLog
WebKit2/WebProcess/WebProcess.cpp
WebKit2/WebProcess/mac/WebProcessMac.mm
WebKit2/WebProcess/win/WebProcessWin.cpp

index 5e1f3e9..0aceca3 100644 (file)
@@ -1,3 +1,48 @@
+2011-01-14  Yuzo Fujishima  <yuzo@google.com>
+
+        Reviewed by Antti Koivisto.
+
+        Rename cache() to memoryCache()
+        https://bugs.webkit.org/show_bug.cgi?id=52433
+
+        No new tests because the behavior remains the same.
+
+        * WebCore.exp.in:
+        * WebCore.order:
+        * history/PageCache.cpp:
+        (WebCore::PageCache::releaseAutoreleasedPagesNow):
+        * inspector/InspectorResourceAgent.cpp:
+        (WebCore::InspectorResourceAgent::cachedResource):
+        * loader/FrameLoader.cpp:
+        (WebCore::FrameLoader::tellClientAboutPastMemoryCacheLoads):
+        * loader/archive/cf/LegacyWebArchive.cpp:
+        (WebCore::LegacyWebArchive::create):
+        * loader/cache/CachedImage.cpp:
+        (WebCore::CachedImage::allClientsRemoved):
+        (WebCore::CachedImage::data):
+        * loader/cache/CachedResource.cpp:
+        (WebCore::CachedResource::~CachedResource):
+        (WebCore::CachedResource::addClientToSet):
+        (WebCore::CachedResource::removeClient):
+        (WebCore::CachedResource::setDecodedSize):
+        (WebCore::CachedResource::setEncodedSize):
+        (WebCore::CachedResource::didAccessDecodedData):
+        * loader/cache/CachedResourceLoader.cpp:
+        (WebCore::CachedResourceLoader::CachedResourceLoader):
+        (WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
+        (WebCore::CachedResourceLoader::requestResource):
+        (WebCore::CachedResourceLoader::revalidateResource):
+        (WebCore::CachedResourceLoader::loadResource):
+        (WebCore::CachedResourceLoader::clearPreloads):
+        (WebCore::CachedResourceLoader::printPreloadStats):
+        * loader/cache/CachedResourceRequest.cpp:
+        (WebCore::CachedResourceRequest::load):
+        (WebCore::CachedResourceRequest::didFail):
+        (WebCore::CachedResourceRequest::didReceiveResponse):
+        * loader/cache/MemoryCache.cpp:
+        (WebCore::memoryCache):
+        * loader/cache/MemoryCache.h:
+
 2011-01-14  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Simon Fraser.
index 5ea40ca..46ad8a8 100644 (file)
@@ -211,6 +211,7 @@ __ZN7WebCore11MemoryCache13getStatisticsEv
 __ZN7WebCore11MemoryCache13setCapacitiesEjjj
 __ZN7WebCore11RenderLayer19scrollRectToVisibleERKNS_7IntRectEbRKNS_15ScrollAlignmentES6_
 __ZN7WebCore11globalPointERK8_NSPointP8NSWindow
+__ZN7WebCore11memoryCacheEv
 __ZN7WebCore11toUserSpaceERK7_NSRectP8NSWindow
 __ZN7WebCore11writeToFileEiPKci
 __ZN7WebCore12ChromeClient20paintCustomScrollbarEPNS_15GraphicsContextERKNS_9FloatRectENS_20ScrollbarControlSizeEjNS_13ScrollbarPartEbffj
@@ -681,7 +682,6 @@ __ZN7WebCore5Range6createEN3WTF10PassRefPtrINS_8DocumentEEENS2_INS_4NodeEEEiS6_i
 __ZN7WebCore5Range6setEndEN3WTF10PassRefPtrINS_4NodeEEEiRi
 __ZN7WebCore5Range8setStartEN3WTF10PassRefPtrINS_4NodeEEEiRi
 __ZN7WebCore5RangeD1Ev
-__ZN7WebCore5cacheEv
 __ZN7WebCore6Chrome16setStatusbarTextEPNS_5FrameERKN3WTF6StringE
 __ZN7WebCore6Cursor8fromTypeENS0_4TypeE
 __ZN7WebCore6CursorD1Ev
index 271dfc9..e88c444 100644 (file)
@@ -371,7 +371,7 @@ __ZN7WebCore15CollectionCache5resetEv
 __ZN3WTF20deleteAllPairSecondsIPNS_6VectorIPN7WebCore7ElementELm0EEEKNS_7HashMapIPNS2_16AtomicStringImplES6_NS_7PtrHashIS9_EENS
 __ZN7WebCore9DocLoaderC1EPNS_8DocumentE
 __ZN7WebCore9DocLoaderC2EPNS_8DocumentE
-__ZN7WebCore5cacheEv
+__ZN7WebCore11memoryCacheEv
 __ZN7WebCore5CacheC1Ev
 __ZN7WebCore5CacheC2Ev
 __ZN7WebCore6LoaderC1Ev
index 7375a9c..b14b606 100644 (file)
@@ -453,7 +453,7 @@ void PageCache::releaseAutoreleasedPagesNow()
     m_autoreleaseTimer.stop();
 
     // Postpone dead pruning until all our resources have gone dead.
-    cache()->setPruneEnabled(false);
+    memoryCache()->setPruneEnabled(false);
 
     CachedPageSet tmp;
     tmp.swap(m_autoreleaseSet);
@@ -463,8 +463,8 @@ void PageCache::releaseAutoreleasedPagesNow()
         (*it)->destroy();
 
     // Now do the prune.
-    cache()->setPruneEnabled(true);
-    cache()->prune();
+    memoryCache()->setPruneEnabled(true);
+    memoryCache()->prune();
 }
 
 void PageCache::autorelease(PassRefPtr<CachedPage> page)
index 9fc562c..6779790 100644 (file)
@@ -132,7 +132,7 @@ CachedResource* InspectorResourceAgent::cachedResource(Frame* frame, const KURL&
 {
     CachedResource* cachedResource = frame->document()->cachedResourceLoader()->cachedResource(url);
     if (!cachedResource)
-        cachedResource = cache()->resourceForURL(url);
+        cachedResource = memoryCache()->resourceForURL(url);
     return cachedResource;
 }
 
index 34fa195..82fcf7e 100644 (file)
@@ -3445,7 +3445,7 @@ void FrameLoader::tellClientAboutPastMemoryCacheLoads()
 
     size_t size = pastLoads.size();
     for (size_t i = 0; i < size; ++i) {
-        CachedResource* resource = cache()->resourceForURL(KURL(ParsedURLString, pastLoads[i]));
+        CachedResource* resource = memoryCache()->resourceForURL(KURL(ParsedURLString, pastLoads[i]));
 
         // FIXME: These loads, loaded from cache, but now gone from the cache by the time
         // Page::setMemoryCacheClientCallsEnabled(true) is called, will not be seen by the client.
index ddd564e..d9575fe 100644 (file)
@@ -529,7 +529,7 @@ PassRefPtr<LegacyWebArchive> LegacyWebArchive::create(const String& markupString
                     continue;
                 }
 
-                CachedResource *cachedResource = cache()->resourceForURL(subresourceURL);
+                CachedResource* cachedResource = memoryCache()->resourceForURL(subresourceURL);
                 if (cachedResource) {
                     resource = ArchiveResource::create(cachedResource->data(), subresourceURL, cachedResource->response());
                     if (resource) {
index 606942b..97fbf02 100644 (file)
@@ -107,7 +107,7 @@ void CachedImage::allClientsRemoved()
 {
     if (m_image && !errorOccurred())
         m_image->resetAnimation();
-    if (double interval = cache()->deadDecodedDataDeletionInterval())
+    if (double interval = memoryCache()->deadDecodedDataDeletionInterval())
         m_decodedDataDeletionTimer.startOneShot(interval);
 }
 
@@ -277,7 +277,7 @@ void CachedImage::data(PassRefPtr<SharedBuffer> data, bool allDataReceived)
         if (m_image->isNull() || (maxDecodedImageSize > 0 && estimatedDecodedImageSize > maxDecodedImageSize)) {
             error(errorOccurred() ? status() : DecodeError);
             if (inCache())
-                cache()->remove(this);
+                memoryCache()->remove(this);
             return;
         }
         
index a9d9b0a..06b3131 100644 (file)
@@ -116,7 +116,7 @@ CachedResource::~CachedResource()
     ASSERT(canDelete());
     ASSERT(!inCache());
     ASSERT(!m_deleted);
-    ASSERT(url().isNull() || cache()->resourceForURL(KURL(ParsedURLString, url())) != this);
+    ASSERT(url().isNull() || memoryCache()->resourceForURL(KURL(ParsedURLString, url())) != this);
 #ifndef NDEBUG
     m_deleted = true;
     cachedResourceLeakCounter.decrement();
@@ -259,7 +259,7 @@ void CachedResource::addClientToSet(CachedResourceClient* client)
             m_preloadResult = PreloadReferenced;
     }
     if (!hasClients() && inCache())
-        cache()->addToLiveResourcesSize(this);
+        memoryCache()->addToLiveResourcesSize(this);
     m_clients.add(client);
 }
 
@@ -271,8 +271,8 @@ void CachedResource::removeClient(CachedResourceClient* client)
     if (canDelete() && !inCache())
         delete this;
     else if (!hasClients() && inCache()) {
-        cache()->removeFromLiveResourcesSize(this);
-        cache()->removeFromLiveDecodedResourcesList(this);
+        memoryCache()->removeFromLiveResourcesSize(this);
+        memoryCache()->removeFromLiveDecodedResourcesList(this);
         allClientsRemoved();
         if (response().cacheControlContainsNoStore()) {
             // RFC2616 14.9.2:
@@ -280,9 +280,9 @@ void CachedResource::removeClient(CachedResourceClient* client)
             // "... History buffers MAY store such responses as part of their normal operation."
             // We allow non-secure content to be reused in history, but we do not allow secure content to be reused.
             if (protocolIs(url(), "https"))
-                cache()->remove(this);
+                memoryCache()->remove(this);
         } else
-            cache()->prune();
+            memoryCache()->prune();
     }
     // This object may be dead here.
 }
@@ -304,13 +304,13 @@ void CachedResource::setDecodedSize(unsigned size)
     // We have to remove explicitly before updating m_decodedSize, so that we find the correct previous
     // queue.
     if (inCache())
-        cache()->removeFromLRUList(this);
+        memoryCache()->removeFromLRUList(this);
     
     m_decodedSize = size;
    
     if (inCache()) { 
         // Now insert into the new LRU list.
-        cache()->insertInLRUList(this);
+        memoryCache()->insertInLRUList(this);
         
         // Insert into or remove from the live decoded list if necessary.
         // When inserting into the LiveDecodedResourcesList it is possible
@@ -320,12 +320,12 @@ void CachedResource::setDecodedSize(unsigned size)
         // by access time. The weakening of the invariant does not pose
         // a problem. For more details please see: https://bugs.webkit.org/show_bug.cgi?id=30209
         if (m_decodedSize && !m_inLiveDecodedResourcesList && hasClients())
-            cache()->insertInLiveDecodedResourcesList(this);
+            memoryCache()->insertInLiveDecodedResourcesList(this);
         else if (!m_decodedSize && m_inLiveDecodedResourcesList)
-            cache()->removeFromLiveDecodedResourcesList(this);
+            memoryCache()->removeFromLiveDecodedResourcesList(this);
 
         // Update the cache's size totals.
-        cache()->adjustSize(hasClients(), delta);
+        memoryCache()->adjustSize(hasClients(), delta);
     }
 }
 
@@ -343,16 +343,16 @@ void CachedResource::setEncodedSize(unsigned size)
     // We have to remove explicitly before updating m_encodedSize, so that we find the correct previous
     // queue.
     if (inCache())
-        cache()->removeFromLRUList(this);
+        memoryCache()->removeFromLRUList(this);
     
     m_encodedSize = size;
    
     if (inCache()) { 
         // Now insert into the new LRU list.
-        cache()->insertInLRUList(this);
+        memoryCache()->insertInLRUList(this);
         
         // Update the cache's size totals.
-        cache()->adjustSize(hasClients(), delta);
+        memoryCache()->adjustSize(hasClients(), delta);
     }
 }
 
@@ -362,10 +362,10 @@ void CachedResource::didAccessDecodedData(double timeStamp)
     
     if (inCache()) {
         if (m_inLiveDecodedResourcesList) {
-            cache()->removeFromLiveDecodedResourcesList(this);
-            cache()->insertInLiveDecodedResourcesList(this);
+            memoryCache()->removeFromLiveDecodedResourcesList(this);
+            memoryCache()->insertInLiveDecodedResourcesList(this);
         }
-        cache()->prune();
+        memoryCache()->prune();
     }
 }
     
index 0ac3f4b..1291959 100644 (file)
@@ -78,7 +78,7 @@ static CachedResource* createResource(CachedResource::Type type, const KURL& url
 }
 
 CachedResourceLoader::CachedResourceLoader(Document* document)
-    : m_cache(cache())
+    : m_cache(memoryCache())
     , m_document(document)
     , m_requestCount(0)
     , m_autoLoadImages(true)
@@ -154,14 +154,14 @@ CachedCSSStyleSheet* CachedResourceLoader::requestUserCSSStyleSheet(const String
 {
     KURL url = MemoryCache::removeFragmentIdentifierIfNeeded(KURL(KURL(), requestURL));
 
-    if (CachedResource* existing = cache()->resourceForURL(url)) {
+    if (CachedResource* existing = memoryCache()->resourceForURL(url)) {
         if (existing->type() == CachedResource::CSSStyleSheet)
             return static_cast<CachedCSSStyleSheet*>(existing);
-        cache()->remove(existing);
+        memoryCache()->remove(existing);
     }
     CachedCSSStyleSheet* userSheet = new CachedCSSStyleSheet(url, charset);
     
-    bool inCache = cache()->add(userSheet);
+    bool inCache = memoryCache()->add(userSheet);
     if (!inCache)
         userSheet->setInCache(true);
     
@@ -284,7 +284,7 @@ CachedResource* CachedResourceLoader::requestResource(CachedResource::Type type,
         return 0;
     }
 
-    if (cache()->disabled()) {
+    if (memoryCache()->disabled()) {
         DocumentResourceMap::iterator it = m_documentResources.find(url.string());
         if (it != m_documentResources.end()) {
             it->second->setOwningCachedResourceLoader(0);
@@ -293,21 +293,21 @@ CachedResource* CachedResourceLoader::requestResource(CachedResource::Type type,
     }
 
     // See if we can use an existing resource from the cache.
-    CachedResource* resource = cache()->resourceForURL(url);
+    CachedResource* resource = memoryCache()->resourceForURL(url);
 
     switch (determineRevalidationPolicy(type, forPreload, resource)) {
     case Load:
         resource = loadResource(type, url, charset, priority);
         break;
     case Reload:
-        cache()->remove(resource);
+        memoryCache()->remove(resource);
         resource = loadResource(type, url, charset, priority);
         break;
     case Revalidate:
         resource = revalidateResource(resource, priority);
         break;
     case Use:
-        cache()->resourceAccessed(resource);
+        memoryCache()->resourceAccessed(resource);
         notifyLoadedFromMemoryCache(resource);
         break;
     }
@@ -325,7 +325,7 @@ CachedResource* CachedResourceLoader::revalidateResource(CachedResource* resourc
 {
     ASSERT(resource);
     ASSERT(resource->inCache());
-    ASSERT(!cache()->disabled());
+    ASSERT(!memoryCache()->disabled());
     ASSERT(resource->canUseCacheValidator());
     ASSERT(!resource->resourceToRevalidate());
     
@@ -335,8 +335,8 @@ CachedResource* CachedResourceLoader::revalidateResource(CachedResource* resourc
     LOG(ResourceLoading, "Resource %p created to revalidate %p", newResource, resource);
     newResource->setResourceToRevalidate(resource);
     
-    cache()->remove(resource);
-    cache()->add(newResource);
+    memoryCache()->remove(resource);
+    memoryCache()->add(newResource);
     
     newResource->setLoadPriority(priority);
     newResource->load(this);
@@ -347,13 +347,13 @@ CachedResource* CachedResourceLoader::revalidateResource(CachedResource* resourc
 
 CachedResource* CachedResourceLoader::loadResource(CachedResource::Type type, const KURL& url, const String& charset, ResourceLoadPriority priority)
 {
-    ASSERT(!cache()->resourceForURL(url));
+    ASSERT(!memoryCache()->resourceForURL(url));
     
     LOG(ResourceLoading, "Loading CachedResource for '%s'.", url.string().latin1().data());
     
     CachedResource* resource = createResource(type, url, charset);
     
-    bool inCache = cache()->add(resource);
+    bool inCache = memoryCache()->add(resource);
     
     // Pretend the resource is in the cache, to prevent it from being deleted during the load() call.
     // FIXME: CachedResource should just use normal refcounting instead.
@@ -371,7 +371,7 @@ CachedResource* CachedResourceLoader::loadResource(CachedResource::Type type, co
     // We don't support immediate loads, but we do support immediate failure.
     if (resource->errorOccurred()) {
         if (inCache)
-            cache()->remove(resource);
+            memoryCache()->remove(resource);
         else
             delete resource;
         return 0;
@@ -633,7 +633,7 @@ void CachedResourceLoader::clearPreloads()
         if (res->canDelete() && !res->inCache())
             delete res;
         else if (res->preloadResult() == CachedResource::PreloadNotReferenced)
-            cache()->remove(res);
+            memoryCache()->remove(res);
     }
     m_preloads.clear();
 }
@@ -677,7 +677,7 @@ void CachedResourceLoader::printPreloadStats()
         }
         
         if (res->errorOccurred())
-            cache()->remove(res);
+            memoryCache()->remove(res);
         
         res->decreasePreloadCount();
     }
index 827bb8e..d5e1adf 100644 (file)
@@ -122,7 +122,7 @@ PassRefPtr<CachedResourceRequest> CachedResourceRequest::load(CachedResourceLoad
         cachedResourceLoader->decrementRequestCount(resource);
         cachedResourceLoader->loadFinishing();
         if (resource->resourceToRevalidate()) 
-            cache()->revalidationFailed(resource); 
+            memoryCache()->revalidationFailed(resource); 
         resource->error(CachedResource::LoadError);
         cachedResourceLoader->loadDone(0);
         return 0;
@@ -186,7 +186,7 @@ void CachedResourceRequest::didFail(bool cancelled)
     m_loader->clearClient();
 
     if (m_resource->resourceToRevalidate())
-        cache()->revalidationFailed(m_resource);
+        memoryCache()->revalidationFailed(m_resource);
 
     if (!cancelled) {
         m_cachedResourceLoader->loadFinishing();
@@ -194,7 +194,7 @@ void CachedResourceRequest::didFail(bool cancelled)
     }
 
     if (cancelled || !m_resource->isPreloaded())
-        cache()->remove(m_resource);
+        memoryCache()->remove(m_resource);
     
     m_cachedResourceLoader->loadDone(this);
 }
@@ -211,7 +211,7 @@ void CachedResourceRequest::didReceiveResponse(SubresourceLoader* loader, const
             m_finishing = true;
 
             // Existing resource is ok, just use it updating the expiration time.
-            cache()->revalidationSucceeded(m_resource, response);
+            memoryCache()->revalidationSucceeded(m_resource, response);
             
             if (m_cachedResourceLoader->frame())
                 m_cachedResourceLoader->frame()->loader()->checkCompleted();
@@ -220,7 +220,7 @@ void CachedResourceRequest::didReceiveResponse(SubresourceLoader* loader, const
             return;
         } 
         // Did not get 304 response, continue as a regular resource load.
-        cache()->revalidationFailed(m_resource);
+        memoryCache()->revalidationFailed(m_resource);
     }
 
     m_resource->setResponse(response);
index 930033a..6689524 100644 (file)
@@ -50,7 +50,7 @@ static const double cMinDelayBeforeLiveDecodedPrune = 1; // Seconds.
 static const float cTargetPrunePercentage = .95f; // Percentage of capacity toward which we prune, to avoid immediately pruning again.
 static const double cDefaultDecodedDataDeletionInterval = 0;
 
-MemoryCache* cache()
+MemoryCache* memoryCache()
 {
     static MemoryCache* staticCache = new MemoryCache;
     return staticCache;
index 2798fba..287e097 100644 (file)
@@ -72,7 +72,7 @@ class KURL;
 
 class MemoryCache : public Noncopyable {
 public:
-    friend MemoryCache* cache();
+    friend MemoryCache* memoryCache();
 
     typedef HashMap<String, CachedResource*> CachedResourceMap;
 
@@ -219,7 +219,7 @@ inline bool MemoryCache::shouldMakeResourcePurgeableOnEviction()
 }
 
 // Function to obtain the global cache.
-MemoryCache* cache();
+MemoryCache* memoryCache();
 
 }
 
index 52b4a08..fdc8e10 100644 (file)
@@ -1,3 +1,16 @@
+2011-01-14  Yuzo Fujishima  <yuzo@google.com>
+
+        Reviewed by Antti Koivisto.
+
+        Rename cache() to memoryCache()
+        https://bugs.webkit.org/show_bug.cgi?id=52433
+
+        * src/WebCache.cpp:
+        (WebKit::WebCache::setCapacities):
+        (WebKit::WebCache::clear):
+        (WebKit::WebCache::getUsageStats):
+        (WebKit::WebCache::getResourceTypeStats):
+
 2011-01-14  Jochen Eisinger  <jochen@chromium.org>
 
         Unreviewed, roll chromium deps to r71432.
index 2203498..7df4c66 100644 (file)
@@ -56,7 +56,7 @@ static void ToResourceTypeStat(const MemoryCache::TypeStatistic& from,
 void WebCache::setCapacities(
     size_t minDeadCapacity, size_t maxDeadCapacity, size_t capacity)
 {
-    MemoryCache* cache = WebCore::cache();
+    MemoryCache* cache = WebCore::memoryCache();
     if (cache)
         cache->setCapacities(static_cast<unsigned int>(minDeadCapacity),
                              static_cast<unsigned int>(maxDeadCapacity),
@@ -65,7 +65,7 @@ void WebCache::setCapacities(
 
 void WebCache::clear()
 {
-    MemoryCache* cache = WebCore::cache();
+    MemoryCache* cache = WebCore::memoryCache();
     if (cache && !cache->disabled()) {
         cache->setDisabled(true);
         cache->setDisabled(false);
@@ -76,7 +76,7 @@ void WebCache::getUsageStats(UsageStats* result)
 {
     ASSERT(result);
 
-    MemoryCache* cache = WebCore::cache();
+    MemoryCache* cache = WebCore::memoryCache();
     if (cache) {
         result->minDeadCapacity = cache->m_minDeadCapacity;
         result->maxDeadCapacity = cache->m_maxDeadCapacity;
@@ -89,7 +89,7 @@ void WebCache::getUsageStats(UsageStats* result)
 
 void WebCache::getResourceTypeStats(ResourceTypeStats* result)
 {
-    MemoryCache* cache = WebCore::cache();
+    MemoryCache* cache = WebCore::memoryCache();
     if (cache) {
         MemoryCache::Statistics stats = cache->getStatistics();
         ToResourceTypeStat(stats.images, result->images);
index e4b7acd..8d558e9 100644 (file)
@@ -1,3 +1,13 @@
+2011-01-14  Yuzo Fujishima  <yuzo@google.com>
+
+        Reviewed by Antti Koivisto.
+
+        Rename cache() to memoryCache()
+        https://bugs.webkit.org/show_bug.cgi?id=52433
+
+        * webkit/webkitglobals.cpp:
+        (webkit_set_cache_model):
+
 2011-01-14  Pavel Feldman  <pfeldman@chromium.org>
 
         Not reviewed: gtk build fix (2).
index 6b57533..a97d53f 100644 (file)
@@ -138,8 +138,8 @@ void webkit_set_cache_model(WebKitCacheModel model)
         g_return_if_reached();
     }
 
-    cache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
-    cache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
+    memoryCache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
+    memoryCache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
     pageCache()->setCapacity(pageCacheCapacity);
     cacheModel = model;
 }
index 59854e0..9e7b4a8 100644 (file)
@@ -1,3 +1,17 @@
+2011-01-14  Yuzo Fujishima  <yuzo@google.com>
+
+        Reviewed by Antti Koivisto.
+
+        Rename cache() to memoryCache()
+        https://bugs.webkit.org/show_bug.cgi?id=52433
+
+        * Misc/WebCache.mm:
+        (+[WebCache statistics]):
+        (+[WebCache setDisabled:]):
+        (+[WebCache isDisabled]):
+        * WebView/WebView.mm:
+        (+[WebView _setCacheModel:]):
+
 2011-01-13  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Oliver Hunt.
index 0517bc4..2833691 100644 (file)
@@ -43,7 +43,7 @@
 
 + (NSArray *)statistics
 {
-    WebCore::MemoryCache::Statistics s = WebCore::cache()->getStatistics();
+    WebCore::MemoryCache::Statistics s = WebCore::memoryCache()->getStatistics();
 
     return [NSArray arrayWithObjects:
         [NSDictionary dictionaryWithObjectsAndKeys:
     if (!pthread_main_np())
         return [[self _webkit_invokeOnMainThread] setDisabled:disabled];
 
-    WebCore::cache()->setDisabled(disabled);
+    WebCore::memoryCache()->setDisabled(disabled);
 }
 
 + (BOOL)isDisabled
 {
-    return WebCore::cache()->disabled();
+    return WebCore::memoryCache()->disabled();
 }
 
 @end
index 49582b5..809b286 100644 (file)
@@ -5570,8 +5570,8 @@ static inline uint64_t roundUpToPowerOf2(uint64_t num)
     // Don't shrink a big disk cache, since that would cause churn.
     nsurlCacheDiskCapacity = max(nsurlCacheDiskCapacity, [nsurlCache diskCapacity]);
 
-    cache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
-    cache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
+    memoryCache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
+    memoryCache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
     pageCache()->setCapacity(pageCacheCapacity);
     [nsurlCache setMemoryCapacity:nsurlCacheMemoryCapacity];
     [nsurlCache setDiskCapacity:nsurlCacheDiskCapacity];
index 687c7a3..fce2832 100644 (file)
@@ -498,7 +498,7 @@ void QWebPagePrivate::_q_cleanupLeakMessages()
 {
 #ifndef NDEBUG
     // Need this to make leak messages accurate.
-    cache()->setCapacities(0, 0, 0);
+    memoryCache()->setCapacities(0, 0, 0);
 #endif
 }
 
index 6c59d73..9bb187e 100644 (file)
@@ -757,9 +757,9 @@ void QWebSettings::clearMemoryCaches()
     // Turn the cache on and off.  Disabling the object cache will remove all
     // resources from the cache.  They may still live on if they are referenced
     // by some Web page though.
-    if (!WebCore::cache()->disabled()) {
-        WebCore::cache()->setDisabled(true);
-        WebCore::cache()->setDisabled(false);
+    if (!WebCore::memoryCache()->disabled()) {
+        WebCore::memoryCache()->setDisabled(true);
+        WebCore::memoryCache()->setDisabled(false);
     }
 
     int pageCapacity = WebCore::pageCache()->capacity();
@@ -819,9 +819,9 @@ int QWebSettings::maximumPagesInCache()
 void QWebSettings::setObjectCacheCapacities(int cacheMinDeadCapacity, int cacheMaxDead, int totalCapacity)
 {
     bool disableCache = !cacheMinDeadCapacity && !cacheMaxDead && !totalCapacity;
-    WebCore::cache()->setDisabled(disableCache);
+    WebCore::memoryCache()->setDisabled(disableCache);
 
-    WebCore::cache()->setCapacities(qMax(0, cacheMinDeadCapacity),
+    WebCore::memoryCache()->setCapacities(qMax(0, cacheMinDeadCapacity),
                                     qMax(0, cacheMaxDead),
                                     qMax(0, totalCapacity));
 }
index 46a8e6c..48dd5d7 100644 (file)
@@ -1,3 +1,16 @@
+2011-01-14  Yuzo Fujishima  <yuzo@google.com>
+
+        Reviewed by Antti Koivisto.
+
+        Rename cache() to memoryCache()
+        https://bugs.webkit.org/show_bug.cgi?id=52433
+
+        * Api/qwebpage.cpp:
+        (QWebPagePrivate::_q_cleanupLeakMessages):
+        * Api/qwebsettings.cpp:
+        (QWebSettings::clearMemoryCaches):
+        (QWebSettings::setObjectCacheCapacities):
+
 2011-01-14  Konstantin Tokarev  <annulen@yandex.ru>
 
         Reviewed by Laszlo Gombos.
index c80f091..438a760 100644 (file)
@@ -1,3 +1,18 @@
+2011-01-14  Yuzo Fujishima  <yuzo@google.com>
+
+        Reviewed by Antti Koivisto.
+
+        Rename cache() to memoryCache()
+        https://bugs.webkit.org/show_bug.cgi?id=52433
+
+        * WebCache.cpp:
+        (WebCache::statistics):
+        (WebCache::empty):
+        (WebCache::setDisabled):
+        (WebCache::disabled):
+        * WebView.cpp:
+        (WebView::setCacheModel):
+
 2011-01-10  Geoffrey Garen  <ggaren@apple.com>
 
         Try to fix Windows build.
index dff53fe..c7d0f31 100644 (file)
@@ -100,7 +100,7 @@ HRESULT STDMETHODCALLTYPE WebCache::statistics(
     if (!s)
         return S_OK;
 
-    WebCore::MemoryCache::Statistics stat = WebCore::cache()->getStatistics();
+    WebCore::MemoryCache::Statistics stat = WebCore::memoryCache()->getStatistics();
 
     static CFStringRef imagesKey = CFSTR("images");
     static CFStringRef stylesheetsKey = CFSTR("style sheets");
@@ -204,10 +204,10 @@ HRESULT STDMETHODCALLTYPE WebCache::statistics(
 
 HRESULT STDMETHODCALLTYPE WebCache::empty( void)
 {
-    if (WebCore::cache()->disabled())
+    if (WebCore::memoryCache()->disabled())
         return S_OK;
-    WebCore::cache()->setDisabled(true);
-    WebCore::cache()->setDisabled(false);
+    WebCore::memoryCache()->setDisabled(true);
+    WebCore::memoryCache()->setDisabled(false);
 
     // Empty the application cache.
     WebCore::cacheStorage().empty();
@@ -221,7 +221,7 @@ HRESULT STDMETHODCALLTYPE WebCache::empty( void)
 HRESULT STDMETHODCALLTYPE WebCache::setDisabled( 
     /* [in] */ BOOL disabled)
 {
-    WebCore::cache()->setDisabled(!!disabled);
+    WebCore::memoryCache()->setDisabled(!!disabled);
     return S_OK;
 }
 
@@ -230,6 +230,6 @@ HRESULT STDMETHODCALLTYPE WebCache::disabled(
 {
     if (!disabled)
         return E_POINTER;
-    *disabled = WebCore::cache()->disabled();
+    *disabled = WebCore::memoryCache()->disabled();
     return S_OK;
 }
index f0d504e..0aaf6c2 100644 (file)
@@ -595,8 +595,8 @@ void WebView::setCacheModel(WebCacheModel cacheModel)
     // Don't shrink a big disk cache, since that would cause churn.
     cfurlCacheDiskCapacity = max(cfurlCacheDiskCapacity, CFURLCacheDiskCapacity(cfurlCache.get()));
 
-    cache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
-    cache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
+    memoryCache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
+    memoryCache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
     pageCache()->setCapacity(pageCacheCapacity);
 
     CFURLCacheSetMemoryCapacity(cfurlCache.get(), cfurlCacheMemoryCapacity);
index e175b92..4862225 100644 (file)
@@ -1,3 +1,13 @@
+2011-01-14  Yuzo Fujishima  <yuzo@google.com>
+
+        Reviewed by Antti Koivisto.
+
+        Rename cache() to memoryCache()
+        https://bugs.webkit.org/show_bug.cgi?id=52433
+
+        * WebView.cpp:
+        (wxWebView::SetCachePolicy):
+
 2011-01-09  Xianzhu Wang <phnixwxz@gmail.com>
 
         Reviewed by Darin Fisher.
index 667aa88..0df3879 100644 (file)
@@ -270,7 +270,7 @@ static wxWebViewCachePolicy gs_cachePolicy;
 /* static */
 void wxWebView::SetCachePolicy(const wxWebViewCachePolicy& cachePolicy)
 {
-    WebCore::MemoryCache* globalCache = WebCore::cache();
+    WebCore::MemoryCache* globalCache = WebCore::memoryCache();
     globalCache->setCapacities(cachePolicy.GetMinDeadCapacity(),
                                cachePolicy.GetMaxDeadCapacity(),
                                cachePolicy.GetCapacity());
index 68b7db5..ece619f 100644 (file)
@@ -1,3 +1,18 @@
+2011-01-14  Yuzo Fujishima  <yuzo@google.com>
+
+        Reviewed by Antti Koivisto.
+
+        Rename cache() to memoryCache()
+        https://bugs.webkit.org/show_bug.cgi?id=52433
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::shutdownIfPossible):
+        (WebKit::WebProcess::didClose):
+        * WebProcess/mac/WebProcessMac.mm:
+        (WebKit::WebProcess::platformSetCacheModel):
+        * WebProcess/win/WebProcessWin.cpp:
+        (WebKit::WebProcess::platformSetCacheModel):
+
 2011-01-13  Geoffrey Garen  <ggaren@apple.com>
 
         Reviewed by Oliver Hunt.
index 4f572e3..47f4125 100644 (file)
@@ -469,7 +469,7 @@ void WebProcess::shutdownIfPossible()
 
 #ifndef NDEBUG
     gcController().garbageCollectNow();
-    cache()->setDisabled(true);
+    memoryCache()->setDisabled(true);
 #endif
 
     // Invalidate our connection.
@@ -551,7 +551,7 @@ void WebProcess::didClose(CoreIPC::Connection*)
     pages.clear();
 
     gcController().garbageCollectNow();
-    cache()->setDisabled(true);
+    memoryCache()->setDisabled(true);
 #endif    
 
     // The UI process closed this connection, shut down.
index 18dad6a..c899fcb 100644 (file)
@@ -95,8 +95,8 @@ void WebProcess::platformSetCacheModel(CacheModel cacheModel)
         pageCacheCapacity, urlCacheMemoryCapacity, urlCacheDiskCapacity);
 
 
-    cache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
-    cache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
+    memoryCache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
+    memoryCache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
     pageCache()->setCapacity(pageCacheCapacity);
 
     NSURLCache *nsurlCache = [NSURLCache sharedURLCache];
index 780af0b..7f53cd3 100644 (file)
@@ -87,8 +87,8 @@ void WebProcess::platformSetCacheModel(CacheModel cacheModel)
         cacheTotalCapacity, cacheMinDeadCapacity, cacheMaxDeadCapacity, deadDecodedDataDeletionInterval,
         pageCacheCapacity, urlCacheMemoryCapacity, urlCacheDiskCapacity);
 
-    cache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
-    cache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
+    memoryCache()->setCapacities(cacheMinDeadCapacity, cacheMaxDeadCapacity, cacheTotalCapacity);
+    memoryCache()->setDeadDecodedDataDeletionInterval(deadDecodedDataDeletionInterval);
     pageCache()->setCapacity(pageCacheCapacity);
 
     RetainPtr<CFURLCacheRef> cfurlCache(AdoptCF, CFURLCacheCopySharedURLCache());