Chromium Code Reviews| 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
|
| } |