SharedMemoryTracker will stop tracking memory if TakeHandle() was called

When TakeHandle() is called, the SharedMemory instance resets itself
and transfers ownership to the caller. In this case stop tracking the
instance since Unmap() will be noop since memory will be nullptr.
On Mac TakeHandle() just duplicates the handle and doesn't reset the
current instance. So, still tracking this memory is ok.
Note: This will change how private memory footprint is calculated since
we no longer track some shared memory instances.


Change-Id: I28ed88bfee2033cdf07595d314505413f067e49b
Commit-Queue: Siddhartha S <>
Reviewed-by: Daniel Cheng <>
Reviewed-by: Hajime Hoshi <>
Reviewed-by: Erik Chen <>
Cr-Original-Commit-Position: refs/heads/master@{#533570}(cherry picked from commit a0996a237aaec59e2973eeed7f58e55f13169bc3)
Reviewed-by: Siddhartha S <>
Cr-Commit-Position: refs/branch-heads/3325@{#541}
Cr-Branched-From: bc084a8b5afa3744a74927344e304c02ae54189f-refs/heads/master@{#530369}
4 files changed