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

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

Issue 13145003: Rewrite std::string("") to std::string(), Linux edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Ugh Created 7 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.cc ('k') | chrome/common/pref_names_util_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_nss.cc
diff --git a/chrome/common/net/x509_certificate_model_nss.cc b/chrome/common/net/x509_certificate_model_nss.cc
index 5f40ce334d3c2c9f0833f268746d16314be5b508..51e2642ccb820b652738b2ca324677b0a60ec7ac 100644
--- a/chrome/common/net/x509_certificate_model_nss.cc
+++ b/chrome/common/net/x509_certificate_model_nss.cc
@@ -100,8 +100,8 @@ using net::X509Certificate;
using std::string;
string GetCertNameOrNickname(X509Certificate::OSCertHandle cert_handle) {
- string name = ProcessIDN(Stringize(CERT_GetCommonName(&cert_handle->subject),
- ""));
+ string name = ProcessIDN(
+ Stringize(CERT_GetCommonName(&cert_handle->subject), std::string()));
if (!name.empty())
return name;
return GetNickname(cert_handle);
@@ -132,7 +132,7 @@ string GetVersion(X509Certificate::OSCertHandle cert_handle) {
SEC_ASN1DecodeInteger(&cert_handle->version, &version) == SECSuccess) {
return base::UintToString(version + 1);
}
- return "";
+ return std::string();
}
net::CertType GetType(X509Certificate::OSCertHandle cert_handle) {
@@ -142,7 +142,7 @@ net::CertType GetType(X509Certificate::OSCertHandle cert_handle) {
string GetEmailAddress(X509Certificate::OSCertHandle cert_handle) {
if (cert_handle->emailAddr)
return cert_handle->emailAddr;
- return "";
+ return std::string();
}
void GetUsageStrings(X509Certificate::OSCertHandle cert_handle,
@@ -346,14 +346,14 @@ string GetCMSString(const X509Certificate::OSCertHandles& cert_chain,
message.get(), cert_chain[start], PR_FALSE));
if (!signed_data.get()) {
DLOG(ERROR) << "NSS_CMSSignedData_Create failed";
- return "";
+ return std::string();
}
// Add the rest of the chain (if any).
for (size_t i = start + 1; i < end; ++i) {
if (NSS_CMSSignedData_AddCertificate(signed_data.get(), cert_chain[i]) !=
SECSuccess) {
DLOG(ERROR) << "NSS_CMSSignedData_AddCertificate failed on " << i;
- return "";
+ return std::string();
}
}
@@ -363,7 +363,7 @@ string GetCMSString(const X509Certificate::OSCertHandles& cert_chain,
ignore_result(signed_data.release());
} else {
DLOG(ERROR) << "NSS_CMSMessage_GetContentInfo failed";
- return "";
+ return std::string();
}
SECItem cert_p7 = { siBuffer, NULL, 0 };
@@ -373,12 +373,12 @@ string GetCMSString(const X509Certificate::OSCertHandles& cert_chain,
NULL);
if (!ecx) {
DLOG(ERROR) << "NSS_CMSEncoder_Start failed";
- return "";
+ return std::string();
}
if (NSS_CMSEncoder_Finish(ecx) != SECSuccess) {
DLOG(ERROR) << "NSS_CMSEncoder_Finish failed";
- return "";
+ return std::string();
}
return string(reinterpret_cast<const char*>(cert_p7.data), cert_p7.len);
« no previous file with comments | « chrome/common/net/x509_certificate_model.cc ('k') | chrome/common/pref_names_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698