Base [android]: Introduce ScopedHardwareBufferHandle

This is a scoping wrapper around an owned AHardwareBuffer reference.

Removes code in SharedMemory/SharedMemoryHandle to serve the same
purpose, such that shared memory objects on Android are now always
actually ashmem objects.

Updates GpuMemoryBufferHandle and
GpuMemoryBufferImplAndroidHardwareBuffer (the only existing use of the
special not-really-shared-memory type) to use a raw AHarwdwareBuffer*
(unowned) or ScopedHardwareBufferHandle (owned) instead.

Also fixes a bug in MailboxToSurfaceBridge which was stealing an
a AHardwareBuffer ref from its caller.

Bug: 826213
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel
Change-Id: I9e8403ad9e120cc9c68012dd537a0bc4af9a513c
Reviewed-on: https://chromium-review.googlesource.com/1014541
Commit-Queue: Ken Rockot <rockot@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: David Reveman <reveman@chromium.org>
Reviewed-by: Klaus Weidner <klausw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552723}

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