Index: chrome/browser/net/referrer.cc |
diff --git a/chrome/browser/net/referrer.cc b/chrome/browser/net/referrer.cc |
index 50e7c542d066bce74a9d80de80aaaa58facbefb5..b72b6f2766e6bac6d9402f88dc68e36916739e69 100644 |
--- a/chrome/browser/net/referrer.cc |
+++ b/chrome/browser/net/referrer.cc |
@@ -12,6 +12,7 @@ |
#include "base/compiler_specific.h" |
#include "base/logging.h" |
+#include "base/memory/ptr_util.h" |
#include "base/message_loop/message_loop.h" |
#include "base/values.h" |
#include "chrome/browser/net/predictor.h" |
@@ -132,16 +133,11 @@ void Referrer::Deserialize(const base::Value& value) { |
} |
} |
-base::Value* Referrer::Serialize() const { |
- base::ListValue* subresource_list(new base::ListValue); |
+std::unique_ptr<base::ListValue> Referrer::Serialize() const { |
+ auto subresource_list = base::MakeUnique<base::ListValue>(); |
for (const_iterator it = begin(); it != end(); ++it) { |
- std::unique_ptr<base::StringValue> url_spec( |
- new base::StringValue(it->first.spec())); |
- std::unique_ptr<base::FundamentalValue> rate( |
- new base::FundamentalValue(it->second.subresource_use_rate())); |
- |
- subresource_list->Append(std::move(url_spec)); |
- subresource_list->Append(std::move(rate)); |
+ subresource_list->AppendString(it->first.spec()); |
+ subresource_list->AppendDouble(it->second.subresource_use_rate()); |
} |
return subresource_list; |
} |