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

Unified Diff: components/error_page/renderer/net_error_helper_core_unittest.cc

Issue 2889163002: Remove raw DictionaryValue::Set in //components (Closed)
Patch Set: Nits Created 3 years, 7 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/renderer/net_error_helper_core.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_unittest.cc
diff --git a/components/error_page/renderer/net_error_helper_core_unittest.cc b/components/error_page/renderer/net_error_helper_core_unittest.cc
index f67d1cd49918f8de012ce4d03cac6da7bf02f47a..12bb4a425eceaed2eb146388e96d363b104a2ae5 100644
--- a/components/error_page/renderer/net_error_helper_core_unittest.cc
+++ b/components/error_page/renderer/net_error_helper_core_unittest.cc
@@ -9,12 +9,14 @@
#include <map>
#include <memory>
#include <string>
+#include <utility>
#include <vector>
#include "base/json/json_reader.h"
#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/statistics_recorder.h"
#include "base/strings/stringprintf.h"
#include "base/test/histogram_tester.h"
@@ -82,12 +84,12 @@ const NavigationCorrection kDefaultCorrections[] = {
std::string SuggestionsToResponse(const NavigationCorrection* corrections,
int num_corrections) {
- base::ListValue* url_corrections = new base::ListValue();
+ auto url_corrections = base::MakeUnique<base::ListValue>();
for (int i = 0; i < num_corrections; ++i)
url_corrections->Append(corrections[i].ToValue());
base::DictionaryValue response;
- response.Set("result.UrlCorrections", url_corrections);
+ response.Set("result.UrlCorrections", std::move(url_corrections));
response.SetString("result.eventId", kNavigationCorrectionEventId);
response.SetString("result.fingerprint", kNavigationCorrectionFingerprint);
« no previous file with comments | « components/error_page/renderer/net_error_helper_core.cc ('k') | components/flags_ui/flags_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698