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

Unified Diff: components/error_page/renderer/net_error_helper_core.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 | « components/error_page/common/localized_error.cc ('k') | components/flags_ui/flags_state.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/error_page/renderer/net_error_helper_core.cc
diff --git a/components/error_page/renderer/net_error_helper_core.cc b/components/error_page/renderer/net_error_helper_core.cc
index eaaf4201cb8c8206ddce8b7bf1ddeebc1df292d0..f9e3c2b76d44246315b3c49ab46d8317c8ef5007 100644
--- a/components/error_page/renderer/net_error_helper_core.cc
+++ b/components/error_page/renderer/net_error_helper_core.cc
@@ -5,6 +5,7 @@
#include "components/error_page/renderer/net_error_helper_core.h"
#include <stddef.h>
+
#include <set>
#include <string>
#include <utility>
@@ -344,7 +345,8 @@ std::unique_ptr<ErrorPageParams> CreateErrorPageParams(
kCorrectionResourceTable[correction_index].correction_type) {
continue;
}
- base::DictionaryValue* suggest = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> suggest(
+ new base::DictionaryValue());
suggest->SetString("summary",
l10n_util::GetStringUTF16(
kCorrectionResourceTable[correction_index].resource_id));
@@ -356,7 +358,7 @@ std::unique_ptr<ErrorPageParams> CreateErrorPageParams(
suggest->SetInteger("trackingId", tracking_id);
suggest->SetInteger("type", static_cast<int>(correction_index));
- params->override_suggestions->Append(suggest);
+ params->override_suggestions->Append(std::move(suggest));
LogCorrectionTypeShown(static_cast<int>(correction_index));
break;
}
« no previous file with comments | « components/error_page/common/localized_error.cc ('k') | components/flags_ui/flags_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698