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

Unified Diff: core/fpdfapi/parser/cfdf_document.h

Issue 2538533003: Make FDF document creation return unique_ptrs (Closed)
Patch Set: 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/parser/cfdf_document.cpp » ('j') | fpdfsdk/cpdfsdk_interform.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/parser/cfdf_document.h
diff --git a/core/fpdfapi/parser/cfdf_document.h b/core/fpdfapi/parser/cfdf_document.h
index 075119376f53d17f6a38c2a973cdc0edf2d87ca5..1b47368458ed85d1b23a5a6bd3bf2a6ab5b6fd72 100644
--- a/core/fpdfapi/parser/cfdf_document.h
+++ b/core/fpdfapi/parser/cfdf_document.h
@@ -7,6 +7,8 @@
#ifndef CORE_FPDFAPI_PARSER_CFDF_DOCUMENT_H_
#define CORE_FPDFAPI_PARSER_CFDF_DOCUMENT_H_
+#include <memory>
+
#include "core/fpdfapi/parser/cpdf_indirect_object_holder.h"
#include "core/fpdfapi/parser/cpdf_object.h"
#include "core/fxcrt/fx_basic.h"
@@ -15,17 +17,19 @@ class CPDF_Dictionary;
class CFDF_Document : public CPDF_IndirectObjectHolder {
public:
- static CFDF_Document* CreateNewDoc();
- static CFDF_Document* ParseFile(IFX_SeekableReadStream* pFile,
- bool bOwnFile = false);
- static CFDF_Document* ParseMemory(const uint8_t* pData, uint32_t size);
+ static std::unique_ptr<CFDF_Document> CreateNewDoc();
+ static std::unique_ptr<CFDF_Document> ParseFile(IFX_SeekableReadStream* pFile,
+ bool bOwnFile = false);
+ static std::unique_ptr<CFDF_Document> ParseMemory(const uint8_t* pData,
+ uint32_t size);
+
+ CFDF_Document();
~CFDF_Document() override;
bool WriteBuf(CFX_ByteTextBuf& buf) const;
CPDF_Dictionary* GetRoot() const { return m_pRootDict; }
protected:
- CFDF_Document();
void ParseStream(IFX_SeekableReadStream* pFile, bool bOwnFile);
CPDF_Dictionary* m_pRootDict;
« no previous file with comments | « no previous file | core/fpdfapi/parser/cfdf_document.cpp » ('j') | fpdfsdk/cpdfsdk_interform.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698