Index: Source/core/loader/cache/CachedResource.cpp |
diff --git a/Source/core/loader/cache/CachedResource.cpp b/Source/core/loader/cache/CachedResource.cpp |
index e981ad4deae249553e3ac14940b419d9f6bb82f7..013fe807352be4cbe6303df5261c03a9d7a09c70 100644 |
--- a/Source/core/loader/cache/CachedResource.cpp |
+++ b/Source/core/loader/cache/CachedResource.cpp |
@@ -119,6 +119,7 @@ CachedResource::CachedResource(const ResourceRequest& request, Type type) |
, m_handleCount(0) |
, m_preloadCount(0) |
, m_preloadResult(PreloadNotReferenced) |
+ , m_decodePriority(DecodePriorityLow) |
, m_inLiveDecodedResourcesList(false) |
, m_requestedFromNetworkingLayer(false) |
, m_inCache(false) |
@@ -355,6 +356,19 @@ CachedMetadata* CachedResource::cachedMetadata(unsigned dataTypeID) const |
return m_cachedMetadata.get(); |
} |
+void CachedResource::setDecodePriority(DecodePriority priority) |
+{ |
+ m_lastDecodedAccessTime = currentTime(); |
+ if (inCache()) { |
+ if (m_inLiveDecodedResourcesList && m_decodePriority != priority) { |
+ memoryCache()->removeFromLiveDecodedResourcesList(this); |
+ m_decodePriority = priority; |
+ memoryCache()->insertInLiveDecodedResourcesList(this); |
+ } |
+ memoryCache()->prune(); |
+ } |
+} |
+ |
void CachedResource::clearLoader() |
{ |
m_loader = 0; |
@@ -551,7 +565,6 @@ void CachedResource::setEncodedSize(unsigned size) |
void CachedResource::didAccessDecodedData(double timeStamp) |
{ |
m_lastDecodedAccessTime = timeStamp; |
- |
Justin Novosad
2013/07/23 16:55:12
Don't do whitespace edits unless you are changing
|
if (inCache()) { |
if (m_inLiveDecodedResourcesList) { |
memoryCache()->removeFromLiveDecodedResourcesList(this); |
@@ -881,3 +894,4 @@ void CachedResource::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const |
info.addRawBuffer(m_purgeableData.get(), m_purgeableData->size(), "PurgeableData", "purgeableData"); |
} |
} |
+ |