| 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/browser_io_surface_manager_mac.h" | 5 #include "content/browser/browser_io_surface_manager_mac.h" |
| 6 | 6 |
| 7 #include <servers/bootstrap.h> | 7 #include <servers/bootstrap.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 pid); | 24 pid); |
| 25 } | 25 } |
| 26 | 26 |
| 27 // Amount of time to wait before giving up when sending a reply message. | 27 // Amount of time to wait before giving up when sending a reply message. |
| 28 const int kSendReplyTimeoutMs = 100; | 28 const int kSendReplyTimeoutMs = 100; |
| 29 | 29 |
| 30 } // namespace | 30 } // namespace |
| 31 | 31 |
| 32 // static | 32 // static |
| 33 BrowserIOSurfaceManager* BrowserIOSurfaceManager::GetInstance() { | 33 BrowserIOSurfaceManager* BrowserIOSurfaceManager::GetInstance() { |
| 34 return Singleton<BrowserIOSurfaceManager, | 34 return base::Singleton< |
| 35 LeakySingletonTraits<BrowserIOSurfaceManager>>::get(); | 35 BrowserIOSurfaceManager, |
| 36 base::LeakySingletonTraits<BrowserIOSurfaceManager>>::get(); |
| 36 } | 37 } |
| 37 | 38 |
| 38 // static | 39 // static |
| 39 base::mac::ScopedMachSendRight BrowserIOSurfaceManager::LookupServicePort( | 40 base::mac::ScopedMachSendRight BrowserIOSurfaceManager::LookupServicePort( |
| 40 pid_t pid) { | 41 pid_t pid) { |
| 41 // Look up the named IOSurfaceManager port that's been registered with | 42 // Look up the named IOSurfaceManager port that's been registered with |
| 42 // the bootstrap server. | 43 // the bootstrap server. |
| 43 mach_port_t port; | 44 mach_port_t port; |
| 44 kern_return_t kr = | 45 kern_return_t kr = |
| 45 bootstrap_look_up(bootstrap_port, GetMachPortName(pid).c_str(), &port); | 46 bootstrap_look_up(bootstrap_port, GetMachPortName(pid).c_str(), &port); |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 } | 302 } |
| 302 | 303 |
| 303 reply->body.msgh_descriptor_count = 1; | 304 reply->body.msgh_descriptor_count = 1; |
| 304 reply->io_surface_port.name = it->second->get(); | 305 reply->io_surface_port.name = it->second->get(); |
| 305 reply->io_surface_port.disposition = MACH_MSG_TYPE_COPY_SEND; | 306 reply->io_surface_port.disposition = MACH_MSG_TYPE_COPY_SEND; |
| 306 reply->io_surface_port.type = MACH_MSG_PORT_DESCRIPTOR; | 307 reply->io_surface_port.type = MACH_MSG_PORT_DESCRIPTOR; |
| 307 return true; | 308 return true; |
| 308 } | 309 } |
| 309 | 310 |
| 310 } // namespace content | 311 } // namespace content |
| OLD | NEW |