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

Unified Diff: chrome/browser/ui/webui/certificate_viewer_webui.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/ui/webui/certificate_viewer_webui.cc
diff --git a/chrome/browser/ui/webui/certificate_viewer_webui.cc b/chrome/browser/ui/webui/certificate_viewer_webui.cc
index e7a78aa23245c684918ec9be888654045f8e0810..589388d68900f54a04b2390611c957ceb0db66f5 100644
--- a/chrome/browser/ui/webui/certificate_viewer_webui.cc
+++ b/chrome/browser/ui/webui/certificate_viewer_webui.cc
@@ -4,6 +4,9 @@
#include "chrome/browser/ui/webui/certificate_viewer_webui.h"
+#include <memory>
+#include <utility>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/i18n/time_formatting.h"
@@ -169,7 +172,8 @@ std::string CertificateViewerModalDialog::GetDialogArgs() const {
int index = 0;
for (net::X509Certificate::OSCertHandles::const_iterator i =
cert_chain.begin(); i != cert_chain.end(); ++i, ++index) {
- base::DictionaryValue* cert_node = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> cert_node(
+ new base::DictionaryValue());
base::ListValue cert_details;
cert_node->SetString("label", x509_certificate_model::GetTitle(*i).c_str());
cert_node->SetDouble("payload.index", index);
@@ -179,7 +183,7 @@ std::string CertificateViewerModalDialog::GetDialogArgs() const {
// Add this node to the children list for the next iteration.
children = new base::ListValue();
- children->Append(cert_node);
+ children->Append(std::move(cert_node));
}
// Set the last node as the top of the certificate hierarchy.
cert_info.Set("hierarchy", children);
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_context_menu_unittest.cc ('k') | chrome/browser/ui/webui/components_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698