Replace raw |new| with |base::MakeUnique| where appropriate |
||
Issue descriptionauto my_ptr = base::MakeUnique<T>() is preferable over std::unique_ptr<T> my_ptr(new T) because it provides exception safety and does not require to repeat the typename (base::MakeUnique is equivalent to std::make_unique which is part of C++14). Even though this change is beneficial to all code, we limit the scope to a single file, to avoid polluting the git history. References: - Scott Meyers - Effective Modern C++ - Item 21: Prefer std::make_unique [...] to direct use of new. - https://herbsutter.com/gotw/_102/ - http://en.cppreference.com/w/cpp/memory/unique_ptr/make_unique
,
Dec 23 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/3402daf429bf0513a80c06f082d5668b6ec43235 commit 3402daf429bf0513a80c06f082d5668b6ec43235 Author: jdoerrie <jdoerrie@chromium.org> Date: Fri Dec 23 11:01:22 2016 Remove usages of raw new This change introduces a cleanup mentioned in http://crrev.com/2598003002. Raw usages of new are replaced by base::MakeUnique. BUG= 676785 R=vabr@chromium.org Review-Url: https://codereview.chromium.org/2605483002 Cr-Commit-Position: refs/heads/master@{#440616} [modify] https://crrev.com/3402daf429bf0513a80c06f082d5668b6ec43235/chrome/browser/password_manager/credential_manager_browsertest.cc
,
Nov 16 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by jdoerrie@chromium.org
, Dec 23 2016