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); |