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

Issue 1351383004: Change nonstd::unique_ptr to take a custom deleter. (Closed)

Created:
5 years, 3 months ago by Lei Zhang
Modified:
5 years, 3 months ago
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Change nonstd::unique_ptr to take a custom deleter. Code is mostly stolen from Chromium's scoped_ptr. - Add unit tests. - Use this to fix a leak. BUG=chromium:531408 R=jyasskin@chromium.org, tsepez@chromium.org Committed: https://pdfium.googlesource.com/pdfium/+/cef2a9c51bee4b987fc813013d45dad6535a9a46

Patch Set 1 : #

Patch Set 2 : forgot the unit test #

Total comments: 8

Patch Set 3 : address comments #

Total comments: 19

Patch Set 4 : rebase #

Patch Set 5 : address comments, steal more code #

Total comments: 6

Patch Set 6 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+587 lines, -99 lines) Patch
M BUILD.gn View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M core/include/fxcrt/fx_basic.h View 2 chunks +8 lines, -0 lines 0 comments Download
M core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp View 2 chunks +4 lines, -3 lines 0 comments Download
M third_party/base/nonstd_unique_ptr.h View 1 2 3 4 5 4 chunks +226 lines, -95 lines 0 comments Download
M third_party/base/nonstd_unique_ptr_unittest.cpp View 1 2 3 1 chunk +303 lines, -0 lines 0 comments Download
M third_party/base/template_util.h View 1 2 3 4 2 chunks +45 lines, -1 line 0 comments Download

Messages

Total messages: 18 (2 generated)
Lei Zhang
I really want custom deleters, so I copied a lot of code out of scoped_ptr.h. ...
5 years, 3 months ago (2015-09-18 22:37:17 UTC) #3
Lei Zhang
Oh, and fx_basic_unique_ptr_unittest.cpp is in patch set 2. I copied over all the tests that ...
5 years, 3 months ago (2015-09-18 22:40:57 UTC) #4
Tom Sepez
I took a pass at the non-third_party/base stuff. I'll defer on the other to Jeffrey. ...
5 years, 3 months ago (2015-09-18 23:29:33 UTC) #5
Lei Zhang
https://codereview.chromium.org/1351383004/diff/40001/BUILD.gn File BUILD.gn (right): https://codereview.chromium.org/1351383004/diff/40001/BUILD.gn#newcode738 BUILD.gn:738: "core/src/fxcrt/fx_basic_unique_ptr_unittest.cpp", On 2015/09/18 23:29:32, Tom Sepez wrote: > I ...
5 years, 3 months ago (2015-09-18 23:51:52 UTC) #6
Jeffrey Yasskin
Can you also include the non-compilation test from scoped_ptr? https://codereview.chromium.org/1351383004/diff/60001/third_party/base/nonstd_unique_ptr.h File third_party/base/nonstd_unique_ptr.h (right): https://codereview.chromium.org/1351383004/diff/60001/third_party/base/nonstd_unique_ptr.h#newcode76 third_party/base/nonstd_unique_ptr.h:76: ...
5 years, 3 months ago (2015-09-19 00:00:48 UTC) #7
Tom Sepez
LGTM on the non-base code.
5 years, 3 months ago (2015-09-21 16:54:33 UTC) #8
Tom Sepez
https://codereview.chromium.org/1351383004/diff/60001/third_party/base/nonstd_unique_ptr_unittest.cpp File third_party/base/nonstd_unique_ptr_unittest.cpp (right): https://codereview.chromium.org/1351383004/diff/60001/third_party/base/nonstd_unique_ptr_unittest.cpp#newcode25 third_party/base/nonstd_unique_ptr_unittest.cpp:25: class ConDecLogger : public ConDecLoggerParent { Actually, I want ...
5 years, 3 months ago (2015-09-22 17:36:20 UTC) #9
Tom Sepez
ConDecLoggerParent { > Actually, I want to steal this file to test nonstd::move(), do you ...
5 years, 3 months ago (2015-09-22 22:11:04 UTC) #10
Lei Zhang
On 2015/09/22 22:11:04, Tom Sepez wrote: > ConDecLoggerParent { > > Actually, I want to ...
5 years, 3 months ago (2015-09-22 22:52:40 UTC) #11
Lei Zhang
https://codereview.chromium.org/1351383004/diff/60001/third_party/base/nonstd_unique_ptr.h File third_party/base/nonstd_unique_ptr.h (right): https://codereview.chromium.org/1351383004/diff/60001/third_party/base/nonstd_unique_ptr.h#newcode76 third_party/base/nonstd_unique_ptr.h:76: #include <algorithm> On 2015/09/19 00:00:47, Jeffrey Yasskin wrote: > ...
5 years, 3 months ago (2015-09-23 00:38:56 UTC) #12
Jeffrey Yasskin
Any news on the non-compilation tests? LGTM anyway. https://codereview.chromium.org/1351383004/diff/60001/third_party/base/nonstd_unique_ptr.h File third_party/base/nonstd_unique_ptr.h (right): https://codereview.chromium.org/1351383004/diff/60001/third_party/base/nonstd_unique_ptr.h#newcode150 third_party/base/nonstd_unique_ptr.h:150: struct ...
5 years, 3 months ago (2015-09-23 00:53:35 UTC) #13
Lei Zhang
On 2015/09/23 00:53:35, Jeffrey Yasskin wrote: > Any news on the non-compilation tests? LGTM anyway. ...
5 years, 3 months ago (2015-09-23 01:00:09 UTC) #14
Jeffrey Yasskin
On 2015/09/23 01:00:09, Lei Zhang wrote: > On 2015/09/23 00:53:35, Jeffrey Yasskin wrote: > > ...
5 years, 3 months ago (2015-09-23 01:04:44 UTC) #15
Lei Zhang
Oh, that thing. I'll take a look at the non-compilation tests. https://codereview.chromium.org/1351383004/diff/100001/third_party/base/nonstd_unique_ptr.h File third_party/base/nonstd_unique_ptr.h (right): ...
5 years, 3 months ago (2015-09-23 01:11:30 UTC) #16
Lei Zhang
On 2015/09/23 01:04:44, Jeffrey Yasskin wrote: > On 2015/09/23 01:00:09, Lei Zhang wrote: > > ...
5 years, 3 months ago (2015-09-23 01:40:28 UTC) #17
Lei Zhang
5 years, 3 months ago (2015-09-23 02:15:53 UTC) #18
Message was sent while issue was closed.
Committed patchset #6 (id:120001) manually as
cef2a9c51bee4b987fc813013d45dad6535a9a46 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698