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

Unified Diff: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp

Issue 2037373002: Remove the use of OwnedPtrDeleter in ImageDecoder. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Move QCMSProfileDeleter to .cpp file. Created 4 years, 6 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 | « third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
index 300a627ca974e5541511d009d29cd47b1220084c..73620fb5e32cb3ffabbd4bf28317e692c075ebc7 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp
@@ -32,6 +32,19 @@
namespace blink {
+#if USE(QCMSLIB)
+struct QCMSProfileDeleter {
+ void operator()(qcms_profile* profile)
+ {
+ if (profile)
+ qcms_profile_release(profile);
+ }
+};
+
+using QCMSProfileUniquePtr = std::unique_ptr<qcms_profile, QCMSProfileDeleter>;
+#endif // USE(QCMSLIB)
+
+
inline bool matchesJPEGSignature(const char* contents)
{
return !memcmp(contents, "\xFF\xD8\xFF", 3);
@@ -309,9 +322,9 @@ void ImageDecoder::setColorProfileAndTransform(const char* iccData, unsigned icc
m_sourceToOutputDeviceColorTransform.reset();
// Create the input profile
- OwnPtr<qcms_profile> inputProfile;
+ QCMSProfileUniquePtr inputProfile;
if (useSRGB) {
- inputProfile = adoptPtr(qcms_profile_sRGB());
+ inputProfile.reset(qcms_profile_sRGB());
} else {
// Only accept RGB color profiles from input class devices.
if (iccLength < kIccColorProfileHeaderLength)
@@ -320,7 +333,7 @@ void ImageDecoder::setColorProfileAndTransform(const char* iccData, unsigned icc
return;
if (!inputDeviceColorProfile(iccData, iccLength))
return;
- inputProfile = adoptPtr(qcms_profile_from_memory(iccData, iccLength));
+ inputProfile.reset(qcms_profile_from_memory(iccData, iccLength));
}
if (!inputProfile)
return;
@@ -357,7 +370,7 @@ void ImageDecoder::setColorProfileAndTransform(const char* iccData, unsigned icc
qcms_data_type dataFormat = hasAlpha ? QCMS_DATA_RGBA_8 : QCMS_DATA_RGB_8;
// FIXME: Don't force perceptual intent if the image profile contains an intent.
- m_sourceToOutputDeviceColorTransform = adoptPtr(qcms_transform_create(inputProfile.get(), dataFormat, gOutputDeviceProfile, QCMS_DATA_RGBA_8, QCMS_INTENT_PERCEPTUAL));
+ m_sourceToOutputDeviceColorTransform.reset(qcms_transform_create(inputProfile.get(), dataFormat, gOutputDeviceProfile, QCMS_DATA_RGBA_8, QCMS_INTENT_PERCEPTUAL));
}
#endif // USE(QCMSLIB)
« no previous file with comments | « third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698