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

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

Issue 1309393007: [poc] redecode Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: resetColorProfileForTesting rename Created 5 years, 1 month 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 93853b0271992d367300e8e9b9334bc069ff02a5..245732c51b72ed305657f3ebd21f1dc724046318 100644
--- a/third_party/WebKit/Source/core/fetch/ImageResource.cpp
+++ b/third_party/WebKit/Source/core/fetch/ImageResource.cpp
@@ -337,6 +337,31 @@ void ImageResource::updateImage(bool allDataReceived)
}
}
+void ImageResource::deviceProfileChanged(const blink::Image* image, ColorSpaceProfile* deviceProfile)
+{
+ if (!image || image != m_image)
+ return;
+
+ RELEASE_ASSERT(m_image && m_image->isBitmapImage());
+
+ BitmapImage* bitmapImage = toBitmapImage(this->image());
+ RELEASE_ASSERT(bitmapImage->hasColorProfile());
+
+ bool allDataReceived = bitmapImage->isAllDataReceived();
+ if (!bitmapImage->resetDecoder(deviceProfile))
+ return;
+
+ bool sizeAvailable = m_image->setData(m_data, allDataReceived);
+
+ if (sizeAvailable || allDataReceived) {
+ if (!m_image || m_image->isNull()) {
+ error(errorOccurred() ? status() : DecodeError);
+ if (memoryCache()->contains(this))
+ memoryCache()->remove(this);
+ }
+ }
+}
+
void ImageResource::finishOnePart()
{
if (loadingMultipartContent())
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ImageResource.h ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698