Add type-safer helpers for accessing SharedMemoryMappings.

- GetMemoryAs<T> should be used when the mapping contains one T.
- GetMemoryAsSpan<T> should be used when the mapping contains more than
  one T. The element count can be explicitly specified or autodeduced
  from the size of the shared memory mapping.

Bug: 795291, 866975
Change-Id: Icea4e276a26a1c47688c0a5206b97cd42ff92043
Reviewed-on: https://chromium-review.googlesource.com/1144312
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Alexandr Ilin <alexilin@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577630}
3 files changed