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

Issue 2484033002: Return unique_ptr from CPDF_Object::Clone(). (Closed)

Created:
4 years, 1 month ago by Tom Sepez
Modified:
4 years, 1 month ago
Reviewers:
Lei Zhang
CC:
pdfium-reviews_googlegroups.com
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

Return unique_ptr from CPDF_Object::Clone(). Because that's what clone does. There are numerous release() calls that will go away as more code is converted. Committed: https://pdfium.googlesource.com/pdfium/+/335cf093231c984a23cb9ea113148ea1f19621ba

Patch Set 1 #

Patch Set 2 : Fix UAF #

Patch Set 3 : Work around android compiler limitiaton. #

Patch Set 4 : Be painfully obvious about hidden expression #

Total comments: 6

Patch Set 5 : remove null check #

Patch Set 6 : straight rebase. #

Patch Set 7 : Fix one new usage in fpdf_flatten.cpp #

Patch Set 8 : std::move() it #

Unified diffs Side-by-side diffs Delta from patch set Stats (+136 lines, -130 lines) Patch
M core/fpdfapi/edit/fpdf_edit_create.cpp View 6 chunks +6 lines, -6 lines 0 comments Download
M core/fpdfapi/page/cpdf_contentmarkitem.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M core/fpdfapi/page/cpdf_streamcontentparser.cpp View 1 chunk +1 line, -1 line 0 comments Download
M core/fpdfapi/parser/cpdf_array.h View 2 chunks +3 lines, -3 lines 0 comments Download
M core/fpdfapi/parser/cpdf_array.cpp View 1 2 4 5 6 7 1 chunk +9 lines, -8 lines 0 comments Download
M core/fpdfapi/parser/cpdf_array_unittest.cpp View 1 2 chunks +3 lines, -3 lines 0 comments Download
M core/fpdfapi/parser/cpdf_boolean.h View 1 chunk +1 line, -1 line 0 comments Download
M core/fpdfapi/parser/cpdf_boolean.cpp View 2 chunks +3 lines, -2 lines 0 comments Download
M core/fpdfapi/parser/cpdf_dictionary.h View 2 chunks +3 lines, -3 lines 0 comments Download
M core/fpdfapi/parser/cpdf_dictionary.cpp View 1 2 4 5 6 7 1 chunk +6 lines, -6 lines 0 comments Download
M core/fpdfapi/parser/cpdf_name.h View 1 chunk +1 line, -1 line 0 comments Download
M core/fpdfapi/parser/cpdf_name.cpp View 2 chunks +3 lines, -2 lines 0 comments Download
M core/fpdfapi/parser/cpdf_null.h View 1 chunk +1 line, -1 line 0 comments Download
M core/fpdfapi/parser/cpdf_null.cpp View 2 chunks +3 lines, -2 lines 0 comments Download
M core/fpdfapi/parser/cpdf_number.h View 1 chunk +2 lines, -2 lines 0 comments Download
M core/fpdfapi/parser/cpdf_number.cpp View 2 chunks +4 lines, -2 lines 0 comments Download
M core/fpdfapi/parser/cpdf_object.h View 3 chunks +6 lines, -5 lines 0 comments Download
M core/fpdfapi/parser/cpdf_object.cpp View 1 chunk +4 lines, -3 lines 0 comments Download
M core/fpdfapi/parser/cpdf_object_unittest.cpp View 1 7 chunks +17 lines, -15 lines 0 comments Download
M core/fpdfapi/parser/cpdf_parser.cpp View 3 chunks +5 lines, -7 lines 0 comments Download
M core/fpdfapi/parser/cpdf_reference.h View 2 chunks +3 lines, -3 lines 0 comments Download
M core/fpdfapi/parser/cpdf_reference.cpp View 3 chunks +4 lines, -3 lines 0 comments Download
M core/fpdfapi/parser/cpdf_stream.h View 2 chunks +3 lines, -3 lines 0 comments Download
M core/fpdfapi/parser/cpdf_stream.cpp View 2 chunks +6 lines, -6 lines 0 comments Download
M core/fpdfapi/parser/cpdf_string.h View 1 chunk +2 lines, -2 lines 0 comments Download
M core/fpdfapi/parser/cpdf_string.cpp View 2 chunks +3 lines, -2 lines 0 comments Download
M core/fpdfdoc/cpdf_formfield.cpp View 1 chunk +4 lines, -4 lines 0 comments Download
M core/fpdfdoc/cpdf_interform.cpp View 3 chunks +7 lines, -6 lines 0 comments Download
M core/fpdfdoc/cpvt_generateap.cpp View 2 chunks +4 lines, -2 lines 0 comments Download
M fpdfsdk/fpdf_flatten.cpp View 1 2 3 4 5 6 1 chunk +3 lines, -2 lines 0 comments Download
M fpdfsdk/fpdfppo.cpp View 1 2 3 4 6 chunks +15 lines, -23 lines 0 comments Download

