Add browser-wide discardable memory implementation.
This provides a platform agnostic implementation of discardable
memory based on shared memory. Managment of discardable memory is
moved to the browser process instead of being local to each renderer.
This provides much better control over chromium's total discardable
memory usage.
A round-trip to the browser IO thread is necessary for a renderer
to allocate a new discardable memory segment but the cost of this
can be reduced by maintaining free lists on the renderer side and
have discardable memory instances share the same discardable
memory segment. The implementation of this optimization is left as
a follow up.
Note: while the general implementation is platform agnostic, it
takes advantage of the ftruncate syscall available on Posix
platforms. This syscall makes it possible to release discardable
memory segments immediately to the OS from the browser process.
BUG=381178,400423,422953
TEST=base_unittests --gtest_filter=DiscardableMemoryTests*, base_unittests --gtest_filter=DiscardableSharedMemory.*, content_unittests --gtest_filter=HostDiscardableSharedMemoryManagerTest.*
Review URL: https://codereview.chromium.org/
531343002
Cr-Commit-Position: refs/heads/master@{#301152}