Changeset 20206 in webkit


Ignore:
Timestamp:
Mar 14, 2007 9:00:06 PM (17 years ago)
Author:
andersca
Message:

Reviewed by Geoff.

http://bugs.webkit.org/show_bug.cgi?id=13076
REGRESSION: Multiple loading tabs cause assertion in WebDocumentLoaderMac::decreaseLoadCount(unsigned long)

Store the identifier set in the document loader since identifiers are per-webview and not global.


  • WebView/WebDocumentLoaderMac.h:
  • WebView/WebDocumentLoaderMac.mm: (WebDocumentLoaderMac::WebDocumentLoaderMac): (WebDocumentLoaderMac::attachToFrame): (WebDocumentLoaderMac::increaseLoadCount): (WebDocumentLoaderMac::decreaseLoadCount):
Location:
trunk/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/ChangeLog

    r20201 r20206  
     12007-03-14  Anders Carlsson  <acarlsson@apple.com>
     2
     3        Reviewed by Geoff.
     4
     5        http://bugs.webkit.org/show_bug.cgi?id=13076
     6        REGRESSION: Multiple loading tabs cause assertion in WebDocumentLoaderMac::decreaseLoadCount(unsigned long)
     7
     8        Store the identifier set in the document loader since identifiers are per-webview and not global.
     9       
     10        * WebView/WebDocumentLoaderMac.h:
     11        * WebView/WebDocumentLoaderMac.mm:
     12        (WebDocumentLoaderMac::WebDocumentLoaderMac):
     13        (WebDocumentLoaderMac::attachToFrame):
     14        (WebDocumentLoaderMac::increaseLoadCount):
     15        (WebDocumentLoaderMac::decreaseLoadCount):
     16
    1172007-03-14  David Harrison  <harrison@apple.com>
    218
  • trunk/WebKit/WebView/WebDocumentLoaderMac.h

    r20195 r20206  
    2828
    2929#import <WebCore/DocumentLoader.h>
     30#import <wtf/HashSet.h>
    3031
    3132@class WebDataSource;
     
    5152    WebDataSource *m_dataSource;
    5253    bool m_hasEverBeenDetached;
    53     unsigned m_loadCount;
     54    HashSet<unsigned long> m_loadingResources;
    5455};
  • trunk/WebKit/WebView/WebDocumentLoaderMac.mm

    r20195 r20206  
    3535using namespace WebCore;
    3636
    37 static HashSet<unsigned long>& loadingResources()
    38 {
    39     static HashSet<unsigned long> resources;
    40    
    41     return resources;
    42 }
    43 
    4437WebDocumentLoaderMac::WebDocumentLoaderMac(const ResourceRequest& request, const SubstituteData& substituteData)
    4538    : DocumentLoader(request, substituteData)
    4639    , m_dataSource(nil)
    4740    , m_hasEverBeenDetached(false)
    48     , m_loadCount(0)
    4941{
    5042}
     
    6557{
    6658    DocumentLoader::attachToFrame();
    67     ASSERT(m_loadCount == 0);
     59    ASSERT(m_loadingResources.isEmpty());
    6860
    6961    if (m_hasEverBeenDetached)
     
    8375    ASSERT(m_dataSource);
    8476   
    85     if (loadingResources().contains(identifier))
     77    if (m_loadingResources.contains(identifier))
    8678        return;
    87    
    88     loadingResources().add(identifier);
    89        
    90     if (m_loadCount == 0)
     79
     80    if (m_loadingResources.isEmpty() == 0)
    9181        HardRetain(m_dataSource);
    92    
    93     m_loadCount++;
     82
     83    m_loadingResources.add(identifier);
    9484}
    9585
    9686void WebDocumentLoaderMac::decreaseLoadCount(unsigned long identifier)
    9787{
    98     ASSERT(m_loadCount > 0);
    99 
    100     loadingResources().remove(identifier);
     88    ASSERT(m_loadingResources.contains(identifier));
    10189   
    102     m_loadCount--;
    103 
    104     if (m_loadCount == 0)
     90    m_loadingResources.remove(identifier);
     91   
     92    if (m_loadingResources.isEmpty())
    10593        HardRelease(m_dataSource);
    10694}
Note: See TracChangeset for help on using the changeset viewer.