commit | 6562397ff8ed6ee54bbc5162d14223570b3027e1 | [log] [tgz] |
---|---|---|
author | Bence Béky <bnc@chromium.org> | Mon Mar 05 15:31:56 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Mon Mar 05 15:31:56 2018 |
tree | d2b38051fb5e10ce805a1091177ec0e08f58d494 | |
parent | ebe5bdf884be07fd8a5db6fae87ebd16e3f0bc4d [diff] |
Remove many naked new statements from net/websockets. This change is fairly mechanical and purely cosmetic. Use make_unique instead of creating an object with new and passing that into a unique_ptr constructor. (This often changes local variable type, but when passed as an argument an implicitly cast takes care of this). Use MakeRefCounted instead of creating an object with new and passing that into a scoped_refptr constructor. (This never changes variable type in this CL). Do these in constructor initializer lists as well. Remove unnecessary namespace qualifiers in a few places (where unique_ptr template parameter has it but new statement does not in the same line). Use assignment operator instead of reset() method of unique_ptr. Use std::move instead of two-step WrapUnique(unique_ptr.release()). Where object needs to be constructed with new statement and raw pointer is already available, use WrapUnique instead of passing the raw pointer to a unique_ptr constructor. Use auto where appropriate. Replace NULL by nullptr in one line which is touched anyway. Make sure to include memory for new, unique_ptr. Include scoped_refptr.h for scoped_refptr and MakeRefCounted. Delete unnecessary ref_counted.h include (only needed for RefCounted* base classes). Delete unnecessary memory include where corresponding header file already included it. Change-Id: I6fa58780e5ae89e2684aabdd21452b76be52a4f8 Reviewed-on: https://chromium-review.googlesource.com/946053 Commit-Queue: Bence Béky <bnc@chromium.org> Reviewed-by: Adam Rice <ricea@chromium.org> Cr-Commit-Position: refs/heads/master@{#540826}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .