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

Unified Diff: core/fpdfapi/parser/cpdf_object_unittest.cpp

Issue 2477003002: Pass object to ReplaceIndirectObjectIfHigherGeneration() by unique_ptr. (Closed)
Patch Set: Created 4 years, 1 month 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/fpdfapi/parser/cpdf_object_unittest.cpp
diff --git a/core/fpdfapi/parser/cpdf_object_unittest.cpp b/core/fpdfapi/parser/cpdf_object_unittest.cpp
index 64dc8c63ecfb5e04d2e07d039130c1172b6085a3..1bcf6164bee3feccde9da901d09e577f903b03b1 100644
--- a/core/fpdfapi/parser/cpdf_object_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_object_unittest.cpp
@@ -722,9 +722,8 @@ TEST(PDFArrayTest, AddReferenceAndGetObjectAt) {
std::unique_ptr<CPDF_Array> arr1(new CPDF_Array);
// Create two arrays of references by different AddReference() APIs.
for (size_t i = 0; i < FX_ArraySize(indirect_objs); ++i) {
- // All the indirect objects inserted will be owned by holder.
- holder->ReplaceIndirectObjectIfHigherGeneration(obj_nums[i],
- indirect_objs[i]);
+ holder->ReplaceIndirectObjectIfHigherGeneration(
+ obj_nums[i], pdfium::WrapUnique<CPDF_Object>(indirect_objs[i]));
arr->AddReference(holder.get(), obj_nums[i]);
arr1->AddReference(holder.get(), indirect_objs[i]->GetObjNum());
Lei Zhang 2016/11/04 22:04:36 Didn't we just give away |indirect_objs[i]| above?
Tom Sepez 2016/11/04 22:44:03 No, that's why WrapUnique() has to be viewed with
}

Powered by Google App Engine
This is Rietveld 408576698