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

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

Issue 2509123002: Make CPDF_Object subclass constructors intern strings (Closed)
Patch Set: Nits 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 unified diff | Download patch
« no previous file with comments | « core/fpdfapi/parser/cpdf_name.cpp ('k') | core/fpdfapi/parser/cpdf_object_unittest.cpp » ('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_OBJECT_H_ 7 #ifndef CORE_FPDFAPI_PARSER_CPDF_OBJECT_H_
8 #define CORE_FPDFAPI_PARSER_CPDF_OBJECT_H_ 8 #define CORE_FPDFAPI_PARSER_CPDF_OBJECT_H_
9 9
10 #include <memory> 10 #include <memory>
11 #include <set> 11 #include <set>
12 #include <type_traits>
12 13
13 #include "core/fxcrt/fx_string.h" 14 #include "core/fxcrt/fx_string.h"
14 #include "core/fxcrt/fx_system.h" 15 #include "core/fxcrt/fx_system.h"
15 16
16 class CPDF_Array; 17 class CPDF_Array;
17 class CPDF_Boolean; 18 class CPDF_Boolean;
18 class CPDF_Dictionary; 19 class CPDF_Dictionary;
19 class CPDF_Name; 20 class CPDF_Name;
20 class CPDF_Null; 21 class CPDF_Null;
21 class CPDF_Number; 22 class CPDF_Number;
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 bool bDirect, 111 bool bDirect,
111 std::set<const CPDF_Object*>* pVisited) const; 112 std::set<const CPDF_Object*>* pVisited) const;
112 113
113 uint32_t m_ObjNum; 114 uint32_t m_ObjNum;
114 uint32_t m_GenNum; 115 uint32_t m_GenNum;
115 116
116 private: 117 private:
117 CPDF_Object(const CPDF_Object& src) {} 118 CPDF_Object(const CPDF_Object& src) {}
118 }; 119 };
119 120
121 template <typename T>
122 struct CanInternStrings {
123 static const bool value = std::is_same<T, CPDF_Array>::value ||
124 std::is_same<T, CPDF_Dictionary>::value ||
125 std::is_same<T, CPDF_Name>::value ||
126 std::is_same<T, CPDF_String>::value;
127 };
128
120 #endif // CORE_FPDFAPI_PARSER_CPDF_OBJECT_H_ 129 #endif // CORE_FPDFAPI_PARSER_CPDF_OBJECT_H_
OLDNEW
« no previous file with comments | « core/fpdfapi/parser/cpdf_name.cpp ('k') | core/fpdfapi/parser/cpdf_object_unittest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698