| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 return IOSurfaceLookupFromMachPort(scoped_io_surface_right); | 143 return IOSurfaceLookupFromMachPort(scoped_io_surface_right); |
| 143 } | 144 } |
| 144 | 145 |
| 145 ChildIOSurfaceManager::ChildIOSurfaceManager() | 146 ChildIOSurfaceManager::ChildIOSurfaceManager() |
| 146 : set_token_event_(true, false) {} | 147 : set_token_event_(true, false) {} |
| 147 | 148 |
| 148 ChildIOSurfaceManager::~ChildIOSurfaceManager() { | 149 ChildIOSurfaceManager::~ChildIOSurfaceManager() { |
| 149 } | 150 } |
| 150 | 151 |
| 151 } // namespace content | 152 } // namespace content |
| OLD | NEW |