Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 122 memcpy(data.request.token_name, token_.name, sizeof(token_.name)); | 122 memcpy(data.request.token_name, token_.name, sizeof(token_.name)); |
| 123 | 123 |
| 124 kr = mach_msg(&data.request.header, MACH_SEND_MSG | MACH_RCV_MSG, | 124 kr = mach_msg(&data.request.header, MACH_SEND_MSG | MACH_RCV_MSG, |
| 125 sizeof(data.request), sizeof(data.reply), reply_port, | 125 sizeof(data.request), sizeof(data.reply), reply_port, |
| 126 MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); | 126 MACH_MSG_TIMEOUT_NONE, MACH_PORT_NULL); |
| 127 if (kr != KERN_SUCCESS) { | 127 if (kr != KERN_SUCCESS) { |
| 128 MACH_LOG(ERROR, kr) << "mach_msg"; | 128 MACH_LOG(ERROR, kr) << "mach_msg"; |
| 129 return nullptr; | 129 return nullptr; |
| 130 } | 130 } |
| 131 | 131 |
| 132 // Crash the renderer (for now) to see if this was the cause of renderer hangs | |
| 133 // that have recently been noticed. | |
| 134 // http://crbug.com/532149 | |
| 135 CHECK(data.reply.msg.result); | |
| 136 if (!data.reply.msg.result) { | |
|
reveman
2015/09/18 18:22:30
nit: this if-statement seems unnecessary with the
ccameron
2015/09/18 18:36:00
Removed for now.
| |
| 137 LOG(ERROR) << "AcquireIOSurface returned failure!"; | |
| 138 return nullptr; | |
| 139 } | |
| 140 | |
| 132 // Deallocate the right after creating an IOSurface reference. | 141 // Deallocate the right after creating an IOSurface reference. |
| 133 base::mac::ScopedMachSendRight scoped_io_surface_right( | 142 base::mac::ScopedMachSendRight scoped_io_surface_right( |
| 134 data.reply.msg.io_surface_port.name); | 143 data.reply.msg.io_surface_port.name); |
| 135 | 144 |
| 136 return IOSurfaceLookupFromMachPort(scoped_io_surface_right); | 145 return IOSurfaceLookupFromMachPort(scoped_io_surface_right); |
| 137 } | 146 } |
| 138 | 147 |
| 139 ChildIOSurfaceManager::ChildIOSurfaceManager() {} | 148 ChildIOSurfaceManager::ChildIOSurfaceManager() {} |
| 140 | 149 |
| 141 ChildIOSurfaceManager::~ChildIOSurfaceManager() {} | 150 ChildIOSurfaceManager::~ChildIOSurfaceManager() {} |
| 142 | 151 |
| 143 } // namespace content | 152 } // namespace content |
| OLD | NEW |