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

Unified Diff: chrome/common/net/x509_certificate_model_openssl.cc

Issue 1880143002: Convert chrome/common to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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 | « chrome/common/net/x509_certificate_model_nss.cc ('k') | chrome/common/partial_circular_buffer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/net/x509_certificate_model_openssl.cc
diff --git a/chrome/common/net/x509_certificate_model_openssl.cc b/chrome/common/net/x509_certificate_model_openssl.cc
index 86476bf831010562c0498ca8c13f8f33950dee0c..7081713c49ae28f194e489e9ca28ad91502eb42f 100644
--- a/chrome/common/net/x509_certificate_model_openssl.cc
+++ b/chrome/common/net/x509_certificate_model_openssl.cc
@@ -14,6 +14,8 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
+
#include "base/i18n/number_formatting.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
@@ -44,7 +46,7 @@ std::string ProcessRawAsn1Type(ASN1_TYPE* data) {
if (len <= 0)
return std::string();
- scoped_ptr<unsigned char[]> buf(new unsigned char[len]);
+ std::unique_ptr<unsigned char[]> buf(new unsigned char[len]);
unsigned char* bufp = buf.get();
len = i2d_ASN1_TYPE(data, &bufp);
@@ -54,7 +56,7 @@ std::string ProcessRawAsn1Type(ASN1_TYPE* data) {
std::string ProcessRawBignum(BIGNUM* n) {
int len = BN_num_bytes(n);
- scoped_ptr<unsigned char[]> buf(new unsigned char[len]);
+ std::unique_ptr<unsigned char[]> buf(new unsigned char[len]);
len = BN_bn2bin(n, buf.get());
return ProcessRawBytes(buf.get(), len);
}
« no previous file with comments | « chrome/common/net/x509_certificate_model_nss.cc ('k') | chrome/common/partial_circular_buffer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698