summaryrefslogtreecommitdiffstats
path: root/content/child
diff options
context:
space:
mode:
authormark <mark@chromium.org>2015-10-20 11:36:13 -0700
committerCommit bot <commit-bot@chromium.org>2015-10-20 18:37:12 +0000
commitda902e18a4d31bc1d1534f85ab6cf30b4c4bcdfc (patch)
treed7e4440cd4ef743e4302ee7908a921be0e2b1ec2 /content/child
parent220c73916470009f4b408fc15aa91fa5bf8d0df8 (diff)
downloadchromium_src-da902e18a4d31bc1d1534f85ab6cf30b4c4bcdfc.zip
chromium_src-da902e18a4d31bc1d1534f85ab6cf30b4c4bcdfc.tar.gz
chromium_src-da902e18a4d31bc1d1534f85ab6cf30b4c4bcdfc.tar.bz2
mac: Make Mach port scopers better ScopedGenerics
Previously, Pass() did not work correctly for ScopedMachReceiveRight, ScopedMachSendRight, or ScopedMachPortSet. These were defined as subclasses of ScopedGeneric<> with appropriate traits types. They did not have the full range of constructors made available by ScopedGeneric<>, and their Pass() methods referred to their ScopedGeneric<> superclass rather than their proper class types. This changes these scopers to work as ScopedGeneric<> intends, with a "using" or "typedef" declaration, so that names such as ScopedMachReceiveRight actually refer to the same type as the underlying ScopedGeneric<>. This allows Pass() and all other ScopedGeneric<> functionality to work as intended. Unfortunately, ScopedGeneric<> doesn't provide a type conversion operator to the underlying wrapped type, so many use sites need to be transformed to use the get() accessor. Many existing use sites already used this accessor. Review URL: https://codereview.chromium.org/1411523006 Cr-Commit-Position: refs/heads/master@{#355112}
Diffstat (limited to 'content/child')
-rw-r--r--content/child/child_io_surface_manager_mac.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/content/child/child_io_surface_manager_mac.cc b/content/child/child_io_surface_manager_mac.cc
index 883defe..063fe4c 100644
--- a/content/child/child_io_surface_manager_mac.cc
+++ b/content/child/child_io_surface_manager_mac.cc
@@ -45,12 +45,12 @@ bool ChildIOSurfaceManager::RegisterIOSurface(IOSurfaceId io_surface_id,
data.request.header.msgh_bits =
MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, MACH_MSG_TYPE_MAKE_SEND_ONCE) |
MACH_MSGH_BITS_COMPLEX;
- data.request.header.msgh_remote_port = service_port_;
+ data.request.header.msgh_remote_port = service_port_.get();
data.request.header.msgh_local_port = reply_port;
data.request.header.msgh_size = sizeof(data.request);
data.request.header.msgh_id = IOSurfaceManagerHostMsg_RegisterIOSurface::ID;
data.request.body.msgh_descriptor_count = 1;
- data.request.io_surface_port.name = scoped_io_surface_right;
+ data.request.io_surface_port.name = scoped_io_surface_right.get();
data.request.io_surface_port.disposition = MACH_MSG_TYPE_COPY_SEND;
data.request.io_surface_port.type = MACH_MSG_PORT_DESCRIPTOR;
data.request.io_surface_id = io_surface_id.id;
@@ -75,7 +75,7 @@ void ChildIOSurfaceManager::UnregisterIOSurface(IOSurfaceId io_surface_id,
IOSurfaceManagerHostMsg_UnregisterIOSurface request = {{0}};
request.header.msgh_bits = MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, 0);
- request.header.msgh_remote_port = service_port_;
+ request.header.msgh_remote_port = service_port_.get();
request.header.msgh_local_port = MACH_PORT_NULL;
request.header.msgh_size = sizeof(request);
request.header.msgh_id = IOSurfaceManagerHostMsg_UnregisterIOSurface::ID;
@@ -114,7 +114,7 @@ IOSurfaceRef ChildIOSurfaceManager::AcquireIOSurface(
} data = {{{0}}};
data.request.header.msgh_bits =
MACH_MSGH_BITS(MACH_MSG_TYPE_COPY_SEND, MACH_MSG_TYPE_MAKE_SEND_ONCE);
- data.request.header.msgh_remote_port = service_port_;
+ data.request.header.msgh_remote_port = service_port_.get();
data.request.header.msgh_local_port = reply_port;
data.request.header.msgh_size = sizeof(data.request);
data.request.header.msgh_id = IOSurfaceManagerHostMsg_AcquireIOSurface::ID;
@@ -137,7 +137,7 @@ IOSurfaceRef ChildIOSurfaceManager::AcquireIOSurface(
base::mac::ScopedMachSendRight scoped_io_surface_right(
data.reply.msg.io_surface_port.name);
- return IOSurfaceLookupFromMachPort(scoped_io_surface_right);
+ return IOSurfaceLookupFromMachPort(scoped_io_surface_right.get());
}
ChildIOSurfaceManager::ChildIOSurfaceManager() {}