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

Unified Diff: third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp

Issue 2155973002: Save a bitmap copy when advancing to dependent GIF and WebP animation frames (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: finalizePixelsAndGetImage. Created 4 years, 4 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/modules/notifications/NotificationImageLoader.cpp
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp
index 530aee3d338b7529ad0aed1f37fa86912648c35f..02fc0739d8b2edec800eae076d67059dd9818594 100644
--- a/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp
+++ b/third_party/WebKit/Source/modules/notifications/NotificationImageLoader.cpp
@@ -95,8 +95,11 @@ void NotificationImageLoader::didFinishLoading(unsigned long resourceIdentifier,
decoder->setData(m_data.get(), true /* allDataReceived */);
// The |ImageFrame*| is owned by the decoder.
ImageFrame* imageFrame = decoder->frameBufferAtIndex(0);
- if (imageFrame) {
- (*m_imageCallback)(imageFrame->bitmap());
+ DCHECK(decoder->failed() || imageFrame->getStatus() == ImageFrame::FrameComplete);
Peter Kasting 2016/08/30 06:59:40 This check isn't safe if somehow failed() is false
aleksandar.stojiljkovic 2016/09/21 20:56:57 Done. Reverted. As allDataReceived is set to true
+ if (imageFrame && imageFrame->getStatus() == ImageFrame::FrameComplete) {
+ SkBitmap bitmap = imageFrame->bitmap();
+ bitmap.setImmutable();
Peter Kasting 2016/08/30 06:59:40 Why is setting the bitmap as immutable here import
aleksandar.stojiljkovic 2016/09/21 20:56:57 That was my plan too, with all the cases where SkB
aleksandar.stojiljkovic 2016/09/21 20:56:57 Reverted this to original implementation - in Imag
Peter Kasting 2016/09/21 21:54:49 Blink is Chrome's fork, so we assume that we only
aleksandar.stojiljkovic 2016/09/22 09:41:19 Checked in details - a lot of layout tests are usi
+ (*m_imageCallback)(bitmap);
return;
}
}

Powered by Google App Engine
This is Rietveld 408576698