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}
32 files changed