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

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

Issue 2202473002: DO NOT COMMIT: Experimental removal of encoded image data Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (rebase) Created 4 years, 3 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/ImageResource.cpp
diff --git a/third_party/WebKit/Source/core/fetch/ImageResource.cpp b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
index 9a98251a0e375223dae14098aef57c85805722a0..a15b406c5b15a00548d451f261a76345f65870ec 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
@@ -208,6 +208,18 @@ void ImageResource::destroyDecodedDataIfPossible()
m_image->destroyDecodedData();
}
+void ImageResource::myPrune()
+{
+ if (!m_image)
+ return;
+ if (hasCacheControlNoStoreHeader())
+ return;
+ if (getStatus() != Resource::Cached)
+ return;
+ // Don't call clearImage(). Observers should be kept.
+ m_image->clear();
+}
+
void ImageResource::doResetAnimation()
{
if (m_image)
@@ -548,6 +560,13 @@ void ImageResource::changedInRect(const blink::Image* image, const IntRect& rect
notifyObservers(&rect);
}
+void ImageResource::requireReloading(const blink::Image* image)
+{
+ for (auto* observer : m_finishedObservers.asVector()) {
+ observer->requireReloading();
+ }
+}
+
void ImageResource::onePartInMultipartReceived(const ResourceResponse& response)
{
ASSERT(m_multipartParser);
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.h ('k') | third_party/WebKit/Source/core/fetch/ImageResourceObserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698