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

Unified Diff: xfa/src/fgas/src/crt/fx_memory.h

Issue 1636873004: XFA: Fix DOS newlines (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: All of them Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/src/fgas/src/crt/fx_encode.cpp ('k') | xfa/src/fgas/src/crt/fx_memory.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fgas/src/crt/fx_memory.h
diff --git a/xfa/src/fgas/src/crt/fx_memory.h b/xfa/src/fgas/src/crt/fx_memory.h
index 2f42773058c03fd599861f1f4f9d55a29a6030b2..e181ce834d5dd798b71f2ea9dd58a36a8343f875 100644
--- a/xfa/src/fgas/src/crt/fx_memory.h
+++ b/xfa/src/fgas/src/crt/fx_memory.h
@@ -1,135 +1,135 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#ifndef _FX_MEMORY_IMP
-#define _FX_MEMORY_IMP
-class CFX_DefStore;
-class CFX_StaticStore;
-class CFX_FixedStore;
-class CFX_DynamicStore;
-class CFX_DefStore : public IFX_MEMAllocator, public CFX_Target {
- public:
- CFX_DefStore() {}
- ~CFX_DefStore() {}
- virtual void Release() { delete this; }
- virtual void* Alloc(size_t size) { return FX_Alloc(uint8_t, size); }
- virtual void Free(void* pBlock) { FX_Free(pBlock); }
- virtual size_t GetBlockSize() const { return 0; }
- virtual size_t GetDefChunkSize() const { return 0; }
- virtual size_t SetDefChunkSize(size_t size) { return 0; }
- virtual size_t GetCurrentDataSize() const { return 0; }
-};
-#if _FX_OS_ != _FX_ANDROID_
-#pragma pack(push, 1)
-#endif
-typedef struct _FX_STATICSTORECHUNK {
- _FX_STATICSTORECHUNK* pNextChunk;
- size_t iChunkSize;
- size_t iFreeSize;
-} FX_STATICSTORECHUNK, *FX_LPSTATICSTORECHUNK;
-typedef FX_STATICSTORECHUNK const* FX_LPCSTATICSTORECHUNK;
-#if _FX_OS_ != _FX_ANDROID_
-#pragma pack(pop)
-#endif
-class CFX_StaticStore : public IFX_MEMAllocator, public CFX_Target {
- public:
- CFX_StaticStore(size_t iDefChunkSize = 4096);
- ~CFX_StaticStore();
- virtual void Release() { delete this; }
- virtual void* Alloc(size_t size);
- virtual void Free(void* pBlock) {}
- virtual size_t GetBlockSize() const { return 0; }
- virtual size_t GetDefChunkSize() const { return m_iDefChunkSize; }
- virtual size_t SetDefChunkSize(size_t size);
- virtual size_t GetCurrentDataSize() const { return m_iAllocatedSize; }
-
- protected:
- size_t m_iAllocatedSize;
- size_t m_iDefChunkSize;
- FX_LPSTATICSTORECHUNK m_pChunk;
- FX_LPSTATICSTORECHUNK m_pLastChunk;
- FX_LPSTATICSTORECHUNK AllocChunk(size_t size);
- FX_LPSTATICSTORECHUNK FindChunk(size_t size);
-};
-#if _FX_OS_ != _FX_ANDROID_
-#pragma pack(push, 1)
-#endif
-typedef struct _FX_FIXEDSTORECHUNK {
- uint8_t* FirstFlag() const {
- return (uint8_t*)this + sizeof(_FX_FIXEDSTORECHUNK);
- }
- uint8_t* FirstBlock() const { return FirstFlag() + iChunkSize; }
- _FX_FIXEDSTORECHUNK* pNextChunk;
- size_t iChunkSize;
- size_t iFreeNum;
-} FX_FIXEDSTORECHUNK, *FX_LPFIXEDSTORECHUNK;
-typedef FX_FIXEDSTORECHUNK const* FX_LPCFIXEDSTORECHUNK;
-#if _FX_OS_ != _FX_ANDROID_
-#pragma pack(pop)
-#endif
-class CFX_FixedStore : public IFX_MEMAllocator, public CFX_Target {
- public:
- CFX_FixedStore(size_t iBlockSize, size_t iBlockNumsInChunk);
- virtual ~CFX_FixedStore();
- virtual void Release() { delete this; }
- virtual void* Alloc(size_t size);
- virtual void Free(void* pBlock);
- virtual size_t GetBlockSize() const { return m_iBlockSize; }
- virtual size_t GetDefChunkSize() const { return m_iDefChunkSize; }
- virtual size_t SetDefChunkSize(size_t iChunkSize);
- virtual size_t GetCurrentDataSize() const { return 0; }
-
- protected:
- size_t m_iBlockSize;
- size_t m_iDefChunkSize;
- FX_LPFIXEDSTORECHUNK m_pChunk;
- FX_LPFIXEDSTORECHUNK AllocChunk();
-};
-#if _FX_OS_ != _FX_ANDROID_
-#pragma pack(push, 1)
-#endif
-typedef struct _FX_DYNAMICSTOREBLOCK {
- _FX_DYNAMICSTOREBLOCK* NextBlock() const {
- return (_FX_DYNAMICSTOREBLOCK*)(Data() + iBlockSize);
- }
- uint8_t* Data() const {
- return (uint8_t*)this + sizeof(_FX_DYNAMICSTOREBLOCK);
- }
- size_t iBlockSize;
- FX_BOOL bUsed;
-} FX_DYNAMICSTOREBLOCK, *FX_LPDYNAMICSTOREBLOCK;
-typedef FX_DYNAMICSTOREBLOCK const* FX_LPCDYNAMICSTOREBLOCK;
-typedef struct _FX_DYNAMICSTORECHUNK {
- FX_LPDYNAMICSTOREBLOCK FirstBlock() const {
- return (FX_LPDYNAMICSTOREBLOCK)((uint8_t*)this +
- sizeof(_FX_DYNAMICSTORECHUNK));
- }
- _FX_DYNAMICSTORECHUNK* pNextChunk;
- size_t iChunkSize;
- size_t iFreeSize;
-} FX_DYNAMICSTORECHUNK, *FX_LPDYNAMICSTORECHUNK;
-typedef FX_DYNAMICSTORECHUNK const* FX_LPCDYNAMICSTORECHUNK;
-#if _FX_OS_ != _FX_ANDROID_
-#pragma pack(pop)
-#endif
-class CFX_DynamicStore : public IFX_MEMAllocator, public CFX_Target {
- public:
- CFX_DynamicStore(size_t iDefChunkSize = 4096);
- virtual ~CFX_DynamicStore();
- virtual void Release() { delete this; }
- virtual void* Alloc(size_t size);
- virtual void Free(void* pBlock);
- virtual size_t GetBlockSize() const { return 0; }
- virtual size_t GetDefChunkSize() const { return m_iDefChunkSize; }
- virtual size_t SetDefChunkSize(size_t size);
- virtual size_t GetCurrentDataSize() const { return 0; }
-
- protected:
- size_t m_iDefChunkSize;
- FX_LPDYNAMICSTORECHUNK m_pChunk;
- FX_LPDYNAMICSTORECHUNK AllocChunk(size_t size);
-};
-#endif
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#ifndef _FX_MEMORY_IMP
+#define _FX_MEMORY_IMP
+class CFX_DefStore;
+class CFX_StaticStore;
+class CFX_FixedStore;
+class CFX_DynamicStore;
+class CFX_DefStore : public IFX_MEMAllocator, public CFX_Target {
+ public:
+ CFX_DefStore() {}
+ ~CFX_DefStore() {}
+ virtual void Release() { delete this; }
+ virtual void* Alloc(size_t size) { return FX_Alloc(uint8_t, size); }
+ virtual void Free(void* pBlock) { FX_Free(pBlock); }
+ virtual size_t GetBlockSize() const { return 0; }
+ virtual size_t GetDefChunkSize() const { return 0; }
+ virtual size_t SetDefChunkSize(size_t size) { return 0; }
+ virtual size_t GetCurrentDataSize() const { return 0; }
+};
+#if _FX_OS_ != _FX_ANDROID_
+#pragma pack(push, 1)
+#endif
+typedef struct _FX_STATICSTORECHUNK {
+ _FX_STATICSTORECHUNK* pNextChunk;
+ size_t iChunkSize;
+ size_t iFreeSize;
+} FX_STATICSTORECHUNK, *FX_LPSTATICSTORECHUNK;
+typedef FX_STATICSTORECHUNK const* FX_LPCSTATICSTORECHUNK;
+#if _FX_OS_ != _FX_ANDROID_
+#pragma pack(pop)
+#endif
+class CFX_StaticStore : public IFX_MEMAllocator, public CFX_Target {
+ public:
+ CFX_StaticStore(size_t iDefChunkSize = 4096);
+ ~CFX_StaticStore();
+ virtual void Release() { delete this; }
+ virtual void* Alloc(size_t size);
+ virtual void Free(void* pBlock) {}
+ virtual size_t GetBlockSize() const { return 0; }
+ virtual size_t GetDefChunkSize() const { return m_iDefChunkSize; }
+ virtual size_t SetDefChunkSize(size_t size);
+ virtual size_t GetCurrentDataSize() const { return m_iAllocatedSize; }
+
+ protected:
+ size_t m_iAllocatedSize;
+ size_t m_iDefChunkSize;
+ FX_LPSTATICSTORECHUNK m_pChunk;
+ FX_LPSTATICSTORECHUNK m_pLastChunk;
+ FX_LPSTATICSTORECHUNK AllocChunk(size_t size);
+ FX_LPSTATICSTORECHUNK FindChunk(size_t size);
+};
+#if _FX_OS_ != _FX_ANDROID_
+#pragma pack(push, 1)
+#endif
+typedef struct _FX_FIXEDSTORECHUNK {
+ uint8_t* FirstFlag() const {
+ return (uint8_t*)this + sizeof(_FX_FIXEDSTORECHUNK);
+ }
+ uint8_t* FirstBlock() const { return FirstFlag() + iChunkSize; }
+ _FX_FIXEDSTORECHUNK* pNextChunk;
+ size_t iChunkSize;
+ size_t iFreeNum;
+} FX_FIXEDSTORECHUNK, *FX_LPFIXEDSTORECHUNK;
+typedef FX_FIXEDSTORECHUNK const* FX_LPCFIXEDSTORECHUNK;
+#if _FX_OS_ != _FX_ANDROID_
+#pragma pack(pop)
+#endif
+class CFX_FixedStore : public IFX_MEMAllocator, public CFX_Target {
+ public:
+ CFX_FixedStore(size_t iBlockSize, size_t iBlockNumsInChunk);
+ virtual ~CFX_FixedStore();
+ virtual void Release() { delete this; }
+ virtual void* Alloc(size_t size);
+ virtual void Free(void* pBlock);
+ virtual size_t GetBlockSize() const { return m_iBlockSize; }
+ virtual size_t GetDefChunkSize() const { return m_iDefChunkSize; }
+ virtual size_t SetDefChunkSize(size_t iChunkSize);
+ virtual size_t GetCurrentDataSize() const { return 0; }
+
+ protected:
+ size_t m_iBlockSize;
+ size_t m_iDefChunkSize;
+ FX_LPFIXEDSTORECHUNK m_pChunk;
+ FX_LPFIXEDSTORECHUNK AllocChunk();
+};
+#if _FX_OS_ != _FX_ANDROID_
+#pragma pack(push, 1)
+#endif
+typedef struct _FX_DYNAMICSTOREBLOCK {
+ _FX_DYNAMICSTOREBLOCK* NextBlock() const {
+ return (_FX_DYNAMICSTOREBLOCK*)(Data() + iBlockSize);
+ }
+ uint8_t* Data() const {
+ return (uint8_t*)this + sizeof(_FX_DYNAMICSTOREBLOCK);
+ }
+ size_t iBlockSize;
+ FX_BOOL bUsed;
+} FX_DYNAMICSTOREBLOCK, *FX_LPDYNAMICSTOREBLOCK;
+typedef FX_DYNAMICSTOREBLOCK const* FX_LPCDYNAMICSTOREBLOCK;
+typedef struct _FX_DYNAMICSTORECHUNK {
+ FX_LPDYNAMICSTOREBLOCK FirstBlock() const {
+ return (FX_LPDYNAMICSTOREBLOCK)((uint8_t*)this +
+ sizeof(_FX_DYNAMICSTORECHUNK));
+ }
+ _FX_DYNAMICSTORECHUNK* pNextChunk;
+ size_t iChunkSize;
+ size_t iFreeSize;
+} FX_DYNAMICSTORECHUNK, *FX_LPDYNAMICSTORECHUNK;
+typedef FX_DYNAMICSTORECHUNK const* FX_LPCDYNAMICSTORECHUNK;
+#if _FX_OS_ != _FX_ANDROID_
+#pragma pack(pop)
+#endif
+class CFX_DynamicStore : public IFX_MEMAllocator, public CFX_Target {
+ public:
+ CFX_DynamicStore(size_t iDefChunkSize = 4096);
+ virtual ~CFX_DynamicStore();
+ virtual void Release() { delete this; }
+ virtual void* Alloc(size_t size);
+ virtual void Free(void* pBlock);
+ virtual size_t GetBlockSize() const { return 0; }
+ virtual size_t GetDefChunkSize() const { return m_iDefChunkSize; }
+ virtual size_t SetDefChunkSize(size_t size);
+ virtual size_t GetCurrentDataSize() const { return 0; }
+
+ protected:
+ size_t m_iDefChunkSize;
+ FX_LPDYNAMICSTORECHUNK m_pChunk;
+ FX_LPDYNAMICSTORECHUNK AllocChunk(size_t size);
+};
+#endif
« no previous file with comments | « xfa/src/fgas/src/crt/fx_encode.cpp ('k') | xfa/src/fgas/src/crt/fx_memory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698