Revert of Make base::WeakPtr::Get() fast (patchset #10 id:180001 of https://codereview.chromium.org/2963623002/ )

Reason for revert:
This seems to have broken Cronet tests and Linux TSan. See bugs.

Original issue's description:
> Make base::WeakPtr::Get() fast
>
> It was previously calling WeakReference::is_valid() which was an out-of-line
> method. That means code like
>
>   if (my_weak_ptr)
>     my_weak_ptr->foo();
>
> would do two calls to is_valid(), plus tests and branching.
>
> The is_valid() method showed up as one of the most frequently called non-inline
> functions during browser start-up on Windows (about 1M calls).
>
> is_valid() was also inefficient because it had to do a null-pointer check on
> flag_, as well as checking if the flag was marked valid.
>
> This patch removes the null-pointer check by using a sentinel object instead of
> a nullptr. And instead of storing a bool in the flag, it stores a pointer-sized
> bitmask 0 or ~0, so it can be AND'ed with the pointer value and conveniently
> setting EFLAGS so that the code above just becomes a few loads, AND, branch,
> and call. (The size of Flag is unchanged; it grows into the padding only.)
>
> This is expected to reduce the binary size by ~48KB on Android, and increase it
> by 79KB on x64 Linux -- something that's paid for by the split-out refactorings
> to WeakPtr and WeakPtrFactory.
>
> Exposing the SequenceChecker calls in inline functions caused the
> MessageLoopTestType*.Nesting test to overflow on Win64 dcheck release builds,
> which is why this patch also lowers the recursion depth there.
>
> BUG=728324
>
> Review-Url: https://codereview.chromium.org/2963623002
> Cr-Commit-Position: refs/heads/master@{#483427}
> Committed: https://chromium.googlesource.com/chromium/src/+/526f714c9ae172c3b16581b7e11eb035fd14274e

TBR=thakis@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=728324,738167,738183,738193

Review-Url: https://codereview.chromium.org/2966633002
Cr-Commit-Position: refs/heads/master@{#483509}


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