diff options
author | mark <mark@chromium.org> | 2015-10-20 11:36:13 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-10-20 18:37:12 +0000 |
commit | da902e18a4d31bc1d1534f85ab6cf30b4c4bcdfc (patch) | |
tree | d7e4440cd4ef743e4302ee7908a921be0e2b1ec2 /base/sys_info_mac.cc | |
parent | 220c73916470009f4b408fc15aa91fa5bf8d0df8 (diff) | |
download | chromium_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 'base/sys_info_mac.cc')
-rw-r--r-- | base/sys_info_mac.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/base/sys_info_mac.cc b/base/sys_info_mac.cc index 18df624..025c768 100644 --- a/base/sys_info_mac.cc +++ b/base/sys_info_mac.cc @@ -46,7 +46,7 @@ int64 SysInfo::AmountOfPhysicalMemory() { struct host_basic_info hostinfo; mach_msg_type_number_t count = HOST_BASIC_INFO_COUNT; base::mac::ScopedMachSendRight host(mach_host_self()); - int result = host_info(host, + int result = host_info(host.get(), HOST_BASIC_INFO, reinterpret_cast<host_info_t>(&hostinfo), &count); |