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

Unified Diff: core/fpdfapi/page/cpdf_image.h

Issue 2523093003: Use CFX_MaybeOwned<> in CPDF_Image (Closed)
Patch Set: rebase Created 4 years, 1 month 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 | core/fpdfapi/page/cpdf_image.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/page/cpdf_image.h
diff --git a/core/fpdfapi/page/cpdf_image.h b/core/fpdfapi/page/cpdf_image.h
index 3438e2b98ed71c558fff957bcdec9eb93f04763d..38c7e3e7281bd2c6efb895a5b5a09063a793b462 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;
};
« no previous file with comments | « no previous file | core/fpdfapi/page/cpdf_image.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698