summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_image.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-23 14:34:58 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-23 14:34:58 -0800
commit9fd0c630ea2225fc544949d88d1bf63acc43112e (patch)
treea24d041a6a0912abf6d7915833b22e3fa2380150 /core/fpdfapi/page/cpdf_image.h
parent81b224669647c9dd3c5ea2e013ee3cc109744bb8 (diff)
downloadpdfium-9fd0c630ea2225fc544949d88d1bf63acc43112e.tar.xz
Use CFX_MaybeOwned<> in CPDF_Image
Review-Url: https://codereview.chromium.org/2523093003
Diffstat (limited to 'core/fpdfapi/page/cpdf_image.h')
-rw-r--r--core/fpdfapi/page/cpdf_image.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/fpdfapi/page/cpdf_image.h b/core/fpdfapi/page/cpdf_image.h
index 3438e2b98e..38c7e3e728 100644
--- a/core/fpdfapi/page/cpdf_image.h
+++ b/core/fpdfapi/page/cpdf_image.h
@@ -10,6 +10,7 @@
#include <memory>
#include "core/fpdfapi/parser/cpdf_stream.h"
+#include "core/fxcrt/cfx_maybe_owned.h"
#include "core/fxcrt/fx_system.h"
class CFX_DIBSource;
@@ -28,8 +29,8 @@ class CPDF_Image {
void ConvertStreamToIndirectObject();
- CPDF_Dictionary* GetInlineDict() const { return m_pDict; }
- CPDF_Stream* GetStream() const { return m_pStream; }
+ CPDF_Dictionary* GetInlineDict() const { return m_pDict.Get(); }
+ CPDF_Stream* GetStream() const { return m_pStream.Get(); }
CPDF_Dictionary* GetDict() const {
return m_pStream ? m_pStream->GetDict() : nullptr;
}
@@ -77,10 +78,8 @@ class CPDF_Image {
bool m_bIsMask = false;
bool m_bInterpolate = false;
CPDF_Document* const m_pDocument;
- CPDF_Stream* m_pStream = nullptr;
- CPDF_Dictionary* m_pDict = nullptr;
- std::unique_ptr<CPDF_Stream> m_pOwnedStream;
- std::unique_ptr<CPDF_Dictionary> m_pOwnedDict;
+ CFX_MaybeOwned<CPDF_Stream> m_pStream;
+ CFX_MaybeOwned<CPDF_Dictionary> m_pDict;
CPDF_Dictionary* m_pOC = nullptr;
};