gpu: Convert command and transfer buffers to the new shared memory API

This CL replaces the deprecated base::SharedMemory in
gpu::SharedMemoryBufferBacking with the base::UnsafeSharedMemoryRegion. This
involves cascading changes in many other files including the change of
parameters in GpuChannelMsg_CreateCommandBuffer and
GpuCommandBufferMsg_RegisterTransferBuffer ipc messages.

Bug: 861844
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;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I7c7afecd9fbf6d268ed72233f2e85a6f2d93da51
Reviewed-on: https://chromium-review.googlesource.com/1127948
Commit-Queue: Alexandr Ilin <[email protected]>
Reviewed-by: Antoine Labour <[email protected]>
Reviewed-by: Raymes Khoury <[email protected]>
Reviewed-by: Robert Sesek <[email protected]>
Cr-Commit-Position: refs/heads/master@{#574872}
diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.h b/content/renderer/pepper/ppb_graphics_3d_impl.h
index 396faa7e..389d291 100644
--- a/content/renderer/pepper/ppb_graphics_3d_impl.h
+++ b/content/renderer/pepper/ppb_graphics_3d_impl.h
@@ -10,7 +10,7 @@
 #include <memory>
 
 #include "base/macros.h"
-#include "base/memory/shared_memory.h"
+#include "base/memory/unsafe_shared_memory_region.h"
 #include "base/memory/weak_ptr.h"
 #include "gpu/command_buffer/client/gpu_control_client.h"
 #include "gpu/command_buffer/common/command_buffer_id.h"
@@ -30,12 +30,13 @@
 class PPB_Graphics3D_Impl : public ppapi::PPB_Graphics3D_Shared,
                             public gpu::GpuControlClient {
  public:
-  static PP_Resource CreateRaw(PP_Instance instance,
-                               PP_Resource share_context,
-                               const gpu::ContextCreationAttribs& attrib_helper,
-                               gpu::Capabilities* capabilities,
-                               base::SharedMemoryHandle* shared_state_handle,
-                               gpu::CommandBufferId* command_buffer_id);
+  static PP_Resource CreateRaw(
+      PP_Instance instance,
+      PP_Resource share_context,
+      const gpu::ContextCreationAttribs& attrib_helper,
+      gpu::Capabilities* capabilities,
+      const base::UnsafeSharedMemoryRegion** shared_state_region,
+      gpu::CommandBufferId* command_buffer_id);
 
   // PPB_Graphics3D_API trusted implementation.
   PP_Bool SetGetBuffer(int32_t transfer_buffer_id) override;
@@ -82,7 +83,7 @@
   bool InitRaw(PPB_Graphics3D_API* share_context,
                const gpu::ContextCreationAttribs& requested_attribs,
                gpu::Capabilities* capabilities,
-               base::SharedMemoryHandle* shared_state_handle,
+               const base::UnsafeSharedMemoryRegion** shared_state_region,
                gpu::CommandBufferId* command_buffer_id);
 
   // GpuControlClient implementation.