diff options
author | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-16 18:25:46 +0000 |
---|---|---|
committer | thakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-16 18:25:46 +0000 |
commit | 84f78468c2d465279280bc2061c4d019ad765a48 (patch) | |
tree | c64f343a73212b9cdaa016fdf0e6d320c6084a3f /base | |
parent | c5a6ff1451d50cf5649b1920066331daefcc690b (diff) | |
download | chromium_src-84f78468c2d465279280bc2061c4d019ad765a48.zip chromium_src-84f78468c2d465279280bc2061c4d019ad765a48.tar.gz chromium_src-84f78468c2d465279280bc2061c4d019ad765a48.tar.bz2 |
patch from issue 2762014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49984 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/mach_ipc_mac.h | 7 | ||||
-rw-r--r-- | base/scoped_nsobject.h | 35 |
2 files changed, 25 insertions, 17 deletions
diff --git a/base/mach_ipc_mac.h b/base/mach_ipc_mac.h index 1e88279..13fc5f4 100644 --- a/base/mach_ipc_mac.h +++ b/base/mach_ipc_mac.h @@ -115,9 +115,10 @@ class MachMsgPortDescriptor : public mach_msg_port_descriptor_t { // We're just a simple wrapper for mach_msg_port_descriptor_t // and have the same memory layout - operator mach_msg_port_descriptor_t&() { - return *this; - } +// FIXME + //operator mach_msg_port_descriptor_t&() { + //return *this; + //} // For convenience operator mach_port_t() const { diff --git a/base/scoped_nsobject.h b/base/scoped_nsobject.h index bde2753..7e544c9 100644 --- a/base/scoped_nsobject.h +++ b/base/scoped_nsobject.h @@ -48,13 +48,8 @@ class scoped_nsobject { object_ = object; } - bool operator==(NST* that) const { - return object_ == that; - } - - bool operator!=(NST* that) const { - return object_ != that; - } + bool operator==(NST* that) const { return object_ == that; } + bool operator!=(NST* that) const { return object_ != that; } operator NST*() const { return object_; @@ -85,6 +80,23 @@ class scoped_nsobject { DISALLOW_COPY_AND_ASSIGN(scoped_nsobject); }; +// Free functions +template <class C> +void swap(scoped_nsobject<C>& p1, scoped_nsobject<C>& p2) { + p1.swap(p2); +} + +template <class C> +bool operator==(C* p1, const scoped_nsobject<C>& p2) { + return p1 == p2.get(); +} + +template <class C> +bool operator!=(C* p1, const scoped_nsobject<C>& p2) { + return p1 != p2.get(); +} + + // Specialization to make scoped_nsobject<id> work. template<> class scoped_nsobject<id> { @@ -109,13 +121,8 @@ class scoped_nsobject<id> { object_ = object; } - bool operator==(id that) const { - return object_ == that; - } - - bool operator!=(id that) const { - return object_ != that; - } + bool operator==(id that) const { return object_ == that; } + bool operator!=(id that) const { return object_ != that; } operator id() const { return object_; |