Chromium Code Reviews| 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..a2b4d6692a9bbcfb37f7472273745009b90ca669 100644 |
| --- a/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h |
| +++ b/third_party/WebKit/Source/platform/image-decoders/ImageDecoder.h |
| @@ -41,40 +41,38 @@ |
| #include "wtf/Threading.h" |
| #include "wtf/Vector.h" |
| #include "wtf/text/WTFString.h" |
| +#include <memory> |
| #if USE(QCMSLIB) |
| #include "qcms.h" |
| +#endif |
| + |
| +namespace blink { |
| -namespace WTF { |
| +#if USE(QCMSLIB) |
| -template <typename T> |
| -struct OwnedPtrDeleter; |
| -template <> |
| -struct OwnedPtrDeleter<qcms_transform> { |
| - static void deletePtr(qcms_transform* transform) |
| +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) |
| +using QCMSTransformUniquePtr = std::unique_ptr<qcms_transform, QCMSTransformDeleter>; |
| + |
| +struct QCMSProfileDeleter { |
|
urvang
2016/06/06 15:56:03
64 to 72 can technically be moved to the cpp file,
Yuta Kitamura
2016/06/07 05:25:40
Yeah, fixed in PS2.
|
| + void operator()(qcms_profile* profile) |
| { |
| if (profile) |
| qcms_profile_release(profile); |
| } |
| }; |
| -} // namespace WTF |
| +using QCMSProfileUniquePtr = std::unique_ptr<qcms_profile, QCMSProfileDeleter>; |
| #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 +345,7 @@ private: |
| bool m_failed; |
| #if USE(QCMSLIB) |
| - OwnPtr<qcms_transform> m_sourceToOutputDeviceColorTransform; |
| + QCMSTransformUniquePtr m_sourceToOutputDeviceColorTransform; |
| #endif |
| }; |