summaryrefslogtreecommitdiff
path: root/core/fxcrt/include/fx_basic.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-04-21 11:56:00 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-21 11:56:00 -0700
commitd00a91229690e453cb7f2eed652d81e864b27d2a (patch)
tree912985ecfde20c7bddfad2bc69d303a73aa86ca0 /core/fxcrt/include/fx_basic.h
parentca612c1f9c47fae74dda493291d52ec27eff4a7b (diff)
downloadpdfium-d00a91229690e453cb7f2eed652d81e864b27d2a.tar.xz
Make CFX_BasicArray non-copyable.
Its implicit copy constructor is unsafe, since it ends up sharing the underlying data. Fix one place where it was being unintentionally invoked. Review URL: https://codereview.chromium.org/1908073003
Diffstat (limited to 'core/fxcrt/include/fx_basic.h')
-rw-r--r--core/fxcrt/include/fx_basic.h12
1 files changed, 2 insertions, 10 deletions
diff --git a/core/fxcrt/include/fx_basic.h b/core/fxcrt/include/fx_basic.h
index 5a577c2e54..676996c5d5 100644
--- a/core/fxcrt/include/fx_basic.h
+++ b/core/fxcrt/include/fx_basic.h
@@ -231,32 +231,24 @@ class CFX_UTF8Encoder {
class CFX_BasicArray {
protected:
CFX_BasicArray(int unit_size);
-
+ CFX_BasicArray(const CFX_BasicArray&) = delete;
~CFX_BasicArray();
FX_BOOL SetSize(int nNewSize);
-
FX_BOOL Append(const CFX_BasicArray& src);
-
FX_BOOL Copy(const CFX_BasicArray& src);
-
uint8_t* InsertSpaceAt(int nIndex, int nCount);
-
FX_BOOL RemoveAt(int nIndex, int nCount);
-
FX_BOOL InsertAt(int nStartIndex, const CFX_BasicArray* pNewArray);
-
const void* GetDataPtr(int index) const;
protected:
uint8_t* m_pData;
-
int m_nSize;
-
int m_nMaxSize;
-
int m_nUnitSize;
};
+
template <class TYPE>
class CFX_ArrayTemplate : public CFX_BasicArray {
public: