Update comments about ownership in cpdf_indirect_object_holder.h
Change-Id: Ie652450ecca20ba87cbd80f87ed69a9b29340a22
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/100231
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Lei Zhang <thestig@chromium.org>
Auto-Submit: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/parser/cpdf_indirect_object_holder.h b/core/fpdfapi/parser/cpdf_indirect_object_holder.h
index fae2245..8cf4c06 100644
--- a/core/fpdfapi/parser/cpdf_indirect_object_holder.h
+++ b/core/fpdfapi/parser/cpdf_indirect_object_holder.h
@@ -31,7 +31,7 @@
RetainPtr<CPDF_Object> GetMutableIndirectObject(uint32_t objnum);
void DeleteIndirectObject(uint32_t objnum);
- // Creates and adds a new object owned by the indirect object holder,
+ // Creates and adds a new object retained by the indirect object holder,
// and returns a retained pointer to it. We have a special case to
// handle objects that can intern strings from our ByteStringPool.
template <typename T, typename... Args>
@@ -48,7 +48,7 @@
m_pByteStringPool, std::forward<Args>(args)...))));
}
- // Creates and adds a new object not owned by the indirect object holder,
+ // Creates and adds a new object not retained by the indirect object holder,
// but which can intern strings from it.
template <typename T, typename... Args>
typename std::enable_if<CanInternStrings<T>::value, RetainPtr<T>>::type New(
@@ -57,10 +57,10 @@
std::forward<Args>(args)...);
}
- // Takes ownership of |pObj|, returns unowned pointer to it.
+ // Retains |pObj|, returns unowned pointer to it.
CPDF_Object* AddIndirectObject(RetainPtr<CPDF_Object> pObj);
- // Always takes ownership of |pObj|, return true if higher generation number.
+ // If higher generation number, retains |pObj| and returns true.
bool ReplaceIndirectObjectIfHigherGeneration(uint32_t objnum,
RetainPtr<CPDF_Object> pObj);