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

Unified Diff: mojo/public/cpp/bindings/lib/clone_equals_util.h

Issue 2686763002: [Mojo Video Capture] Split OnIncomingCapturedVideoFrame() to OnNewBuffer() and OnFrameReadyInBuffer( (Closed)
Patch Set: Remove unused bool accidentally introduced in PS2 Created 3 years, 10 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: 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);

Powered by Google App Engine
This is Rietveld 408576698