diff options
author | Ben Murdoch <benm@google.com> | 2011-05-24 11:24:40 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-06-02 09:53:15 +0100 |
commit | 81bc750723a18f21cd17d1b173cd2a4dda9cea6e (patch) | |
tree | 7a9e5ed86ff429fd347a25153107221543909b19 /Source/WebCore/loader/cache/CachedResourceLoader.cpp | |
parent | 94088a6d336c1dd80a1e734af51e96abcbb689a7 (diff) | |
download | external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.zip external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.gz external_webkit-81bc750723a18f21cd17d1b173cd2a4dda9cea6e.tar.bz2 |
Merge WebKit at r80534: Intial merge by Git
Change-Id: Ia7a83357124c9e1cdb1debf55d9661ec0bd09a61
Diffstat (limited to 'Source/WebCore/loader/cache/CachedResourceLoader.cpp')
-rw-r--r-- | Source/WebCore/loader/cache/CachedResourceLoader.cpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/Source/WebCore/loader/cache/CachedResourceLoader.cpp b/Source/WebCore/loader/cache/CachedResourceLoader.cpp index 10c1b6c..57e5ee6 100644 --- a/Source/WebCore/loader/cache/CachedResourceLoader.cpp +++ b/Source/WebCore/loader/cache/CachedResourceLoader.cpp @@ -41,6 +41,7 @@ #include "FrameLoaderClient.h" #include "HTMLElement.h" #include "Logging.h" +#include "NestingLevelIncrementer.h" #include "MemoryCache.h" #include "PingLoader.h" #include "ResourceLoadScheduler.h" @@ -84,14 +85,26 @@ CachedResourceLoader::CachedResourceLoader(Document* document) , m_autoLoadImages(true) , m_loadFinishing(false) , m_allowStaleResources(false) +<<<<<<< HEAD #ifdef ANDROID_BLOCK_NETWORK_IMAGE , m_blockNetworkImage(false) #endif +======= + , m_isInMethod(0) +>>>>>>> WebKit at r80534 { } CachedResourceLoader::~CachedResourceLoader() { + // Try to catch https://bugs.webkit.org/show_bug.cgi?id=54486 + // Crashes under CachedResourceLoader::revalidateResource + // FIXME: Remove this and the related code when it has served its purpose. + if (m_isInMethod) + CRASH(); + + m_document = 0; + cancelRequests(); clearPreloads(); DocumentResourceMap::iterator end = m_documentResources.end(); @@ -116,11 +129,12 @@ CachedResource* CachedResourceLoader::cachedResource(const KURL& resourceURL) co Frame* CachedResourceLoader::frame() const { - return m_document->frame(); + return m_document ? m_document->frame() : 0; } CachedImage* CachedResourceLoader::requestImage(const String& url) { + NestingLevelIncrementer debugIncrementer(m_isInMethod); if (Frame* f = frame()) { Settings* settings = f->settings(); if (!f->loader()->client()->allowImages(!settings || settings->areImagesEnabled())) @@ -158,6 +172,7 @@ CachedCSSStyleSheet* CachedResourceLoader::requestCSSStyleSheet(const String& ur CachedCSSStyleSheet* CachedResourceLoader::requestUserCSSStyleSheet(const String& requestURL, const String& charset) { + NestingLevelIncrementer debugIncrementer(m_isInMethod); KURL url = MemoryCache::removeFragmentIdentifierIfNeeded(KURL(KURL(), requestURL)); if (CachedResource* existing = memoryCache()->resourceForURL(url)) { @@ -269,6 +284,7 @@ bool CachedResourceLoader::canRequest(CachedResource::Type type, const KURL& url CachedResource* CachedResourceLoader::requestResource(CachedResource::Type type, const String& resourceURL, const String& charset, ResourceLoadPriority priority, bool forPreload) { + NestingLevelIncrementer debugIncrementer(m_isInMethod); KURL url = m_document->completeURL(resourceURL); LOG(ResourceLoading, "CachedResourceLoader::requestResource '%s', charset '%s', priority=%d, forPreload=%u", url.string().latin1().data(), charset.latin1().data(), priority, forPreload); @@ -476,6 +492,7 @@ void CachedResourceLoader::printAccessDeniedMessage(const KURL& url) const void CachedResourceLoader::setAutoLoadImages(bool enable) { + NestingLevelIncrementer debugIncrementer(m_isInMethod); if (enable == m_autoLoadImages) return; @@ -552,6 +569,7 @@ void CachedResourceLoader::removeCachedResource(CachedResource* resource) const void CachedResourceLoader::load(CachedResource* resource, bool incremental, SecurityCheckPolicy securityCheck, bool sendResourceLoadCallbacks) { + NestingLevelIncrementer debugIncrementer(m_isInMethod); incrementRequestCount(resource); RefPtr<CachedResourceRequest> request = CachedResourceRequest::load(this, resource, incremental, securityCheck, sendResourceLoadCallbacks); @@ -561,6 +579,7 @@ void CachedResourceLoader::load(CachedResource* resource, bool incremental, Secu void CachedResourceLoader::loadDone(CachedResourceRequest* request) { + NestingLevelIncrementer debugIncrementer(m_isInMethod); m_loadFinishing = false; RefPtr<CachedResourceRequest> protect(request); if (request) @@ -637,6 +656,7 @@ int CachedResourceLoader::requestCount() void CachedResourceLoader::preload(CachedResource::Type type, const String& url, const String& charset, bool referencedFromBody) { + NestingLevelIncrementer debugIncrementer(m_isInMethod); bool hasRendering = m_document->body() && m_document->body()->renderer(); if (!hasRendering && (referencedFromBody || type == CachedResource::ImageResource)) { // Don't preload images or body resources before we have something to draw. This prevents @@ -663,6 +683,7 @@ void CachedResourceLoader::checkForPendingPreloads() void CachedResourceLoader::requestPreload(CachedResource::Type type, const String& url, const String& charset) { + NestingLevelIncrementer debugIncrementer(m_isInMethod); String encoding; if (type == CachedResource::Script || type == CachedResource::CSSStyleSheet) encoding = charset.isEmpty() ? m_document->charset() : charset; |