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

Unified Diff: core/fxcrt/fx_basic.h

Issue 2612773007: Remove CFX_MapPtrToPtr and templates. (Closed)
Patch Set: Created 3 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 | « BUILD.gn ('k') | core/fxcrt/fx_basic_maps.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcrt/fx_basic.h
diff --git a/core/fxcrt/fx_basic.h b/core/fxcrt/fx_basic.h
index 3b09489d7193866c0f7efe11cc1294ab67ae0d8b..5adcf701c59c900c4421351fd3ab17dbb78257ef 100644
--- a/core/fxcrt/fx_basic.h
+++ b/core/fxcrt/fx_basic.h
@@ -335,108 +335,6 @@ class CFX_FixedBufGrow {
std::unique_ptr<DataType, FxFreeDeleter> m_pGrowData;
};
-#ifdef PDF_ENABLE_XFA
-class CFX_MapPtrToPtr {
- protected:
- struct CAssoc {
- CAssoc* pNext;
- void* key;
- void* value;
- };
-
- public:
- explicit CFX_MapPtrToPtr(int nBlockSize = 10);
- ~CFX_MapPtrToPtr();
-
- int GetCount() const { return m_nCount; }
- bool IsEmpty() const { return m_nCount == 0; }
-
- bool Lookup(void* key, void*& rValue) const;
-
- void* GetValueAt(void* key) const;
-
- void*& operator[](void* key);
-
- void SetAt(void* key, void* newValue) { (*this)[key] = newValue; }
-
- bool RemoveKey(void* key);
-
- void RemoveAll();
-
- FX_POSITION GetStartPosition() const {
- return m_nCount == 0 ? nullptr : (FX_POSITION)-1;
- }
-
- void GetNextAssoc(FX_POSITION& rNextPosition,
- void*& rKey,
- void*& rValue) const;
-
- uint32_t GetHashTableSize() const { return m_nHashTableSize; }
-
- void InitHashTable(uint32_t hashSize, bool bAllocNow = true);
-
- protected:
- CAssoc** m_pHashTable;
-
- uint32_t m_nHashTableSize;
-
- int m_nCount;
-
- CAssoc* m_pFreeList;
-
- struct CFX_Plex* m_pBlocks;
-
- int m_nBlockSize;
-
- uint32_t HashKey(void* key) const;
-
- CAssoc* NewAssoc();
-
- void FreeAssoc(CAssoc* pAssoc);
-
- CAssoc* GetAssocAt(void* key, uint32_t& hash) const;
-};
-
-template <class KeyType, class ValueType>
-class CFX_MapPtrTemplate : public CFX_MapPtrToPtr {
- public:
- CFX_MapPtrTemplate() : CFX_MapPtrToPtr(10) {}
-
- bool Lookup(KeyType key, ValueType& rValue) const {
- void* pValue = nullptr;
- if (!CFX_MapPtrToPtr::Lookup((void*)(uintptr_t)key, pValue)) {
- return false;
- }
- rValue = (ValueType)(uintptr_t)pValue;
- return true;
- }
-
- ValueType& operator[](KeyType key) {
- return (ValueType&)CFX_MapPtrToPtr::operator[]((void*)(uintptr_t)key);
- }
-
- void SetAt(KeyType key, ValueType newValue) {
- CFX_MapPtrToPtr::SetAt((void*)(uintptr_t)key, (void*)(uintptr_t)newValue);
- }
-
- bool RemoveKey(KeyType key) {
- return CFX_MapPtrToPtr::RemoveKey((void*)(uintptr_t)key);
- }
-
- void GetNextAssoc(FX_POSITION& rNextPosition,
- KeyType& rKey,
- ValueType& rValue) const {
- void* pKey = nullptr;
- void* pValue = nullptr;
- CFX_MapPtrToPtr::GetNextAssoc(rNextPosition, pKey, pValue);
- rKey = (KeyType)(uintptr_t)pKey;
- rValue = (ValueType)(uintptr_t)pValue;
- }
-};
-
-typedef void (*PD_CALLBACK_FREEDATA)(void* pData);
-#endif // PDF_ENABLE_XFA
-
class CFX_BitStream {
public:
void Init(const uint8_t* pData, uint32_t dwSize);
« no previous file with comments | « BUILD.gn ('k') | core/fxcrt/fx_basic_maps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698