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

Unified Diff: base/mac/scoped_nsobject.h

Issue 862133002: Update from https://crrev.com/312398 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
Index: base/mac/scoped_nsobject.h
diff --git a/base/mac/scoped_nsobject.h b/base/mac/scoped_nsobject.h
index 8d7bd4a27bd37c2844704e8beb2f0ef3bb849469..8814b51439b6f76e96e3e235bb620438009cdc50 100644
--- a/base/mac/scoped_nsobject.h
+++ b/base/mac/scoped_nsobject.h
@@ -40,6 +40,11 @@ class scoped_nsprotocol {
: object_([that.object_ retain]) {
}
+ template <typename NSU>
+ scoped_nsprotocol(const scoped_nsprotocol<NSU>& that)
+ : object_([that.get() retain]) {
+ }
+
~scoped_nsprotocol() {
[object_ release];
}
@@ -119,6 +124,11 @@ class scoped_nsobject : public scoped_nsprotocol<NST*> {
: scoped_nsprotocol<NST*>(that) {
}
+ template<typename NSU>
+ scoped_nsobject(const scoped_nsobject<NSU>& that)
+ : scoped_nsprotocol<NST*>(that) {
+ }
+
scoped_nsobject& operator=(const scoped_nsobject<NST>& that) {
scoped_nsprotocol<NST*>::operator=(that);
return *this;
@@ -135,6 +145,11 @@ class scoped_nsobject<id> : public scoped_nsprotocol<id> {
: scoped_nsprotocol<id>(that) {
}
+ template<typename NSU>
+ scoped_nsobject(const scoped_nsobject<NSU>& that)
+ : scoped_nsprotocol<id>(that) {
+ }
+
scoped_nsobject& operator=(const scoped_nsobject<id>& that) {
scoped_nsprotocol<id>::operator=(that);
return *this;
« no previous file with comments | « base/mac/cocoa_protocols.h ('k') | base/mac/sdk_forward_declarations.h » ('j') | shell/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698