Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(54)

Unified Diff: base/scoped_nsobject.h

Issue 2835007: Revert 49984 - patch from issue 2762014 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/mach_ipc_mac.h ('k') | chrome/browser/autocomplete/autocomplete_edit_view_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/scoped_nsobject.h
===================================================================
--- base/scoped_nsobject.h (revision 49999)
+++ base/scoped_nsobject.h (working copy)
@@ -48,9 +48,14 @@
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_;
}
@@ -80,23 +85,6 @@
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> {
@@ -121,9 +109,14 @@
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_;
}
« no previous file with comments | « base/mach_ipc_mac.h ('k') | chrome/browser/autocomplete/autocomplete_edit_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698