1) Add MakeUnique to WTF. This is an implementation of C++14's std::make_unique.
See http://en.cppreference.com/w/cpp/memory/unique_ptr/make_unique for more details.
2) Migrate all occurrences of WTF::WrapUnique<T>(new T(args)) and std::unique_ptr<T>(new T(args)) to WTF::MakeUnique<T>(args)
I have a question regarding part 2 (migrate to MakeUnique): are we going to enforce this somehow (e.g. presubmit)? If not, the pattern will creep back in, and I doubt it's worth to convert existing ones in this case.
I think when we added base::MakeUnique, we also needed an update to Code Search so that it would pass-through base::MakeUnique as it does with std::make_unique. (Otherwise, code search would show only MakeUnique as the call site of constructors, which isn't particularly helpful.)
Is a similar change neede for WTF::makeUnique, if we're moving to that?
[cc dcheng, who IIRC figured this out for base]
Yes, we need to make a similar change so that code search knows how to look through WTF::makeUnique: otherwise, codesearch will just WTF::makeUnique as the only construction site. glebl@, I'll link you the internal CL that made this work.
Comment 1 by bugdroid1@chromium.org
, Nov 4 2016