Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: content/browser/browser_io_surface_manager_mac.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/browser/browser_io_surface_manager_mac.h ('k') | content/browser/browser_url_handler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698