Chromium Code Reviews| 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; |
| } |
| } |