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

Unified Diff: chrome/browser/net/referrer.cc

Issue 2058233002: Rewrite simple uses of base::ListValue::Append() taking a raw pointer var. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: less comments more ownership Created 4 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
« no previous file with comments | « chrome/browser/net/predictor.cc ('k') | chrome/browser/plugins/plugin_prefs.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/referrer.cc
diff --git a/chrome/browser/net/referrer.cc b/chrome/browser/net/referrer.cc
index c85ea8c053f0abbe42008d4c077c4092b6040ae2..2bda242c9cad847910d5e51ef8feb478c5848b60 100644
--- a/chrome/browser/net/referrer.cc
+++ b/chrome/browser/net/referrer.cc
@@ -7,6 +7,9 @@
#include <limits.h>
#include <stddef.h>
+#include <memory>
+#include <utility>
+
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
@@ -149,12 +152,13 @@ void Referrer::Deserialize(const base::Value& value) {
base::Value* Referrer::Serialize() const {
base::ListValue* subresource_list(new base::ListValue);
for (const_iterator it = begin(); it != end(); ++it) {
- base::StringValue* url_spec(new base::StringValue(it->first.spec()));
- base::FundamentalValue* rate(new base::FundamentalValue(
- it->second.subresource_use_rate()));
+ 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(url_spec);
- subresource_list->Append(rate);
+ subresource_list->Append(std::move(url_spec));
+ subresource_list->Append(std::move(rate));
}
return subresource_list;
}
« no previous file with comments | « chrome/browser/net/predictor.cc ('k') | chrome/browser/plugins/plugin_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698