Change StateChangeQueue::NotifyPropertiesUpdated to take const ref

Instead of using std::unique_ptr<>. This simplifies code around the
usage patterns and tests, and causes only one extra copy of the
dictionary in one case.

Change-Id: Ic0d3158116a7be5823078b08f1bf58e1c88c88b7
Reviewed-on: https://weave-review.googlesource.com/1769
Reviewed-by: Vitaly Buka <vitalybuka@google.com>
diff --git a/src/states/state_change_queue.cc b/src/states/state_change_queue.cc
index ba7bf65..b6c67cd 100644
--- a/src/states/state_change_queue.cc
+++ b/src/states/state_change_queue.cc
@@ -16,13 +16,13 @@
 
 bool StateChangeQueue::NotifyPropertiesUpdated(
     base::Time timestamp,
-    std::unique_ptr<base::DictionaryValue> changed_properties) {
+    const base::DictionaryValue& changed_properties) {
   auto& stored_changes = state_changes_[timestamp];
   // Merge the old property set.
   if (stored_changes)
-    stored_changes->MergeDictionary(changed_properties.get());
+    stored_changes->MergeDictionary(&changed_properties);
   else
-    stored_changes = std::move(changed_properties);
+    stored_changes.reset(changed_properties.DeepCopy());
 
   while (state_changes_.size() > max_queue_size_) {
     // Queue is full.