Commit c41a2e4a authored by mihaip@chromium.org's avatar mihaip@chromium.org
Browse files

2011-01-24 Mihai Parparita <mihaip@chromium.org>

        Reviewed by Tony Chang.

        Add runtime checks for invariants in memory cache
        https://bugs.webkit.org/show_bug.cgi?id=53059

        To help track down bug 53045, add some CRASH calls in addition to
        ASSERTs, so that we can track down failures in reliability bots.

        Just some checks, no new tests necessary.

        * css/CSSImageValue.cpp:
        (WebCore::CSSImageValue::cachedImage):
        * loader/cache/CachedResource.h:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::~CachedResource):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76575 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bad4406e
2011-01-24 Mihai Parparita <mihaip@chromium.org>
Reviewed by Tony Chang.
Add runtime checks for invariants in memory cache
https://bugs.webkit.org/show_bug.cgi?id=53059
To help track down bug 53045, add some CRASH calls in addition to
ASSERTs, so that we can track down failures in reliability bots.
Just some checks, no new tests necessary.
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::cachedImage):
* loader/cache/CachedResource.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::~CachedResource):
2011-01-24 Simon Fraser <simon.fraser@apple.com>
 
Reviewed by Dan Bernstein.
......@@ -67,6 +67,10 @@ StyleCachedImage* CSSImageValue::cachedImage(CachedResourceLoader* loader)
StyleCachedImage* CSSImageValue::cachedImage(CachedResourceLoader* loader, const String& url)
{
ASSERT(loader);
if (!loader) {
// FIXME: Remove when http://webkit.org/b/53045 is fixed.
CRASH();
}
if (!m_accessedImage) {
m_accessedImage = true;
......
......@@ -93,8 +93,8 @@ CachedResource::CachedResource(const String& url, Type type)
, m_loading(false)
, m_type(type)
, m_status(Pending)
#ifndef NDEBUG
, m_deleted(false)
#ifndef NDEBUG
, m_lruIndex(0)
#endif
, m_nextInAllResourcesList(0)
......@@ -117,6 +117,12 @@ CachedResource::~CachedResource()
ASSERT(!inCache());
ASSERT(!m_deleted);
ASSERT(url().isNull() || memoryCache()->resourceForURL(KURL(ParsedURLString, url())) != this);
if (m_deleted) {
// FIXME: Remove when http://webkit.org/b/53045 is fixed.
CRASH();
}
#ifndef NDEBUG
m_deleted = true;
cachedResourceLeakCounter.decrement();
......
......@@ -266,8 +266,9 @@ private:
unsigned m_type : 3; // Type
unsigned m_status : 3; // Status
#ifndef NDEBUG
// FIXME: Move m_deleted back inside NDEBUG when http://webkit.org/b/53045 is fixed.
bool m_deleted;
#ifndef NDEBUG
unsigned m_lruIndex;
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment