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

Unified Diff: base/android/scoped_java_ref.h

Issue 1535713002: Give ScopedJavaGlobalRef copy and assignment constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/scoped_java_ref.h
diff --git a/base/android/scoped_java_ref.h b/base/android/scoped_java_ref.h
index e15ad661e2d85f34a129c5a0a674cc2b847ff94f..da5a020eaa4b53cfabf6b04926727b2292a5f899 100644
--- a/base/android/scoped_java_ref.h
+++ b/base/android/scoped_java_ref.h
@@ -227,7 +227,7 @@ class ScopedJavaGlobalRef : public JavaRef<T> {
public:
ScopedJavaGlobalRef() {}
- explicit ScopedJavaGlobalRef(const ScopedJavaGlobalRef<T>& other) {
+ ScopedJavaGlobalRef(const ScopedJavaGlobalRef<T>& other) {
this->Reset(other);
}
@@ -242,6 +242,12 @@ class ScopedJavaGlobalRef : public JavaRef<T> {
this->Reset();
}
+ // Overloaded assignment operator defined for consistency with the implicit
+ // copy constructor.
+ void operator=(const ScopedJavaGlobalRef<T>& other) {
+ this->Reset(other);
+ }
+
void Reset() {
this->ResetGlobalRef();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698