Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(108)

Unified Diff: third_party/WebKit/Source/core/fetch/MemoryCache.cpp

Issue 1566653002: Revert of Fix null dereference on MemoryCache. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 024cbdc1d1091ae30873b344a7916a20475e229f..80ee6f7f81ef1363ca05b5420a33967b947a20dd 100644
--- a/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
+++ b/third_party/WebKit/Source/core/fetch/MemoryCache.cpp
@@ -347,7 +347,7 @@
}
// Decoded data may reference other resources. Stop iterating if 'previous' somehow got
// kicked out of cache during destroyDecodedData().
- if (!previous || !previous->m_resource || !contains(previous->m_resource.get()))
+ if (previous && !contains(previous->m_resource.get()))
break;
current = previous;
}
@@ -372,7 +372,7 @@
if (targetSize && m_deadSize <= targetSize)
return;
}
- if (!previous || !previous->m_resource || !contains(previous->m_resource.get()))
+ if (previous && !contains(previous->m_resource.get()))
break;
current = previous;
}
@@ -791,15 +791,6 @@
}
}
-bool MemoryCache::isInSameLRUListForTest(const Resource* x, const Resource* y)
-{
- MemoryCacheEntry* ex = getEntryForResource(x);
- MemoryCacheEntry* ey = getEntryForResource(y);
- ASSERT(ex);
- ASSERT(ey);
- return lruListFor(ex->m_accessCount, x->size()) == lruListFor(ey->m_accessCount, y->size());
-}
-
void MemoryCache::registerLiveResource(Resource& resource)
{
#if ENABLE(OILPAN)
« no previous file with comments | « third_party/WebKit/Source/core/fetch/MemoryCache.h ('k') | third_party/WebKit/Source/core/fetch/StyleSheetResource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698