Changeset 30587 in webkit


Ignore:
Timestamp:
Feb 25, 2008 8:25:25 PM (16 years ago)
Author:
Beth Dakin
Message:

WebCore:

Reviewed by Geoff.

Fixed for <rdar://problem/5760530> REGRESSION: Assertion failure in
Document::removePendingSheet() from r30438

r30438 added a call to CachedResource::error() from inside
Loader::didReceiveData() if a CSS file 4xxs. There was an
assumption in the loader, though, that either error() would be
called, or didFinishLoading() would be called, so some work is
duplicated in each. Now that we are calling an error() on files
that will also make it to didFinishLoading() (since they succeeded
in the network layer), we need to make sure we do not duplicate the
work. CachedCSSStyleSheet::error() calls checkNotify, which ends up
decrementing the document's pending style sheet counter.
checkNotify() was still getting called, though, through the normal
didFinishLoading code path, and the counter was being decremented
twice. Bad!

  • loader/loader.cpp: (WebCore::Loader::didFinishLoading): (WebCore::Loader::didReceiveData):

LayoutTests:

Reviewed by Geoff.

Test for <rdar://problem/5760530> REGRESSION: Assertion failure in
Document::removePendingSheet() from r30438

  • http/tests/misc/missing-style-sheet-expected.txt: Added.
  • http/tests/misc/missing-style-sheet.html: Added.
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r30578 r30587  
     12008-02-25  Beth Dakin  <bdakin@apple.com>
     2
     3        Reviewed by Geoff.
     4
     5        Test for <rdar://problem/5760530> REGRESSION: Assertion failure in
     6        Document::removePendingSheet() from r30438
     7
     8        * http/tests/misc/missing-style-sheet-expected.txt: Added.
     9        * http/tests/misc/missing-style-sheet.html: Added.
     10
    1112008-02-25  Brady Eidson  <beidson@apple.com>
    212
  • trunk/WebCore/ChangeLog

    r30586 r30587  
     12008-02-25  Beth Dakin  <bdakin@apple.com>
     2
     3        Reviewed by Geoff.
     4
     5        Fixed for <rdar://problem/5760530> REGRESSION: Assertion failure in
     6        Document::removePendingSheet() from r30438
     7
     8        r30438 added a call to CachedResource::error() from inside
     9        Loader::didReceiveData() if a CSS file 4xxs. There was an
     10        assumption in the loader, though, that either error() would be
     11        called, or didFinishLoading() would be called, so some work is
     12        duplicated in each. Now that we are calling an error() on files
     13        that will also make it to didFinishLoading() (since they succeeded
     14        in the network layer), we need to make sure we do not duplicate the
     15        work. CachedCSSStyleSheet::error() calls checkNotify, which ends up
     16        decrementing the document's pending style sheet counter.
     17        checkNotify() was still getting called, though, through the normal 
     18        didFinishLoading code path, and the counter was being decremented
     19        twice. Bad!
     20
     21        * loader/loader.cpp:
     22        (WebCore::Loader::didFinishLoading):
     23        (WebCore::Loader::didReceiveData):
     24
    1252008-02-25  Mark Rowe  <mrowe@apple.com>
    226
  • trunk/WebCore/WebCore.xcodeproj/project.pbxproj

    r30584 r30587  
    1430814308                        isa = PBXProject;
    1430914309                        buildConfigurationList = 149C284308902B11008A9EFC /* Build configuration list for PBXProject "WebCore" */;
     14310                        compatibilityVersion = "Xcode 2.4";
    1431014311                        hasScannedForEncodings = 1;
    1431114312                        knownRegions = (
     
    1432114322                        productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
    1432214323                        projectDirPath = "";
     14324                        projectRoot = "";
    1432314325                        targets = (
    1432414326                                93F198A508245E59001E9ABC /* WebCore */,
  • trunk/WebCore/loader/loader.cpp

    r30438 r30587  
    110110    CachedResource* object = req->cachedResource();
    111111
    112     docLoader->setLoadInProgress(true);
    113     object->data(loader->resourceData(), true);
    114     docLoader->setLoadInProgress(false);
    115     object->finish();
     112    // If we got a 4xx response, we're pretending to have received a network
     113    // error, so we can't send the successful data() and finish() callbacks.
     114    if (!object->errorOccurred()) {
     115        docLoader->setLoadInProgress(true);
     116        object->data(loader->resourceData(), true);
     117        docLoader->setLoadInProgress(false);
     118        object->finish();
     119    }
    116120
    117121    delete req;
     
    199203   
    200204    if (object->response().httpStatusCode() / 100 == 4) {
    201         // Make sure the 4xx error codes result in an error.
     205        // Treat a 4xx response like a network error.
    202206        object->error();
    203207        return;
Note: See TracChangeset for help on using the changeset viewer.