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

Side by Side Diff: content/child/child_io_surface_manager_mac.cc

Issue 1248713002: ozone: ClientPixmapManager passes VGEM fd from browser to renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rollback to use PlatformThreadRef Created 5 years, 4 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
« no previous file with comments | « content/child/child_io_surface_manager_mac.h ('k') | content/child/child_thread_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/child/child_io_surface_manager_mac.h" 5 #include "content/child/child_io_surface_manager_mac.h"
6 6
7 #include "base/mac/mach_logging.h" 7 #include "base/mac/mach_logging.h"
8 #include "content/common/mac/io_surface_manager_messages.h" 8 #include "content/common/mac/io_surface_manager_messages.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 MACH_LOG(ERROR, kr) << "mach_msg"; 89 MACH_LOG(ERROR, kr) << "mach_msg";
90 } 90 }
91 } 91 }
92 92
93 IOSurfaceRef ChildIOSurfaceManager::AcquireIOSurface(int io_surface_id) { 93 IOSurfaceRef ChildIOSurfaceManager::AcquireIOSurface(int io_surface_id) {
94 DCHECK(service_port_.is_valid()); 94 DCHECK(service_port_.is_valid());
95 95
96 // A valid token is required to acquire an IOSurface. This will wait for a 96 // A valid token is required to acquire an IOSurface. This will wait for a
97 // valid token if one has not yet been set. 97 // valid token if one has not yet been set.
98 set_token_event_.Wait(); 98 set_token_event_.Wait();
99 #if !defined(NDEBUG) 99 #if DCHECK_IS_ON()
100 DCHECK(!(set_token_thread_id_ == base::PlatformThread::CurrentRef())); 100 DCHECK(!(set_token_thread_id_ == base::PlatformThread::CurrentRef()));
dshwang 2015/08/18 16:15:34 I rollback to PlatformThreadRef. I don't use base:
101 #endif 101 #endif
102 DCHECK(!token_.IsZero()); 102 DCHECK(!token_.IsZero());
103 103
104 mach_port_t reply_port; 104 mach_port_t reply_port;
105 kern_return_t kr = mach_port_allocate(mach_task_self(), 105 kern_return_t kr = mach_port_allocate(mach_task_self(),
106 MACH_PORT_RIGHT_RECEIVE, &reply_port); 106 MACH_PORT_RIGHT_RECEIVE, &reply_port);
107 if (kr != KERN_SUCCESS) { 107 if (kr != KERN_SUCCESS) {
108 MACH_LOG(ERROR, kr) << "mach_port_allocate"; 108 MACH_LOG(ERROR, kr) << "mach_port_allocate";
109 return nullptr; 109 return nullptr;
110 } 110 }
(...skipping 30 matching lines...) Expand all
141 return IOSurfaceLookupFromMachPort(scoped_io_surface_right); 141 return IOSurfaceLookupFromMachPort(scoped_io_surface_right);
142 } 142 }
143 143
144 ChildIOSurfaceManager::ChildIOSurfaceManager() 144 ChildIOSurfaceManager::ChildIOSurfaceManager()
145 : set_token_event_(true, false) {} 145 : set_token_event_(true, false) {}
146 146
147 ChildIOSurfaceManager::~ChildIOSurfaceManager() { 147 ChildIOSurfaceManager::~ChildIOSurfaceManager() {
148 } 148 }
149 149
150 } // namespace content 150 } // namespace content
OLDNEW
« no previous file with comments | « content/child/child_io_surface_manager_mac.h ('k') | content/child/child_thread_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698