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

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

Issue 1532813002: Replace IOSurfaceManager by directly passing IOSurface Mach ports over Chrome IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 11 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/browser/in_process_io_surface_manager_mac.h"
6
7 #include "base/logging.h"
8
9 namespace content {
10
11 // static
12 InProcessIOSurfaceManager* InProcessIOSurfaceManager::GetInstance() {
13 return base::Singleton<
14 InProcessIOSurfaceManager,
15 base::LeakySingletonTraits<InProcessIOSurfaceManager>>::get();
16 }
17
18 bool InProcessIOSurfaceManager::RegisterIOSurface(
19 gfx::IOSurfaceId io_surface_id,
20 int client_id,
21 IOSurfaceRef io_surface) {
22 base::AutoLock lock(lock_);
23
24 DCHECK(io_surfaces_.find(io_surface_id) == io_surfaces_.end());
25 io_surfaces_.add(io_surface_id,
26 make_scoped_ptr(new base::mac::ScopedMachSendRight(
27 IOSurfaceCreateMachPort(io_surface))));
28 return true;
29 }
30
31 void InProcessIOSurfaceManager::UnregisterIOSurface(
32 gfx::IOSurfaceId io_surface_id,
33 int client_id) {
34 base::AutoLock lock(lock_);
35
36 DCHECK(io_surfaces_.find(io_surface_id) != io_surfaces_.end());
37 io_surfaces_.erase(io_surface_id);
38 }
39
40 IOSurfaceRef InProcessIOSurfaceManager::AcquireIOSurface(
41 gfx::IOSurfaceId io_surface_id) {
42 base::AutoLock lock(lock_);
43
44 DCHECK(io_surfaces_.find(io_surface_id) != io_surfaces_.end());
45 return IOSurfaceLookupFromMachPort(io_surfaces_.get(io_surface_id)->get());
46 }
47
48 InProcessIOSurfaceManager::InProcessIOSurfaceManager() {
49 }
50
51 InProcessIOSurfaceManager::~InProcessIOSurfaceManager() {
52 }
53
54 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/in_process_io_surface_manager_mac.h ('k') | content/browser/renderer_host/render_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698