Changeset 31084 in webkit


Ignore:
Timestamp:
Mar 16, 2008 1:53:39 PM (16 years ago)
Author:
Antti Koivisto
Message:

WebCore:

Reviewed by Darin.


Fix http://bugs.webkit.org/show_bug.cgi?id=17862
REGRESSION (r31038): Reproducible crash under DocLoader::checkForReload() at marware.com


This was a memory smasher introduced by the preloading patch.
If a script resource was marked uncacheable, early deletion of the
Request object would cause deletion of the CachedResource too if
it was referred more than once in a single document.

Test: http/tests/misc/uncacheable-script-repeated.html

  • loader/loader.cpp: (WebCore::Loader::Host::servePendingRequests): (WebCore::Loader::Host::didFinishLoading):

LayoutTests:

Reviewed by Darin.


Test for http://bugs.webkit.org/show_bug.cgi?id=17862
REGRESSION (r31038): Reproducible crash under DocLoader::checkForReload() at marware.com

  • http/tests/misc/resources/uncacheable-script.cgi: Added.
  • http/tests/misc/uncacheable-script-repeated-expected.txt: Added.
  • http/tests/misc/uncacheable-script-repeated.html: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r31083 r31084  
     12008-03-16  Antti Koivisto  <antti@apple.com>
     2
     3        Reviewed by Darin.
     4       
     5        Test for http://bugs.webkit.org/show_bug.cgi?id=17862
     6        REGRESSION (r31038): Reproducible crash under DocLoader::checkForReload() at marware.com
     7
     8        * http/tests/misc/resources/uncacheable-script.cgi: Added.
     9        * http/tests/misc/uncacheable-script-repeated-expected.txt: Added.
     10        * http/tests/misc/uncacheable-script-repeated.html: Added.
     11
    1122008-03-16  Yuzhu Shen  <yuzhu.shen@gmail.com>
    213
  • trunk/WebCore/ChangeLog

    r31083 r31084  
     12008-03-16  Antti Koivisto  <antti@apple.com>
     2
     3        Reviewed by Darin.
     4       
     5        Fix http://bugs.webkit.org/show_bug.cgi?id=17862
     6        REGRESSION (r31038): Reproducible crash under DocLoader::checkForReload() at marware.com
     7       
     8        This was a memory smasher introduced by the preloading patch.
     9        If a script resource was marked uncacheable, early deletion of the
     10        Request object would cause deletion of the CachedResource too if
     11        it was referred more than once in a single document.
     12
     13        Test: http/tests/misc/uncacheable-script-repeated.html
     14
     15        * loader/loader.cpp:
     16        (WebCore::Loader::Host::servePendingRequests):
     17        (WebCore::Loader::Host::didFinishLoading):
     18
    1192008-03-16  Yuzhu Shen  <yuzhu.shen@gmail.com>
    220
  • trunk/WebCore/loader/loader.cpp

    r31041 r31084  
    236236            request->cachedResource()->setRequestedFromNetworkingLayer();
    237237#if REQUEST_DEBUG
    238             printf("HOST %s COUNT %d LOADING %s\n", resourceRequest.url().host().latin1().data(), m_requestsLoading.size(), req->cachedResource()->url().latin1().data());
     238            printf("HOST %s COUNT %d LOADING %s\n", resourceRequest.url().host().latin1().data(), m_requestsLoading.size(), request->cachedResource()->url().latin1().data());
    239239#endif
    240240        } else {           
     
    261261
    262262    CachedResource* resource = request->cachedResource();
    263     delete request;
    264263
    265264    // If we got a 4xx response, we're pretending to have received a network
     
    270269        resource->finish();
    271270    }
     271
     272    delete request;
    272273
    273274    docLoader->setLoadInProgress(false);
Note: See TracChangeset for help on using the changeset viewer.