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

Unified Diff: core/fpdfapi/page/cpdf_streamcontentparser.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_image.cpp ('k') | core/fpdfapi/page/cpdf_streamcontentparser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/page/cpdf_streamcontentparser.h
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.h b/core/fpdfapi/page/cpdf_streamcontentparser.h
index 1ed2aaa4de9b116672edf3cfc8f537898c0d615d..dfb52308093e3d9f76394fb6672e699c0765efe5 100644
--- a/core/fpdfapi/page/cpdf_streamcontentparser.h
+++ b/core/fpdfapi/page/cpdf_streamcontentparser.h
@@ -52,21 +52,23 @@ class CPDF_StreamContentParser {
private:
struct ContentParam {
enum Type { OBJECT = 0, NUMBER, NAME };
+
+ ContentParam();
+ ~ContentParam();
+
Type m_Type;
- union {
- struct {
- bool m_bInteger;
- union {
- int m_Integer;
- FX_FLOAT m_Float;
- };
- } m_Number;
- CPDF_Object* m_pObject;
- struct {
- int m_Len;
- char m_Buffer[32];
- } m_Name;
- };
+ std::unique_ptr<CPDF_Object> m_pObject;
+ struct {
+ bool m_bInteger;
+ union {
+ int m_Integer;
+ FX_FLOAT m_Float;
+ };
+ } m_Number;
+ struct {
+ int m_Len;
+ char m_Buffer[32];
+ } m_Name;
};
static const int kParamBufSize = 16;
@@ -76,7 +78,7 @@ class CPDF_StreamContentParser {
static OpCodes InitializeOpCodes();
void AddNumberParam(const FX_CHAR* str, int len);
- void AddObjectParam(CPDF_Object* pObj);
+ void AddObjectParam(std::unique_ptr<CPDF_Object> pObj);
void AddNameParam(const FX_CHAR* name, int size);
int GetNextParamPos();
void ClearAllParams();
« no previous file with comments | « core/fpdfapi/page/cpdf_image.cpp ('k') | core/fpdfapi/page/cpdf_streamcontentparser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698