Messages

Total messages: 31 (22 generated)
Tom Sepez
Lei, ready for review.
4 years, 1 month ago (2016-11-08 17:21:41 UTC) #14
Lei Zhang
lgtm https://codereview.chromium.org/2484033002/diff/60001/core/fpdfapi/parser/cpdf_dictionary.cpp File core/fpdfapi/parser/cpdf_dictionary.cpp (right): https://codereview.chromium.org/2484033002/diff/60001/core/fpdfapi/parser/cpdf_dictionary.cpp#newcode76 core/fpdfapi/parser/cpdf_dictionary.cpp:76: return std::unique_ptr<CPDF_Object>(std::move(pCopy)); I saw you had green trybots ...
4 years, 1 month ago (2016-11-08 18:55:43 UTC) #17
Tom Sepez
On 2016/11/08 18:55:43, Lei Zhang (slow) wrote: > lgtm > > https://codereview.chromium.org/2484033002/diff/60001/core/fpdfapi/parser/cpdf_dictionary.cpp > File core/fpdfapi/parser/cpdf_dictionary.cpp ...
4 years, 1 month ago (2016-11-09 17:51:36 UTC) #20
Tom Sepez
Uh, ignore that, stray click.
4 years, 1 month ago (2016-11-09 17:51:56 UTC) #21
Tom Sepez
https://codereview.chromium.org/2484033002/diff/60001/core/fpdfapi/parser/cpdf_dictionary.cpp File core/fpdfapi/parser/cpdf_dictionary.cpp (right): https://codereview.chromium.org/2484033002/diff/60001/core/fpdfapi/parser/cpdf_dictionary.cpp#newcode76 core/fpdfapi/parser/cpdf_dictionary.cpp:76: return std::unique_ptr<CPDF_Object>(std::move(pCopy)); On 2016/11/08 18:55:43, Lei Zhang (slow) wrote: ...
4 years, 1 month ago (2016-11-09 18:20:46 UTC) #22
Lei Zhang
I believe https://www.chromium.org/rvalue-references #11 covers this situation: "However, if the types of the variable and ...
4 years, 1 month ago (2016-11-09 19:39:12 UTC) #25
Tom Sepez
On 2016/11/09 19:39:12, Lei Zhang (slow) wrote: > I believe https://www.chromium.org/rvalue-references #11 covers this situation: ...
4 years, 1 month ago (2016-11-09 19:52:31 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2484033002/140001
4 years, 1 month ago (2016-11-09 20:02:54 UTC) #29
commit-bot: I haz the power
4 years, 1 month ago (2016-11-09 21:28:32 UTC) #31
Message was sent while issue was closed.
Committed patchset #8 (id:140001) as
https://pdfium.googlesource.com/pdfium/+/335cf093231c984a23cb9ea113148ea1f196...

Powered by Google App Engine
This is Rietveld 408576698