| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "content/child/child_io_surface_manager_mac.h" | 5 #include "content/child/child_io_surface_manager_mac.h" |
| 6 | 6 |
| 7 #include "base/mac/mach_logging.h" | 7 #include "base/mac/mach_logging.h" |
| 8 #include "content/common/mac/io_surface_manager_messages.h" | 8 #include "content/common/mac/io_surface_manager_messages.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| 11 | 11 |
| 12 // static | 12 // static |
| 13 ChildIOSurfaceManager* ChildIOSurfaceManager::GetInstance() { | 13 ChildIOSurfaceManager* ChildIOSurfaceManager::GetInstance() { |
| 14 return Singleton<ChildIOSurfaceManager, | 14 return base::Singleton< |
| 15 LeakySingletonTraits<ChildIOSurfaceManager>>::get(); | 15 ChildIOSurfaceManager, |
| 16 base::LeakySingletonTraits<ChildIOSurfaceManager>>::get(); |
| 16 } | 17 } |
| 17 | 18 |
| 18 bool ChildIOSurfaceManager::RegisterIOSurface(IOSurfaceId io_surface_id, | 19 bool ChildIOSurfaceManager::RegisterIOSurface(IOSurfaceId io_surface_id, |
| 19 int client_id, | 20 int client_id, |
| 20 IOSurfaceRef io_surface) { | 21 IOSurfaceRef io_surface) { |
| 21 DCHECK(service_port_.is_valid()); | 22 DCHECK(service_port_.is_valid()); |
| 22 DCHECK(!token_.IsZero()); | 23 DCHECK(!token_.IsZero()); |
| 23 | 24 |
| 24 mach_port_t reply_port; | 25 mach_port_t reply_port; |
| 25 kern_return_t kr = mach_port_allocate(mach_task_self(), | 26 kern_return_t kr = mach_port_allocate(mach_task_self(), |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 data.reply.msg.io_surface_port.name); | 134 data.reply.msg.io_surface_port.name); |
| 134 | 135 |
| 135 return IOSurfaceLookupFromMachPort(scoped_io_surface_right); | 136 return IOSurfaceLookupFromMachPort(scoped_io_surface_right); |
| 136 } | 137 } |
| 137 | 138 |
| 138 ChildIOSurfaceManager::ChildIOSurfaceManager() {} | 139 ChildIOSurfaceManager::ChildIOSurfaceManager() {} |
| 139 | 140 |
| 140 ChildIOSurfaceManager::~ChildIOSurfaceManager() {} | 141 ChildIOSurfaceManager::~ChildIOSurfaceManager() {} |
| 141 | 142 |
| 142 } // namespace content | 143 } // namespace content |
| OLD | NEW |