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

Issue 1513423002: Add WrapUnique helper to wrap a raw pointer in a std::unique_ptr. (Closed)

Created:
5 years ago by dcheng
Modified:
5 years ago
CC:
chromium-reviews, gavinp+memory_chromium.org, vmpstr+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add WrapUnique helper to wrap a raw pointer in a std::unique_ptr. This is the equivalent of make_scoped_ptr in a post-scoped_ptr world. It is not called MakeUniquePtr because C++14 adds a std::make_unique helper with different semantics. BUG=554522 Committed: https://crrev.com/2ba07d1f31f04391c83a53a2e49387de58b1ac2d Cr-Commit-Position: refs/heads/master@{#365079}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Comment changes and stuff #

Patch Set 3 : Address comments and add comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -0 lines) Patch
M base/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M base/base.gyp View 1 chunk +1 line, -0 lines 0 comments Download
M base/base.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M base/memory/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
A base/memory/ptr_util.h View 1 1 chunk +22 lines, -0 lines 0 comments Download
A base/memory/ptr_util_unittest.cc View 1 chunk +38 lines, -0 lines 0 comments Download

Messages

Total messages: 13 (3 generated)
dcheng
Another thing to consider: is it worth adding no-compile tests for the static asserts? nocompile ...
5 years ago (2015-12-11 21:32:01 UTC) #2
danakj
https://codereview.chromium.org/1513423002/diff/1/base/memory/ptr_util.h File base/memory/ptr_util.h (right): https://codereview.chromium.org/1513423002/diff/1/base/memory/ptr_util.h#newcode15 base/memory/ptr_util.h:15: std::unique_ptr<T> WrapUnique(T* ptr) { I don't understand the point ...
5 years ago (2015-12-11 22:01:33 UTC) #3
dcheng
https://codereview.chromium.org/1513423002/diff/1/base/memory/ptr_util.h File base/memory/ptr_util.h (right): https://codereview.chromium.org/1513423002/diff/1/base/memory/ptr_util.h#newcode15 base/memory/ptr_util.h:15: std::unique_ptr<T> WrapUnique(T* ptr) { On 2015/12/11 at 22:01:32, danakj ...
5 years ago (2015-12-11 22:54:26 UTC) #4
danakj
https://codereview.chromium.org/1513423002/diff/1/base/memory/ptr_util.h File base/memory/ptr_util.h (right): https://codereview.chromium.org/1513423002/diff/1/base/memory/ptr_util.h#newcode16 base/memory/ptr_util.h:16: static_assert(!std::is_array<T>::value || std::extent<T>::value != 0, On 2015/12/11 21:32:01, dcheng ...
5 years ago (2015-12-12 00:01:23 UTC) #5
dcheng
https://codereview.chromium.org/1513423002/diff/1/base/memory/ptr_util.h File base/memory/ptr_util.h (right): https://codereview.chromium.org/1513423002/diff/1/base/memory/ptr_util.h#newcode16 base/memory/ptr_util.h:16: static_assert(!std::is_array<T>::value || std::extent<T>::value != 0, On 2015/12/12 at 00:01:22, ...
5 years ago (2015-12-14 17:41:25 UTC) #6
vmpstr
https://codereview.chromium.org/1513423002/diff/1/base/memory/ptr_util.h File base/memory/ptr_util.h (right): https://codereview.chromium.org/1513423002/diff/1/base/memory/ptr_util.h#newcode16 base/memory/ptr_util.h:16: static_assert(!std::is_array<T>::value || std::extent<T>::value != 0, On 2015/12/14 17:41:24, dcheng ...
5 years ago (2015-12-14 19:05:39 UTC) #7
danakj
LGTM
5 years ago (2015-12-14 19:37:58 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1513423002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1513423002/40001
5 years ago (2015-12-14 19:46:09 UTC) #10
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years ago (2015-12-14 20:07:21 UTC) #11
commit-bot: I haz the power
5 years ago (2015-12-14 20:08:34 UTC) #13
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/2ba07d1f31f04391c83a53a2e49387de58b1ac2d
Cr-Commit-Position: refs/heads/master@{#365079}

Powered by Google App Engine
This is Rietveld 408576698