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

Side by Side Diff: core/fpdfapi/parser/cpdf_reference.h

Issue 2385293002: Make CPDF_Object containers hold objects via unique pointers (Closed)
Patch Set: Remove duplicated line Created 4 years, 2 months 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 unified diff | Download patch
« no previous file with comments | « core/fpdfapi/parser/cpdf_parser.cpp ('k') | core/fpdfapi/parser/cpdf_stream.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef CORE_FPDFAPI_PARSER_CPDF_REFERENCE_H_ 7 #ifndef CORE_FPDFAPI_PARSER_CPDF_REFERENCE_H_
8 #define CORE_FPDFAPI_PARSER_CPDF_REFERENCE_H_ 8 #define CORE_FPDFAPI_PARSER_CPDF_REFERENCE_H_
9 9
10 #include <set> 10 #include <set>
(...skipping 29 matching lines...) Expand all
40 CPDF_Object* CloneNonCyclic( 40 CPDF_Object* CloneNonCyclic(
41 bool bDirect, 41 bool bDirect,
42 std::set<const CPDF_Object*>* pVisited) const override; 42 std::set<const CPDF_Object*>* pVisited) const override;
43 43
44 CPDF_Object* SafeGetDirect() const; 44 CPDF_Object* SafeGetDirect() const;
45 45
46 CPDF_IndirectObjectHolder* m_pObjList; 46 CPDF_IndirectObjectHolder* m_pObjList;
47 uint32_t m_RefObjNum; 47 uint32_t m_RefObjNum;
48 }; 48 };
49 49
50 using UniqueReference =
51 std::unique_ptr<CPDF_Reference, ReleaseDeleter<CPDF_Object>>;
52
50 inline CPDF_Reference* ToReference(CPDF_Object* obj) { 53 inline CPDF_Reference* ToReference(CPDF_Object* obj) {
51 return obj ? obj->AsReference() : nullptr; 54 return obj ? obj->AsReference() : nullptr;
52 } 55 }
53 56
54 inline const CPDF_Reference* ToReference(const CPDF_Object* obj) { 57 inline const CPDF_Reference* ToReference(const CPDF_Object* obj) {
55 return obj ? obj->AsReference() : nullptr; 58 return obj ? obj->AsReference() : nullptr;
56 } 59 }
57 60
58 #endif // CORE_FPDFAPI_PARSER_CPDF_REFERENCE_H_ 61 #endif // CORE_FPDFAPI_PARSER_CPDF_REFERENCE_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/parser/cpdf_parser.cpp ('k') | core/fpdfapi/parser/cpdf_stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698