| 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/browser/in_process_io_surface_manager_mac.h" | 5 #include "content/browser/in_process_io_surface_manager_mac.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| 11 // static | 11 // static |
| 12 InProcessIOSurfaceManager* InProcessIOSurfaceManager::GetInstance() { | 12 InProcessIOSurfaceManager* InProcessIOSurfaceManager::GetInstance() { |
| 13 return Singleton<InProcessIOSurfaceManager, | 13 return base::Singleton< |
| 14 LeakySingletonTraits<InProcessIOSurfaceManager>>::get(); | 14 InProcessIOSurfaceManager, |
| 15 base::LeakySingletonTraits<InProcessIOSurfaceManager>>::get(); |
| 15 } | 16 } |
| 16 | 17 |
| 17 bool InProcessIOSurfaceManager::RegisterIOSurface(IOSurfaceId io_surface_id, | 18 bool InProcessIOSurfaceManager::RegisterIOSurface(IOSurfaceId io_surface_id, |
| 18 int client_id, | 19 int client_id, |
| 19 IOSurfaceRef io_surface) { | 20 IOSurfaceRef io_surface) { |
| 20 base::AutoLock lock(lock_); | 21 base::AutoLock lock(lock_); |
| 21 | 22 |
| 22 DCHECK(io_surfaces_.find(io_surface_id) == io_surfaces_.end()); | 23 DCHECK(io_surfaces_.find(io_surface_id) == io_surfaces_.end()); |
| 23 io_surfaces_.add(io_surface_id, | 24 io_surfaces_.add(io_surface_id, |
| 24 make_scoped_ptr(new base::mac::ScopedMachSendRight( | 25 make_scoped_ptr(new base::mac::ScopedMachSendRight( |
| (...skipping 17 matching lines...) Expand all Loading... |
| 42 return IOSurfaceLookupFromMachPort(io_surfaces_.get(io_surface_id)->get()); | 43 return IOSurfaceLookupFromMachPort(io_surfaces_.get(io_surface_id)->get()); |
| 43 } | 44 } |
| 44 | 45 |
| 45 InProcessIOSurfaceManager::InProcessIOSurfaceManager() { | 46 InProcessIOSurfaceManager::InProcessIOSurfaceManager() { |
| 46 } | 47 } |
| 47 | 48 |
| 48 InProcessIOSurfaceManager::~InProcessIOSurfaceManager() { | 49 InProcessIOSurfaceManager::~InProcessIOSurfaceManager() { |
| 49 } | 50 } |
| 50 | 51 |
| 51 } // namespace content | 52 } // namespace content |
| OLD | NEW |