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

Unified Diff: content/child/child_io_surface_manager_mac.cc

Issue 1486873002: Mac: Require child AllocateGpuMemoryBuffer to not fail (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add GPU proc as well Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: content/child/child_io_surface_manager_mac.cc
diff --git a/content/child/child_io_surface_manager_mac.cc b/content/child/child_io_surface_manager_mac.cc
index ebad42ad5b42c1d54322c2f59d5f340235848837..37dc971d30143ac90933dd103433789dafe18187 100644
--- a/content/child/child_io_surface_manager_mac.cc
+++ b/content/child/child_io_surface_manager_mac.cc
@@ -99,10 +99,7 @@ IOSurfaceRef ChildIOSurfaceManager::AcquireIOSurface(
mach_port_t reply_port;
kern_return_t kr = mach_port_allocate(mach_task_self(),
MACH_PORT_RIGHT_RECEIVE, &reply_port);
- if (kr != KERN_SUCCESS) {
- MACH_LOG(ERROR, kr) << "mach_port_allocate";
- return nullptr;
- }
+ CHECK_EQ(KERN_SUCCESS, kr);
base::mac::ScopedMachReceiveRight scoped_receive_right(reply_port);
union {
@@ -124,20 +121,17 @@ IOSurfaceRef ChildIOSurfaceManager::AcquireIOSurface(
kr = mach_msg(&data.request.header, MACH_SEND_MSG | MACH_RCV_MSG,
sizeof(data.request), sizeof(data.reply), reply_port,
MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL);
- if (kr != KERN_SUCCESS) {
- MACH_LOG(ERROR, kr) << "mach_msg";
- return nullptr;
- }
- if (!data.reply.msg.result) {
- DLOG(ERROR) << "Browser refused AcquireIOSurface request";
- return nullptr;
- }
+ CHECK_EQ(KERN_SUCCESS, kr);
+ CHECK(data.reply.msg.result);
// Deallocate the right after creating an IOSurface reference.
base::mac::ScopedMachSendRight scoped_io_surface_right(
data.reply.msg.io_surface_port.name);
- return IOSurfaceLookupFromMachPort(scoped_io_surface_right.get());
+ IOSurfaceRef io_surface =
+ IOSurfaceLookupFromMachPort(scoped_io_surface_right.get());
+ CHECK(io_surface);
+ return io_surface;
}
ChildIOSurfaceManager::ChildIOSurfaceManager() {}

Powered by Google App Engine
This is Rietveld 408576698