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

Unified Diff: third_party/WebKit/Source/core/style/MemberCopy.h

Issue 2926053002: Make RareNonInheritedData use MemberCopy and DataEquivalent. (Closed)
Patch Set: Rebase Created 3 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
Index: third_party/WebKit/Source/core/style/MemberCopy.h
diff --git a/third_party/WebKit/Source/core/style/MemberCopy.h b/third_party/WebKit/Source/core/style/MemberCopy.h
index 93631e8109743eb38fe64c4a4fe431ed3c8db519..4fef934f9171108001a020e89bd0c7a1216bdf37 100644
--- a/third_party/WebKit/Source/core/style/MemberCopy.h
+++ b/third_party/WebKit/Source/core/style/MemberCopy.h
@@ -5,6 +5,10 @@
#ifndef MemberCopy_h
#define MemberCopy_h
+#include <memory>
+#include "core/style/ContentData.h"
+#include "core/style/DataPersistent.h"
+#include "core/style/DataRef.h"
#include "platform/heap/Persistent.h"
#include "platform/wtf/RefPtr.h"
@@ -20,6 +24,27 @@ Persistent<T> MemberCopy(const Persistent<T>& v) {
return v;
}
+template <typename T>
+std::unique_ptr<T> MemberCopy(const std::unique_ptr<T>& v) {
+ return v ? v->Clone() : nullptr;
+}
+
+template <typename T>
+DataPersistent<T> MemberCopy(const DataPersistent<T>& v) {
+ return v;
+}
+
+// TODO(shend): Remove this once all subgroups of StyleRareNonInheritedData are
+// generated
+template <typename T>
+DataRef<T> MemberCopy(const DataRef<T>& v) {
+ return v;
+}
+
+inline Persistent<ContentData> MemberCopy(const Persistent<ContentData>& v) {
+ return v ? v->Clone() : nullptr;
+}
+
} // namespace blink
#endif // MemberCopy_h

Powered by Google App Engine
This is Rietveld 408576698