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

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

Issue 1171293005: Revert of content: Single process support for native GpuMemoryBuffers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@dm-browsertests-refactor
Patch Set: Created 5 years, 6 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 Singleton<InProcessIOSurfaceManager,
14 LeakySingletonTraits<InProcessIOSurfaceManager>>::get();
15 }
16
17 bool InProcessIOSurfaceManager::RegisterIOSurface(int io_surface_id,
18 int client_id,
19 IOSurfaceRef io_surface) {
20 base::AutoLock lock(lock_);
21
22 DCHECK(io_surfaces_.find(io_surface_id) == io_surfaces_.end());
23 io_surfaces_.add(io_surface_id,
24 make_scoped_ptr(new base::mac::ScopedMachSendRight(
25 IOSurfaceCreateMachPort(io_surface))));
26 return true;
27 }
28
29 void InProcessIOSurfaceManager::UnregisterIOSurface(int io_surface_id,
30 int client_id) {
31 base::AutoLock lock(lock_);
32
33 DCHECK(io_surfaces_.find(io_surface_id) != io_surfaces_.end());
34 io_surfaces_.erase(io_surface_id);
35 }
36
37 IOSurfaceRef InProcessIOSurfaceManager::AcquireIOSurface(int io_surface_id) {
38 base::AutoLock lock(lock_);
39
40 DCHECK(io_surfaces_.find(io_surface_id) != io_surfaces_.end());
41 return IOSurfaceLookupFromMachPort(io_surfaces_.get(io_surface_id)->get());
42 }
43
44 InProcessIOSurfaceManager::InProcessIOSurfaceManager() {
45 }
46
47 InProcessIOSurfaceManager::~InProcessIOSurfaceManager() {
48 }
49
50 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/in_process_io_surface_manager_mac.h ('k') | content/child/child_thread_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698