Commit 3f18aeee authored by andersca's avatar andersca
Browse files

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):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20206 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent eddb0571
2007-03-14 Anders Carlsson <acarlsson@apple.com>
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):
2007-03-14 David Harrison <harrison@apple.com>
 
Reviewed by Maciej.
......
......@@ -27,6 +27,7 @@
*/
#import <WebCore/DocumentLoader.h>
#import <wtf/HashSet.h>
@class WebDataSource;
......@@ -50,5 +51,5 @@ public:
private:
WebDataSource *m_dataSource;
bool m_hasEverBeenDetached;
unsigned m_loadCount;
HashSet<unsigned long> m_loadingResources;
};
......@@ -34,18 +34,10 @@
using namespace WebCore;
static HashSet<unsigned long>& loadingResources()
{
static HashSet<unsigned long> resources;
return resources;
}
WebDocumentLoaderMac::WebDocumentLoaderMac(const ResourceRequest& request, const SubstituteData& substituteData)
: DocumentLoader(request, substituteData)
, m_dataSource(nil)
, m_hasEverBeenDetached(false)
, m_loadCount(0)
{
}
......@@ -64,7 +56,7 @@ WebDataSource *WebDocumentLoaderMac::dataSource() const
void WebDocumentLoaderMac::attachToFrame()
{
DocumentLoader::attachToFrame();
ASSERT(m_loadCount == 0);
ASSERT(m_loadingResources.isEmpty());
if (m_hasEverBeenDetached)
HardRetain(m_dataSource);
......@@ -82,25 +74,21 @@ void WebDocumentLoaderMac::increaseLoadCount(unsigned long identifier)
{
ASSERT(m_dataSource);
if (loadingResources().contains(identifier))
if (m_loadingResources.contains(identifier))
return;
loadingResources().add(identifier);
if (m_loadCount == 0)
if (m_loadingResources.isEmpty() == 0)
HardRetain(m_dataSource);
m_loadCount++;
m_loadingResources.add(identifier);
}
void WebDocumentLoaderMac::decreaseLoadCount(unsigned long identifier)
{
ASSERT(m_loadCount > 0);
loadingResources().remove(identifier);
ASSERT(m_loadingResources.contains(identifier));
m_loadCount--;
if (m_loadCount == 0)
m_loadingResources.remove(identifier);
if (m_loadingResources.isEmpty())
HardRelease(m_dataSource);
}
Markdown is supported
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