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

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

Issue 2176603002: Simplify the condition for destroyDecodedData() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: (rebase) Created 4 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 84ff1845cd93b674edf5c89a12f5b25f92fc429c..aa570eceff4acb20e4c83cef9ed92b345dfa74e9 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
@@ -209,8 +209,8 @@ void ImageResource::destroyDecodedDataIfPossible()
{
if (!m_image)
return;
- if ((!hasClientsOrObservers() && !isLoading() && m_image->hasOneRef() && m_image->isBitmapImage()) || !errorOccurred())
- m_image->destroyDecodedData();
+ CHECK(!errorOccurred());
+ m_image->destroyDecodedData();
}
void ImageResource::doResetAnimation()
@@ -221,7 +221,8 @@ void ImageResource::doResetAnimation()
void ImageResource::allClientsAndObserversRemoved()
{
- if (m_image && !errorOccurred()) {
+ if (m_image) {
+ CHECK(!errorOccurred());
// If possible, delay the resetting until back at the event loop.
// Doing so after a conservative GC prevents resetAnimation() from
// upsetting ongoing animation updates (crbug.com/613709)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698