Add support to create memory allocator dump in base::DiscardableMemory
The clients that use discardable memory need to make a memory dump for
tracing. But, the client do not know if the memory is purged or not. So,
discardable manager dumps the live segments and the clients would dump
all the allocations, without the knowledge from the manager. To make the
memory dumps consistent, new api is added to the base::discardable
memory interface to create a memory allocator. this method creates dump
only if the memory is live according to the manager. Note: This still
does not mean that the memory is resident in the system, and the OS
could have purged this discardable segment. This method only helps to
make the memory dumps consistent across all systems. Also, the clients
may not keep track the size of each segment they allocate. So, this api
adds the size when creating the dump. See doc https://goo.gl/AFSTRP.
BUG=503168
Review URL: https://codereview.chromium.org/
1306243003
Cr-Commit-Position: refs/heads/master@{#345332}