OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "services/ui/public/cpp/gpu/gpu.h" | 5 #include "services/ui/public/cpp/gpu/gpu.h" |
6 | 6 |
| 7 #include "base/memory/ptr_util.h" |
7 #include "base/threading/thread_task_runner_handle.h" | 8 #include "base/threading/thread_task_runner_handle.h" |
8 #include "build/build_config.h" | 9 #include "build/build_config.h" |
9 #include "mojo/public/cpp/bindings/sync_call_restrictions.h" | 10 #include "mojo/public/cpp/bindings/sync_call_restrictions.h" |
10 #include "mojo/public/cpp/system/platform_handle.h" | 11 #include "mojo/public/cpp/system/platform_handle.h" |
11 #include "services/service_manager/public/cpp/connector.h" | 12 #include "services/service_manager/public/cpp/connector.h" |
12 #include "services/ui/public/cpp/gpu/client_gpu_memory_buffer_manager.h" | 13 #include "services/ui/public/cpp/gpu/client_gpu_memory_buffer_manager.h" |
13 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" | 14 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" |
14 #include "services/ui/public/interfaces/constants.mojom.h" | 15 #include "services/ui/public/interfaces/constants.mojom.h" |
15 #include "services/ui/public/interfaces/gpu.mojom.h" | 16 #include "services/ui/public/interfaces/gpu.mojom.h" |
16 | 17 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 MojoResult result = mojo::UnwrapSharedMemoryHandle( | 183 MojoResult result = mojo::UnwrapSharedMemoryHandle( |
183 std::move(handle), &platform_handle, &shared_memory_size, &readonly); | 184 std::move(handle), &platform_handle, &shared_memory_size, &readonly); |
184 if (result != MOJO_RESULT_OK) | 185 if (result != MOJO_RESULT_OK) |
185 return nullptr; | 186 return nullptr; |
186 DCHECK_EQ(shared_memory_size, size); | 187 DCHECK_EQ(shared_memory_size, size); |
187 | 188 |
188 return base::MakeUnique<base::SharedMemory>(platform_handle, readonly); | 189 return base::MakeUnique<base::SharedMemory>(platform_handle, readonly); |
189 } | 190 } |
190 | 191 |
191 } // namespace ui | 192 } // namespace ui |
OLD | NEW |