Add more comments in cpdf_array.h.

Describe what SetAt() and InsertAt() do. Also update comment that talks
about ownership, as the objects are not strictly owned by CPDF_Array.

Change-Id: Iff717c27af29c71511658f86ee9357778b0697c3
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/86900
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/parser/cpdf_array.h b/core/fpdfapi/parser/cpdf_array.h
index d9a14ec..a118f2d 100644
--- a/core/fpdfapi/parser/cpdf_array.h
+++ b/core/fpdfapi/parser/cpdf_array.h
@@ -99,9 +99,15 @@
         index, pdfium::MakeRetain<T>(m_pPool, std::forward<Args>(args)...)));
   }
 
-  // Takes ownership of |pObj|, returns unowned pointer to it.
+  // Retains reference to `pObj`, returns raw pointer to it.
   CPDF_Object* Append(RetainPtr<CPDF_Object> pObj);
+  // Overwrites the object at `index`. `index` must be less than the array size.
   CPDF_Object* SetAt(size_t index, RetainPtr<CPDF_Object> pObj);
+  // Inserts `pObj` and shifts existing objects starting at `index` over, like
+  // std::vector::insert(). Unlike std::vector::insert(), where
+  // std::vector::end() is the last possible position, `index` can be greater
+  // than or equal to the array size. In which case, the array will be resized
+  // such that `index` is the last object.
   CPDF_Object* InsertAt(size_t index, RetainPtr<CPDF_Object> pObj);
 
   void Clear();