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

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

Issue 2520133002: Remove some WrapUnique() calls by returing unique_ptrs (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 | « core/fpdfapi/page/cpdf_streamparser.cpp ('k') | core/fpdfapi/parser/cpdf_document.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/page/pageint.h
diff --git a/core/fpdfapi/page/pageint.h b/core/fpdfapi/page/pageint.h
index dee9639d7d8253571f2ddd19a4973ed177a35e73..cf3522d44a3a4ee21524982124fda56d74cb35ba 100644
--- a/core/fpdfapi/page/pageint.h
+++ b/core/fpdfapi/page/pageint.h
@@ -11,6 +11,7 @@
#include <memory>
#include <set>
#include <unordered_map>
+#include <utility>
#include <vector>
#include "core/fpdfapi/page/cpdf_contentmark.h"
@@ -52,16 +53,17 @@ class CPDF_StreamParser {
const CFX_WeakPtr<CFX_ByteStringPool>& pPool);
~CPDF_StreamParser();
- CPDF_Stream* ReadInlineStream(CPDF_Document* pDoc,
- CPDF_Dictionary* pDict,
- CPDF_Object* pCSObj);
SyntaxType ParseNextElement();
uint8_t* GetWordBuf() { return m_WordBuffer; }
uint32_t GetWordSize() const { return m_WordSize; }
- CPDF_Object* GetObject();
uint32_t GetPos() const { return m_Pos; }
void SetPos(uint32_t pos) { m_Pos = pos; }
- CPDF_Object* ReadNextObject(bool bAllowNestedArray, uint32_t dwInArrayLevel);
+ std::unique_ptr<CPDF_Object> GetObject() { return std::move(m_pLastObj); }
+ std::unique_ptr<CPDF_Object> ReadNextObject(bool bAllowNestedArray,
+ uint32_t dwInArrayLevel);
+ std::unique_ptr<CPDF_Stream> ReadInlineStream(CPDF_Document* pDoc,
+ CPDF_Dictionary* pDict,
+ CPDF_Object* pCSObj);
private:
friend class cpdf_streamparser_ReadHexString_Test;
@@ -76,7 +78,7 @@ class CPDF_StreamParser {
uint32_t m_Pos; // Current byte position within m_pBuf.
uint8_t m_WordBuffer[256];
uint32_t m_WordSize;
- CPDF_Object* m_pLastObj;
+ std::unique_ptr<CPDF_Object> m_pLastObj;
CFX_WeakPtr<CFX_ByteStringPool> m_pPool;
};
« no previous file with comments | « core/fpdfapi/page/cpdf_streamparser.cpp ('k') | core/fpdfapi/parser/cpdf_document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698