summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_SymbolDict.h
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-14 11:30:46 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-14 11:30:47 -0800
commit0d73909e89a5c93917b9cb73fe5c03c484f2793d (patch)
tree6b3dc490bed3fb2e62bb0bc6c09bcf9fb28f0dfc /core/fxcodec/jbig2/JBig2_SymbolDict.h
parent603f57b85c0643f0598f03b97c4525501f3e1221 (diff)
downloadpdfium-0d73909e89a5c93917b9cb73fe5c03c484f2793d.tar.xz
Remove CJBig2_List in favor of std::vector<std::unique_ptr<>>
Review-Url: https://codereview.chromium.org/2578663002
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_SymbolDict.h')
-rw-r--r--core/fxcodec/jbig2/JBig2_SymbolDict.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/core/fxcodec/jbig2/JBig2_SymbolDict.h b/core/fxcodec/jbig2/JBig2_SymbolDict.h
index 4520f76680..d6b897ce70 100644
--- a/core/fxcodec/jbig2/JBig2_SymbolDict.h
+++ b/core/fxcodec/jbig2/JBig2_SymbolDict.h
@@ -8,10 +8,10 @@
#define CORE_FXCODEC_JBIG2_JBIG2_SYMBOLDICT_H_
#include <memory>
+#include <utility>
#include <vector>
#include "core/fxcodec/jbig2/JBig2_ArithDecoder.h"
-#include "core/fxcodec/jbig2/JBig2_List.h"
#include "core/fxcrt/fx_basic.h"
class CJBig2_Image;
@@ -24,10 +24,12 @@ class CJBig2_SymbolDict {
std::unique_ptr<CJBig2_SymbolDict> DeepCopy() const;
// Takes ownership of |image|.
- void AddImage(CJBig2_Image* image) { m_SDEXSYMS.push_back(image); }
+ void AddImage(std::unique_ptr<CJBig2_Image> image) {
+ m_SDEXSYMS.push_back(std::move(image));
+ }
size_t NumImages() const { return m_SDEXSYMS.size(); }
- CJBig2_Image* GetImage(size_t index) const { return m_SDEXSYMS.get(index); }
+ CJBig2_Image* GetImage(size_t index) const { return m_SDEXSYMS[index].get(); }
const std::vector<JBig2ArithCtx>& GbContext() const { return m_gbContext; }
const std::vector<JBig2ArithCtx>& GrContext() const { return m_grContext; }
@@ -42,7 +44,7 @@ class CJBig2_SymbolDict {
private:
std::vector<JBig2ArithCtx> m_gbContext;
std::vector<JBig2ArithCtx> m_grContext;
- CJBig2_List<CJBig2_Image> m_SDEXSYMS;
+ std::vector<std::unique_ptr<CJBig2_Image>> m_SDEXSYMS;
};
#endif // CORE_FXCODEC_JBIG2_JBIG2_SYMBOLDICT_H_