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

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

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 | « no previous file | third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp » ('j') | 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.h
diff --git a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
index 7da3b9beaf524831f080a8816321202214490092..8214e80e44c073596d0383bd45fbfab410457810 100644
--- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
+++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h
@@ -41,40 +41,26 @@
#include "wtf/Threading.h"
#include "wtf/Vector.h"
#include "wtf/text/WTFString.h"
+#include <memory>
#if USE(QCMSLIB)
#include "qcms.h"
+#endif
-namespace WTF {
+namespace blink {
-template <typename T>
-struct OwnedPtrDeleter;
-template <>
-struct OwnedPtrDeleter<qcms_transform> {
- static void deletePtr(qcms_transform* transform)
+#if USE(QCMSLIB)
+struct QCMSTransformDeleter {
+ void operator()(qcms_transform* transform)
{
if (transform)
qcms_transform_release(transform);
}
};
-template <typename T>
-struct OwnedPtrDeleter;
-template <>
-struct OwnedPtrDeleter<qcms_profile> {
- static void deletePtr(qcms_profile* profile)
- {
- if (profile)
- qcms_profile_release(profile);
- }
-};
-
-} // namespace WTF
-
+using QCMSTransformUniquePtr = std::unique_ptr<qcms_transform, QCMSTransformDeleter>;
#endif // USE(QCMSLIB)
-namespace blink {
-
// ImagePlanes can be used to decode color components into provided buffers instead of using an ImageFrame.
class PLATFORM_EXPORT ImagePlanes final {
USING_FAST_MALLOC(ImagePlanes);
@@ -347,7 +333,7 @@ private:
bool m_failed;
#if USE(QCMSLIB)
- OwnPtr<qcms_transform> m_sourceToOutputDeviceColorTransform;
+ QCMSTransformUniquePtr m_sourceToOutputDeviceColorTransform;
#endif
};
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/image-decoders/ImageDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698