Fix for <rdar://problem/5108896>, make sure the assert for setEncodedSize
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2007 23:31:15 +0000 (23:31 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 3 Apr 2007 23:31:15 +0000 (23:31 +0000)
        deals with the error case.

        Reviewed by andersca

        * loader/CachedResource.cpp:
        (WebCore::CachedResource::setEncodedSize):

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

WebCore/ChangeLog
WebCore/loader/CachedResource.cpp

index 479c038..291f911 100644 (file)
@@ -1,3 +1,13 @@
+2007-04-03  David Hyatt  <hyatt@apple.com>
+
+        Fix for <rdar://problem/5108896>, make sure the assert for setEncodedSize
+        deals with the error case.
+
+        Reviewed by andersca
+
+        * loader/CachedResource.cpp:
+        (WebCore::CachedResource::setEncodedSize):
+
 2007-04-03  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Dave Hyatt.
index ce85b3b..23c171c 100644 (file)
@@ -125,8 +125,8 @@ void CachedResource::setEncodedSize(unsigned size)
     if (size == m_encodedSize)
         return;
 
-    // The size cannot ever shrink.  If it ever does, assert.
-    ASSERT(size >= m_encodedSize);
+    // The size cannot ever shrink (unless it is being nulled out because of an error).  If it ever does, assert.
+    ASSERT(size == 0 || size >= m_encodedSize);
     
     unsigned oldSize = m_encodedSize;