diff options
Diffstat (limited to 'chromium/base/mac')
-rw-r--r-- | chromium/base/mac/foundation_util.mm | 1 | ||||
-rw-r--r-- | chromium/base/mac/mach_port_rendezvous.cc | 1 | ||||
-rw-r--r-- | chromium/base/mac/scoped_mach_vm.h | 2 | ||||
-rw-r--r-- | chromium/base/mac/scoped_typeref.h | 26 |
4 files changed, 16 insertions, 14 deletions
diff --git a/chromium/base/mac/foundation_util.mm b/chromium/base/mac/foundation_util.mm index f37884f6f70..be12912dcd0 100644 --- a/chromium/base/mac/foundation_util.mm +++ b/chromium/base/mac/foundation_util.mm @@ -12,6 +12,7 @@ #include "base/logging.h" #include "base/mac/bundle_locations.h" #include "base/mac/mac_logging.h" +#include "base/notreached.h" #include "base/numerics/safe_conversions.h" #include "base/stl_util.h" #include "base/strings/sys_string_conversions.h" diff --git a/chromium/base/mac/mach_port_rendezvous.cc b/chromium/base/mac/mach_port_rendezvous.cc index 43e5806bec6..7510a49d8a3 100644 --- a/chromium/base/mac/mach_port_rendezvous.cc +++ b/chromium/base/mac/mach_port_rendezvous.cc @@ -16,6 +16,7 @@ #include "base/mac/foundation_util.h" #include "base/mac/mach_logging.h" #include "base/mac/scoped_mach_msg_destroy.h" +#include "base/notreached.h" #include "base/strings/stringprintf.h" namespace base { diff --git a/chromium/base/mac/scoped_mach_vm.h b/chromium/base/mac/scoped_mach_vm.h index 3d4cc022b4b..496a1fa41df 100644 --- a/chromium/base/mac/scoped_mach_vm.h +++ b/chromium/base/mac/scoped_mach_vm.h @@ -11,7 +11,7 @@ #include <algorithm> #include "base/base_export.h" -#include "base/logging.h" +#include "base/check_op.h" #include "base/macros.h" // Use ScopedMachVM to supervise ownership of pages in the current process diff --git a/chromium/base/mac/scoped_typeref.h b/chromium/base/mac/scoped_typeref.h index 3bec05f9ddd..fcfc22d402e 100644 --- a/chromium/base/mac/scoped_typeref.h +++ b/chromium/base/mac/scoped_typeref.h @@ -5,8 +5,8 @@ #ifndef BASE_MAC_SCOPED_TYPEREF_H_ #define BASE_MAC_SCOPED_TYPEREF_H_ +#include "base/check.h" #include "base/compiler_specific.h" -#include "base/logging.h" #include "base/memory/scoped_policy.h" namespace base { @@ -51,10 +51,10 @@ struct ScopedTypeRefTraits; template<typename T, typename Traits = ScopedTypeRefTraits<T>> class ScopedTypeRef { public: - typedef T element_type; + using element_type = T; explicit constexpr ScopedTypeRef( - T object = Traits::InvalidValue(), + element_type object = Traits::InvalidValue(), base::scoped_policy::OwnershipPolicy policy = base::scoped_policy::ASSUME) : object_(object) { if (object_ && policy == base::scoped_policy::RETAIN) @@ -92,12 +92,12 @@ class ScopedTypeRef { // This is to be used only to take ownership of objects that are created // by pass-by-pointer create functions. To enforce this, require that the // object be reset to NULL before this may be used. - T* InitializeInto() WARN_UNUSED_RESULT { + element_type* InitializeInto() WARN_UNUSED_RESULT { DCHECK(!object_); return &object_; } - void reset(T object = Traits::InvalidValue(), + void reset(element_type object = Traits::InvalidValue(), base::scoped_policy::OwnershipPolicy policy = base::scoped_policy::ASSUME) { if (object && policy == base::scoped_policy::RETAIN) @@ -107,16 +107,16 @@ class ScopedTypeRef { object_ = object; } - bool operator==(T that) const { return object_ == that; } + bool operator==(const element_type& that) const { return object_ == that; } - bool operator!=(T that) const { return object_ != that; } + bool operator!=(const element_type& that) const { return object_ != that; } - operator T() const { return object_; } + operator element_type() const { return object_; } - T get() const { return object_; } + element_type get() const { return object_; } void swap(ScopedTypeRef& that) { - T temp = that.object_; + element_type temp = that.object_; that.object_ = object_; object_ = temp; } @@ -124,14 +124,14 @@ class ScopedTypeRef { // ScopedTypeRef<>::release() is like std::unique_ptr<>::release. It is NOT // a wrapper for Release(). To force a ScopedTypeRef<> object to call // Release(), use ScopedTypeRef<>::reset(). - T release() WARN_UNUSED_RESULT { - T temp = object_; + element_type release() WARN_UNUSED_RESULT { + element_type temp = object_; object_ = Traits::InvalidValue(); return temp; } private: - T object_; + element_type object_; }; } // namespace base |