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

Side by Side 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: 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 2 * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 23 matching lines...) Expand all
34 #include "platform/image-decoders/ImageAnimation.h" 34 #include "platform/image-decoders/ImageAnimation.h"
35 #include "platform/image-decoders/ImageFrame.h" 35 #include "platform/image-decoders/ImageFrame.h"
36 #include "platform/image-decoders/SegmentReader.h" 36 #include "platform/image-decoders/SegmentReader.h"
37 #include "public/platform/Platform.h" 37 #include "public/platform/Platform.h"
38 #include "wtf/Assertions.h" 38 #include "wtf/Assertions.h"
39 #include "wtf/PassOwnPtr.h" 39 #include "wtf/PassOwnPtr.h"
40 #include "wtf/RefPtr.h" 40 #include "wtf/RefPtr.h"
41 #include "wtf/Threading.h" 41 #include "wtf/Threading.h"
42 #include "wtf/Vector.h" 42 #include "wtf/Vector.h"
43 #include "wtf/text/WTFString.h" 43 #include "wtf/text/WTFString.h"
44 #include <memory>
44 45
45 #if USE(QCMSLIB) 46 #if USE(QCMSLIB)
46 #include "qcms.h" 47 #include "qcms.h"
48 #endif
47 49
48 namespace WTF { 50 namespace blink {
49 51
50 template <typename T> 52 #if USE(QCMSLIB)
51 struct OwnedPtrDeleter; 53
52 template <> 54 struct QCMSTransformDeleter {
53 struct OwnedPtrDeleter<qcms_transform> { 55 void operator()(qcms_transform* transform)
54 static void deletePtr(qcms_transform* transform)
55 { 56 {
56 if (transform) 57 if (transform)
57 qcms_transform_release(transform); 58 qcms_transform_release(transform);
58 } 59 }
59 }; 60 };
60 61
61 template <typename T> 62 using QCMSTransformUniquePtr = std::unique_ptr<qcms_transform, QCMSTransformDele ter>;
62 struct OwnedPtrDeleter; 63
63 template <> 64 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.
64 struct OwnedPtrDeleter<qcms_profile> { 65 void operator()(qcms_profile* profile)
65 static void deletePtr(qcms_profile* profile)
66 { 66 {
67 if (profile) 67 if (profile)
68 qcms_profile_release(profile); 68 qcms_profile_release(profile);
69 } 69 }
70 }; 70 };
71 71
72 } // namespace WTF 72 using QCMSProfileUniquePtr = std::unique_ptr<qcms_profile, QCMSProfileDeleter>;
73 73
74 #endif // USE(QCMSLIB) 74 #endif // USE(QCMSLIB)
75 75
76 namespace blink {
77
78 // ImagePlanes can be used to decode color components into provided buffers inst ead of using an ImageFrame. 76 // ImagePlanes can be used to decode color components into provided buffers inst ead of using an ImageFrame.
79 class PLATFORM_EXPORT ImagePlanes final { 77 class PLATFORM_EXPORT ImagePlanes final {
80 USING_FAST_MALLOC(ImagePlanes); 78 USING_FAST_MALLOC(ImagePlanes);
81 WTF_MAKE_NONCOPYABLE(ImagePlanes); 79 WTF_MAKE_NONCOPYABLE(ImagePlanes);
82 public: 80 public:
83 ImagePlanes(); 81 ImagePlanes();
84 ImagePlanes(void* planes[3], const size_t rowBytes[3]); 82 ImagePlanes(void* planes[3], const size_t rowBytes[3]);
85 83
86 void* plane(int); 84 void* plane(int);
87 size_t rowBytes(int) const; 85 size_t rowBytes(int) const;
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 * static_cast<unsigned long long>(height); 338 * static_cast<unsigned long long>(height);
341 return total_size > ((1 << 29) - 1); 339 return total_size > ((1 << 29) - 1);
342 } 340 }
343 341
344 IntSize m_size; 342 IntSize m_size;
345 bool m_sizeAvailable; 343 bool m_sizeAvailable;
346 bool m_isAllDataReceived; 344 bool m_isAllDataReceived;
347 bool m_failed; 345 bool m_failed;
348 346
349 #if USE(QCMSLIB) 347 #if USE(QCMSLIB)
350 OwnPtr<qcms_transform> m_sourceToOutputDeviceColorTransform; 348 QCMSTransformUniquePtr m_sourceToOutputDeviceColorTransform;
351 #endif 349 #endif
352 }; 350 };
353 351
354 } // namespace blink 352 } // namespace blink
355 353
356 #endif 354 #endif
OLDNEW
« 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