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

Unified Diff: core/fxcodec/jbig2/JBig2_Context.cpp

Issue 2178613002: Remove CFX_Deletable (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@fix3
Patch Set: address comments Created 4 years, 5 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 | « core/fxcodec/jbig2/JBig2_Context.h ('k') | core/fxcrt/include/fx_memory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fxcodec/jbig2/JBig2_Context.cpp
diff --git a/core/fxcodec/jbig2/JBig2_Context.cpp b/core/fxcodec/jbig2/JBig2_Context.cpp
index 1e4c35a6252d7bee2ef70e68580dabb1824b4dde..256ce3910a2484a0efbf76bfb24f492a9af1cbbf 100644
--- a/core/fxcodec/jbig2/JBig2_Context.cpp
+++ b/core/fxcodec/jbig2/JBig2_Context.cpp
@@ -591,7 +591,8 @@ int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment* pSegment,
if (it->first == key) {
std::unique_ptr<CJBig2_SymbolDict> copy(it->second->DeepCopy());
pSegment->m_Result.sd = copy.release();
- m_pSymbolDictCache->push_front(*it);
+ m_pSymbolDictCache->push_front(
+ CJBig2_CachePair(key, std::move(it->second)));
m_pSymbolDictCache->erase(it);
cache_hit = true;
break;
@@ -621,11 +622,10 @@ int32_t CJBig2_Context::parseSymbolDict(CJBig2_Segment* pSegment,
pSegment->m_Result.sd->DeepCopy();
int size = pdfium::CollectionSize<int>(*m_pSymbolDictCache);
while (size >= kSymbolDictCacheMaxSize) {
- delete m_pSymbolDictCache->back().second;
m_pSymbolDictCache->pop_back();
--size;
}
- m_pSymbolDictCache->push_front(CJBig2_CachePair(key, value.release()));
+ m_pSymbolDictCache->push_front(CJBig2_CachePair(key, std::move(value)));
}
}
if (wFlags & 0x0200) {
« no previous file with comments | « core/fxcodec/jbig2/JBig2_Context.h ('k') | core/fxcrt/include/fx_memory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698