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

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

Issue 2419173002: Update CPDF_IndirectObjectHolder APIs for unique objects (Closed)
Patch Set: Fix issues Created 4 years, 2 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
« no previous file with comments | « core/fpdfapi/parser/cpdf_array.cpp ('k') | core/fpdfapi/parser/cpdf_data_avail.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/parser/cpdf_array_unittest.cpp
diff --git a/core/fpdfapi/parser/cpdf_array_unittest.cpp b/core/fpdfapi/parser/cpdf_array_unittest.cpp
index bc9f578021c4ace3d48958cdb7332b19e79c8c84..a3a27fc4cebb77899c9c94551b0e9050fed82ce6 100644
--- a/core/fpdfapi/parser/cpdf_array_unittest.cpp
+++ b/core/fpdfapi/parser/cpdf_array_unittest.cpp
@@ -113,10 +113,11 @@ TEST(cpdf_array, Clone) {
for (size_t i = 0; i < kNumOfRows; ++i) {
CPDF_Array* arr_elem = new CPDF_Array;
for (size_t j = 0; j < kNumOfRowElems; ++j) {
- CPDF_Number* obj = new CPDF_Number(elems[i][j]);
- // Starts object number from 1.
+ UniqueObject obj(new CPDF_Number(elems[i][j]));
+ // Object number starts from 1.
int obj_num = i * kNumOfRowElems + j + 1;
- obj_holder->ReplaceIndirectObjectIfHigherGeneration(obj_num, obj);
+ obj_holder->ReplaceIndirectObjectIfHigherGeneration(obj_num,
+ std::move(obj));
arr_elem->InsertAt(j, new CPDF_Reference(obj_holder.get(), obj_num));
}
arr->InsertAt(i, arr_elem);
« no previous file with comments | « core/fpdfapi/parser/cpdf_array.cpp ('k') | core/fpdfapi/parser/cpdf_data_avail.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698