Implement base::AtomicRefCount as a class wrapping std::atomic_int.

This is the more standard approach since C++11, and it allows this class to
be encapsulated (preventing abuse by performing other operations on the data).

If landed, call sites will be rewritten to call member functions directly.

A warning must be suppressed in MSVC, because std::atomic forces alignment,
and MSVC warns on end-padding due to alignment on a class, which occurs
in base::RefCountedThreadSafe in debug builds (and the warning is not
targeted at base/memory/ref_counted.*, so it's hard to suppress).

Bug: 736037
Tbr: rockot@chromium.org,xiyuan@chromium.org
Change-Id: Ieb0599b4a67a4e8db06bd4d08c3126baea9207e2
Reviewed-on: https://chromium-review.googlesource.com/550378
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Taiju Tsuiki <tzik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#483238}

CrOS-Libchrome-Original-Commit: 031d45a1058ecf90d45c25b550734b5bf9b608dd
3 files changed
tree: fba4d03dc0948fa4780f31017e7e9153fdb65f5e
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/