PPAPI: Upgrade video decoder host shared memory API.

Use an UnsafeSharedMemoryRegion instead of the existing handle. The
shared memory on the host side is used read-only, but because a
writable region needs to be shipped to the other side of the proxy, an
unsafe region needs to be used.

Host                         | Other side of proxy
                             |   Request SHM
 Create SHM <-----------------------/
 Reply with SHM Handle       |
   | \-------------------------> Receive SHM
 Save SHM by ID              |
                             |   Fill SHM with video to decode
                             |       (write to SHM)
                             |   Send SHM ID to Host
 Receive decode request <-----------/
 Look up buffer by ID        |
 Decode what's in the SHM    |
  (read-only SHM access)

The host-side could use a read-only region only by adding an additional
round-trip, with the other side of the proxy either converting to
read-only after mapping writable, and shipping back to the host,
or the other side of the proxy mapping, shipping back a writable
handle, and then the host converting to read-only. This has not been
done in this CL.

Bug: 849207
Change-Id: I3e50f9ff9c65e51c21c7e4d72b3aed2402c03196
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1615021
Commit-Queue: Matthew Cary (CET) <mattcary@chromium.org>
Reviewed-by: Chris Palmer <palmer@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Reviewed-by: Bill Budge <bbudge@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#666194}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 66e4f70d12d15a1f2e4ea4c4172911faffd4a46c
7 files changed