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

Unified Diff: third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h

Issue 2642823005: Phase II Step 1: Remove updateImage() reentrancy around decodeError() (Closed)
Patch Set: Rebase Created 3 years, 10 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/loader/resource/ImageResourceContent.h
diff --git a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h
index af9c6fe70e2a7d0ac2576219a60747e4c02ee631..9d6417aebcf6c3fc086ed036a04aa9621fb8df54 100644
--- a/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h
+++ b/third_party/WebKit/Source/core/loader/resource/ImageResourceContent.h
@@ -132,9 +132,16 @@ class CORE_EXPORT ImageResourceContent final
// Clears the image and always notifies observers (without updating).
ClearImageAndNotifyObservers,
};
- void updateImage(PassRefPtr<SharedBuffer>,
- UpdateImageOption,
- bool allDataReceived);
+ enum class UpdateImageResult {
+ NoDecodeError,
+
+ // Decode error occurred. Observers are not notified.
+ // Only occurs when UpdateImage or ClearAndUpdateImage is specified.
+ ShouldDecodeError,
+ };
+ WARN_UNUSED_RESULT UpdateImageResult updateImage(PassRefPtr<SharedBuffer>,
+ UpdateImageOption,
+ bool allDataReceived);
void destroyDecodedData();
void doResetAnimation();
@@ -181,6 +188,10 @@ class CORE_EXPORT ImageResourceContent final
// Indicates if this resource's encoded image data can be purged and refetched
// from disk cache to save memory usage. See crbug/664437.
bool m_isRefetchableDataFromDiskCache;
+
+#if DCHECK_IS_ON()
+ bool m_isUpdateImageBeingCalled = false;
+#endif
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698