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

Unified Diff: chrome/browser/prerender/prerender_history.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
Index: chrome/browser/prerender/prerender_history.cc
diff --git a/chrome/browser/prerender/prerender_history.cc b/chrome/browser/prerender/prerender_history.cc
index 864047986ee016426b5f38225bae79e6bbbaa5fa..3b27145d7ffc02a949d45caa7da071a9ab1ac38d 100644
--- a/chrome/browser/prerender/prerender_history.cc
+++ b/chrome/browser/prerender/prerender_history.cc
@@ -4,6 +4,9 @@
#include "chrome/browser/prerender/prerender_history.h"
+#include <memory>
+#include <utility>
+
#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
@@ -37,7 +40,8 @@ base::Value* PrerenderHistory::GetEntriesAsValue() const {
it != entries_.rend();
++it) {
const Entry& entry = *it;
- base::DictionaryValue* entry_dict = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> entry_dict(
+ new base::DictionaryValue());
entry_dict->SetString("url", entry.url.spec());
entry_dict->SetString("final_status",
NameFromFinalStatus(entry.final_status));
@@ -47,7 +51,7 @@ base::Value* PrerenderHistory::GetEntriesAsValue() const {
entry_dict->SetString(
"end_time",
base::Int64ToString((entry.end_time - epoch_start).InMilliseconds()));
- return_list->Append(entry_dict);
+ return_list->Append(std::move(entry_dict));
}
return return_list;
}
« no previous file with comments | « chrome/browser/plugins/plugin_prefs.cc ('k') | chrome/browser/profile_resetter/resettable_settings_snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698