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

Unified Diff: core/include/fpdfapi/fpdf_objects.h

Issue 1582963003: Fix some iterator invalidation issues while traversing CPDF_Dictionary. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: fix a bug in CPDF_Dictionary::ReplaceKey while we're at it Created 4 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
Index: core/include/fpdfapi/fpdf_objects.h
diff --git a/core/include/fpdfapi/fpdf_objects.h b/core/include/fpdfapi/fpdf_objects.h
index 80d978ecd9ea7af17de958d0684cdb40aedc7a84..35d9916a7b575ab4306c70c45eb3741d3ea733af 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 invalidates iterators for the given key.
Lei Zhang 2016/01/14 01:32:29 -> Set* functions invalidates iterators for |key|.
Oliver Chang 2016/01/14 02:04:53 oops, I completely missed this comment, and made m
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 given key.
void RemoveAt(const CFX_ByteStringC& key);
+ // Invalidates iterators for oldkey.
void ReplaceKey(const CFX_ByteStringC& oldkey, const CFX_ByteStringC& newkey);
FX_BOOL Identical(CPDF_Dictionary* pDict) const;
« no previous file with comments | « no previous file | core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp » ('j') | core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698