Index: mojo/public/cpp/bindings/lib/clone_equals_util.h |
diff --git a/mojo/public/cpp/bindings/lib/clone_equals_util.h b/mojo/public/cpp/bindings/lib/clone_equals_util.h |
index f7bd898c3001c4e8e086d4e8408411061ad9248b..e9628c45ae3b4bdce8ccd937b029deb80788c630 100644 |
--- a/mojo/public/cpp/bindings/lib/clone_equals_util.h |
+++ b/mojo/public/cpp/bindings/lib/clone_equals_util.h |
@@ -5,11 +5,14 @@ |
#ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_CLONE_EQUALS_UTIL_H_ |
#define MOJO_PUBLIC_CPP_BINDINGS_LIB_CLONE_EQUALS_UTIL_H_ |
+#include <memory> |
#include <type_traits> |
#include <unordered_map> |
#include <vector> |
+#include "base/memory/ptr_util.h" |
#include "base/optional.h" |
+#include "base/values.h" |
#include "mojo/public/cpp/bindings/lib/template_util.h" |
namespace mojo { |
@@ -77,6 +80,16 @@ struct CloneTraits<std::unordered_map<K, V>, false> { |
} |
}; |
+template <> |
+struct CloneTraits<std::unique_ptr<base::DictionaryValue>, false> { |
+ static std::unique_ptr<base::DictionaryValue> Clone( |
+ const std::unique_ptr<base::DictionaryValue>& input) { |
+ auto result = base::MakeUnique<base::DictionaryValue>(); |
+ result->MergeDictionary(input.get()); |
+ return result; |
+ } |
+}; |
+ |
template <typename T> |
T Clone(const T& input) { |
return CloneTraits<T>::Clone(input); |