summaryrefslogtreecommitdiff
path: root/core/include
diff options
context:
space:
mode:
authorOliver Chang <ochang@chromium.org>2016-01-13 18:46:09 -0800
committerOliver Chang <ochang@chromium.org>2016-01-13 18:46:09 -0800
commitbd292ae8c0ca1793e8824add13bc8231cec3bc75 (patch)
treef9c90ff5288681aa9d5550e23c5e278b6f794ab2 /core/include
parent81ec24c0fe046dcb7006ce69682c731a09205231 (diff)
downloadpdfium-bd292ae8c0ca1793e8824add13bc8231cec3bc75.tar.xz
Merge to XFA: Fix some iterator invalidation issues while traversing CPDF_Dictionary.
Also fixes a potential issue in CPDF_Dictionary::ReplaceKey. TBR=thestig@chromium.org BUG=577030 Original Review URL: https://codereview.chromium.org/1582963003 . (cherry picked from commit cae57daaa0f7ed4c92e22c4e7ef30392393d1128) Review URL: https://codereview.chromium.org/1587703003 .
Diffstat (limited to 'core/include')
-rw-r--r--core/include/fpdfapi/fpdf_objects.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/include/fpdfapi/fpdf_objects.h b/core/include/fpdfapi/fpdf_objects.h
index 80d978ecd9..92ce0b922f 100644
--- a/core/include/fpdfapi/fpdf_objects.h
+++ b/core/include/fpdfapi/fpdf_objects.h
@@ -385,6 +385,7 @@ class CPDF_Dictionary : public CPDF_Object {
FX_BOOL KeyExist(const CFX_ByteStringC& key) const;
+ // Set* functions invalidate iterators for the element with the key |key|.
void SetAt(const CFX_ByteStringC& key, CPDF_Object* pObj);
void SetAtName(const CFX_ByteStringC& key, const CFX_ByteString& name);
@@ -415,8 +416,10 @@ class CPDF_Dictionary : public CPDF_Object {
void SetAtBoolean(const CFX_ByteStringC& key, FX_BOOL bValue);
+ // Invalidates iterators for the element with the key |key|.
void RemoveAt(const CFX_ByteStringC& key);
+ // Invalidates iterators for the element with the key |oldkey|.
void ReplaceKey(const CFX_ByteStringC& oldkey, const CFX_ByteStringC& newkey);
FX_BOOL Identical(CPDF_Dictionary* pDict) const;