Index: third_party/WebKit/Source/core/fetch/MemoryCache.cpp |
diff --git a/third_party/WebKit/Source/core/fetch/MemoryCache.cpp b/third_party/WebKit/Source/core/fetch/MemoryCache.cpp |
index 8aa8ab83ad78f9b6479caa3a5a9abe94431b33cd..dba7e46400ef1abdaddab1d3078d641cbffcd9ad 100644 |
--- a/third_party/WebKit/Source/core/fetch/MemoryCache.cpp |
+++ b/third_party/WebKit/Source/core/fetch/MemoryCache.cpp |
@@ -299,7 +299,10 @@ void MemoryCache::pruneDeadResources(PruneStrategy strategy) |
ASSERT(previous->m_resource); |
ASSERT(contains(previous->m_resource.get())); |
} |
- if (!current->m_resource->hasClients() && !current->m_resource->isPreloaded() && current->m_resource->isLoaded()) { |
+ // TODO(leon.han@intel.com): We shouldn't be hitting the case |
+ // that current->m_resource is null here, would turn the case into |
+ // ASSERT(current->m_resource) after crbug.com/594644 got resolved. |
+ if (current->m_resource && !current->m_resource->hasClients() && !current->m_resource->isPreloaded() && current->m_resource->isLoaded()) { |
// Destroy our decoded data. This will remove us from |
// m_liveDecodedResources, and possibly move us to a different |
// LRU list in m_allResources. |
@@ -323,7 +326,10 @@ void MemoryCache::pruneDeadResources(PruneStrategy strategy) |
ASSERT(previous->m_resource); |
ASSERT(contains(previous->m_resource.get())); |
} |
- if (!current->m_resource->hasClients() && !current->m_resource->isPreloaded()) { |
+ // TODO(leon.han@intel.com): We shouldn't be hitting the case |
+ // that current->m_resource is null here, would turn the case into |
+ // ASSERT(current->m_resource) after crbug.com/594644 got resolved. |
+ if (current->m_resource && !current->m_resource->hasClients() && !current->m_resource->isPreloaded()) { |
evict(current); |
if (targetSize && m_deadSize <= targetSize) |
return; |