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

Side by Side Diff: core/include/fxcrt/fx_basic.h

Issue 1413223002: Merge to XFA: Remove some checks for object creation failures. They cannot fail. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 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 | « no previous file | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.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 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 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_INCLUDE_FXCRT_FX_BASIC_H_ 7 #ifndef CORE_INCLUDE_FXCRT_FX_BASIC_H_
8 #define CORE_INCLUDE_FXCRT_FX_BASIC_H_ 8 #define CORE_INCLUDE_FXCRT_FX_BASIC_H_
9 9
10 #include "fx_memory.h" 10 #include "fx_memory.h"
(...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after
1077 struct FxFreeDeleter { 1077 struct FxFreeDeleter {
1078 inline void operator()(void* ptr) const { FX_Free(ptr); } 1078 inline void operator()(void* ptr) const { FX_Free(ptr); }
1079 }; 1079 };
1080 1080
1081 // Used with nonstd::unique_ptr to Release() objects that can't be deleted. 1081 // Used with nonstd::unique_ptr to Release() objects that can't be deleted.
1082 template <class T> 1082 template <class T>
1083 struct ReleaseDeleter { 1083 struct ReleaseDeleter {
1084 inline void operator()(T* ptr) const { ptr->Release(); } 1084 inline void operator()(T* ptr) const { ptr->Release(); }
1085 }; 1085 };
1086 1086
1087 // TODO(thestig) Remove in favor of nonstd::unique_ptr.
1088 template <class T>
1089 class CFX_SmartPointer {
1090 public:
1091 CFX_SmartPointer(T* pObj) : m_pObj(pObj) {}
1092 ~CFX_SmartPointer() { m_pObj->Release(); }
1093 T* Get(void) { return m_pObj; }
1094 T& operator*(void) { return *m_pObj; }
1095 T* operator->(void) { return m_pObj; }
1096
1097 protected:
1098 T* m_pObj;
1099 };
1100
1101 #define FX_DATALIST_LENGTH 1024 1087 #define FX_DATALIST_LENGTH 1024
1102 template <size_t unit> 1088 template <size_t unit>
1103 class CFX_SortListArray { 1089 class CFX_SortListArray {
1104 protected: 1090 protected:
1105 struct DataList { 1091 struct DataList {
1106 int32_t start; 1092 int32_t start;
1107 1093
1108 int32_t count; 1094 int32_t count;
1109 uint8_t* data; 1095 uint8_t* data;
1110 }; 1096 };
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1285 FX_FLOAT c; 1271 FX_FLOAT c;
1286 FX_FLOAT d; 1272 FX_FLOAT d;
1287 FX_FLOAT e; 1273 FX_FLOAT e;
1288 FX_FLOAT f; 1274 FX_FLOAT f;
1289 FX_FLOAT g; 1275 FX_FLOAT g;
1290 FX_FLOAT h; 1276 FX_FLOAT h;
1291 FX_FLOAT i; 1277 FX_FLOAT i;
1292 }; 1278 };
1293 1279
1294 #endif // CORE_INCLUDE_FXCRT_FX_BASIC_H_ 1280 #endif // CORE_INCLUDE_FXCRT_FX_BASIC_H_
OLDNEW
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698