Chromium Code Reviews| 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..671e49b2943759692f321f4c62f06f0bcabaf919 100644 |
| --- a/third_party/WebKit/Source/platform/wtf/RefCounted.h |
| +++ b/third_party/WebKit/Source/platform/wtf/RefCounted.h |
| @@ -164,8 +164,19 @@ class RefCounted : public RefCountedBase { |
| #endif |
| }; |
| +// Unlike subclasses of RefCounted where the copy constructor must be |
| +// handwritten, subclasses of RefCountedCopyable can use the default |
| +// compiler-generated copy constructor. |
|
alancutter (OOO until 2018)
2017/04/03 12:07:45
This wording is a bit too fancy. For speed of read
|
| +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 |