summaryrefslogtreecommitdiff
path: root/core/fpdfapi/page/cpdf_streamcontentparser.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-11-21 16:22:10 -0800
committerCommit bot <commit-bot@chromium.org>2016-11-21 16:22:10 -0800
commit06104a8abc71ecd824d6a461b6f6f31c32fd2135 (patch)
tree713f7dfacbdaec5e0ac25e8fe1d197a27453a725 /core/fpdfapi/page/cpdf_streamcontentparser.h
parentdc7ec035a6962b788e75f4beaa4cf8fbddd83d39 (diff)
downloadpdfium-06104a8abc71ecd824d6a461b6f6f31c32fd2135.tar.xz
Remove some WrapUnique() calls by returing unique_ptrs
Return these from underlying methods as appropriate. Review-Url: https://codereview.chromium.org/2520133002
Diffstat (limited to 'core/fpdfapi/page/cpdf_streamcontentparser.h')
-rw-r--r--core/fpdfapi/page/cpdf_streamcontentparser.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/core/fpdfapi/page/cpdf_streamcontentparser.h b/core/fpdfapi/page/cpdf_streamcontentparser.h
index 1ed2aaa4de..dfb5230809 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();