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

Unified Diff: third_party/WebKit/Source/platform/wtf/RefCounted.h

Issue 2781313004: Implement RefCountedCopyable<T>. (Closed)
Patch Set: Address comments Created 3 years, 9 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 | « third_party/WebKit/Source/core/style/StyleBoxData.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/wtf/RefCounted.h
diff --git a/third_party/WebKit/Source/platform/wtf/RefCounted.h b/third_party/WebKit/Source/platform/wtf/RefCounted.h
index 357e294e9ac2ebbf1b355cc128c920eb111183d9..d6c6776c6f0101cb274f99705f82bce6b56c049b 100644
--- a/third_party/WebKit/Source/platform/wtf/RefCounted.h
+++ b/third_party/WebKit/Source/platform/wtf/RefCounted.h
@@ -164,8 +164,17 @@ class RefCounted : public RefCountedBase {
#endif
};
+// Allows subclasses to use the default copy constructor.
+template <typename T>
+class RefCountedCopyable : public RefCounted<T> {
+ protected:
+ RefCountedCopyable() = default;
+ RefCountedCopyable(const RefCountedCopyable&) : RefCounted<T>() {}
+};
+
} // namespace WTF
using WTF::RefCounted;
+using WTF::RefCountedCopyable;
#endif // RefCounted_h
« no previous file with comments | « third_party/WebKit/Source/core/style/StyleBoxData.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698