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

Unified Diff: content/browser/net/network_errors_listing_ui.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: content/browser/net/network_errors_listing_ui.cc
diff --git a/content/browser/net/network_errors_listing_ui.cc b/content/browser/net/network_errors_listing_ui.cc
index 9f29c2869f099710301fc79d797ba5233504f89a..7db9906fc2103251cb7324d93396e12fdd087a90 100644
--- a/content/browser/net/network_errors_listing_ui.cc
+++ b/content/browser/net/network_errors_listing_ui.cc
@@ -4,6 +4,9 @@
#include "content/browser/net/network_errors_listing_ui.h"
+#include <memory>
+#include <utility>
+
#include "base/bind.h"
#include "base/json/json_writer.h"
#include "base/values.h"
@@ -44,10 +47,10 @@ std::unique_ptr<base::ListValue> GetNetworkErrorData() {
// Exclude the aborted and pending codes as these don't return a page.
if (error_code != net::Error::ERR_IO_PENDING &&
error_code != net::Error::ERR_ABORTED) {
- base::DictionaryValue* error = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> error(new base::DictionaryValue());
error->SetInteger(kErrorIdField, error_code);
error->SetString(kErrorCodeField, itr.key());
- error_list->Append(error);
+ error_list->Append(std::move(error));
}
}
return error_list;
« no previous file with comments | « content/browser/media/media_internals.cc ('k') | content/browser/service_worker/service_worker_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698