bug 1055238 - clean up nsNSSCertificateFakeTransport.{cpp,h} for style nits r=rbarnes
authorDavid Keeler <dkeeler@mozilla.com>
Tue, 16 Sep 2014 13:24:13 -0700
changeset 205905 dfdc5be13a2f8452763ffcdd0c6ffe12cfb18c69
parent 205904 e31e24c2bd280317c72d0aa4f2f235f08cb267fc
child 205906 89c373278e798219518a4670233a6898653287e4
push id27507
push userryanvm@gmail.com
push dateThu, 18 Sep 2014 02:16:54 +0000
treeherdermozilla-central@488d490da742 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersrbarnes
bugs1055238
milestone35.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1055238 - clean up nsNSSCertificateFakeTransport.{cpp,h} for style nits r=rbarnes
security/manager/ssl/src/nsNSSCertificateFakeTransport.cpp
security/manager/ssl/src/nsNSSCertificateFakeTransport.h
--- a/security/manager/ssl/src/nsNSSCertificateFakeTransport.cpp
+++ b/security/manager/ssl/src/nsNSSCertificateFakeTransport.cpp
@@ -5,265 +5,250 @@
 
 #include "nsNSSCertificateFakeTransport.h"
 
 #include "nsCOMPtr.h"
 #include "nsIObjectInputStream.h"
 #include "nsIObjectOutputStream.h"
 #include "nsIProgrammingLanguage.h"
 #include "nsISupportsPrimitives.h"
-#include "nsIX509Cert.h"
 #include "nsNSSCertificate.h"
 #include "nsString.h"
 #include "nsXPIDLString.h"
 
-#ifdef PR_LOGGING
-extern PRLogModuleInfo* gPIPNSSLog;
-#endif
-
-/* nsNSSCertificateFakeTransport */
-
 NS_IMPL_ISUPPORTS(nsNSSCertificateFakeTransport,
                   nsIX509Cert,
                   nsISerializable,
                   nsIClassInfo)
 
-nsNSSCertificateFakeTransport::nsNSSCertificateFakeTransport() :
-  mCertSerialization(nullptr)
+nsNSSCertificateFakeTransport::nsNSSCertificateFakeTransport()
+  : mCertSerialization(nullptr)
 {
 }
 
 nsNSSCertificateFakeTransport::~nsNSSCertificateFakeTransport()
 {
-  if (mCertSerialization)
+  if (mCertSerialization) {
     SECITEM_FreeItem(mCertSerialization, true);
+  }
 }
 
-/* readonly attribute string dbKey; */
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetDbKey(char * *aDbKey)
+nsNSSCertificateFakeTransport::GetDbKey(char**)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetWindowTitle(nsAString& aWindowTitle)
+nsNSSCertificateFakeTransport::GetWindowTitle(nsAString&)
+{
+  NS_NOTREACHED("Unimplemented on content process");
+  return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+NS_IMETHODIMP
+nsNSSCertificateFakeTransport::GetNickname(nsAString&)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetNickname(nsAString &aNickname)
+nsNSSCertificateFakeTransport::GetEmailAddress(nsAString&)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetEmailAddress(nsAString &aEmailAddress)
+nsNSSCertificateFakeTransport::GetEmailAddresses(uint32_t*, char16_t***)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetEmailAddresses(uint32_t *aLength, char16_t*** aAddresses)
+nsNSSCertificateFakeTransport::ContainsEmailAddress(const nsAString&, bool*)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::ContainsEmailAddress(const nsAString &aEmailAddress, bool *result)
+nsNSSCertificateFakeTransport::GetCommonName(nsAString&)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetCommonName(nsAString &aCommonName)
+nsNSSCertificateFakeTransport::GetOrganization(nsAString&)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetOrganization(nsAString &aOrganization)
+nsNSSCertificateFakeTransport::GetIssuerCommonName(nsAString&)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetIssuerCommonName(nsAString &aCommonName)
+nsNSSCertificateFakeTransport::GetIssuerOrganization(nsAString&)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetIssuerOrganization(nsAString &aOrganization)
+nsNSSCertificateFakeTransport::GetIssuerOrganizationUnit(nsAString&)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetIssuerOrganizationUnit(nsAString &aOrganizationUnit)
+nsNSSCertificateFakeTransport::GetIssuer(nsIX509Cert**)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
-/* readonly attribute nsIX509Cert issuer; */
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetIssuer(nsIX509Cert * *aIssuer)
+nsNSSCertificateFakeTransport::GetOrganizationalUnit(nsAString&)
+{
+  NS_NOTREACHED("Unimplemented on content process");
+  return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+NS_IMETHODIMP
+nsNSSCertificateFakeTransport::GetChain(nsIArray**)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetOrganizationalUnit(nsAString &aOrganizationalUnit)
-{
-  NS_NOTREACHED("Unimplemented on content process");
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/*
- * nsIEnumerator getChain();
- */
-NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetChain(nsIArray **_rvChain)
+nsNSSCertificateFakeTransport::GetSubjectName(nsAString&)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetSubjectName(nsAString &_subjectName)
+nsNSSCertificateFakeTransport::GetIssuerName(nsAString&)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetIssuerName(nsAString &_issuerName)
+nsNSSCertificateFakeTransport::GetSerialNumber(nsAString&)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetSerialNumber(nsAString &_serialNumber)
-{
-  NS_NOTREACHED("Unimplemented on content process");
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetSha256Fingerprint(nsAString& aSha256Fingerprint)
+nsNSSCertificateFakeTransport::GetSha256Fingerprint(nsAString&)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetSha1Fingerprint(nsAString& aSha1Fingerprint)
+nsNSSCertificateFakeTransport::GetSha1Fingerprint(nsAString&)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetTokenName(nsAString &aTokenName)
+nsNSSCertificateFakeTransport::GetTokenName(nsAString&)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetRawDER(uint32_t *aLength, uint8_t **aArray)
+nsNSSCertificateFakeTransport::GetRawDER(uint32_t*, uint8_t**)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetValidity(nsIX509CertValidity **aValidity)
+nsNSSCertificateFakeTransport::GetValidity(nsIX509CertValidity**)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetUsagesArray(bool localOnly,
-                                 uint32_t *_verified,
-                                 uint32_t *_count,
-                                 char16_t ***_usages)
+nsNSSCertificateFakeTransport::GetUsagesArray(bool, uint32_t*, uint32_t*,
+                                              char16_t***)
+{
+  NS_NOTREACHED("Unimplemented on content process");
+  return NS_ERROR_NOT_IMPLEMENTED;
+}
+
+NS_IMETHODIMP
+nsNSSCertificateFakeTransport::GetUsagesString(bool, uint32_t*, nsAString&)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetUsagesString(bool localOnly,
-                                  uint32_t   *_verified,
-                                  nsAString &_usages)
-{
-  NS_NOTREACHED("Unimplemented on content process");
-  return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* readonly attribute nsIASN1Object ASN1Structure; */
-NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetASN1Structure(nsIASN1Object * *aASN1Structure)
+nsNSSCertificateFakeTransport::GetASN1Structure(nsIASN1Object**)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::Equals(nsIX509Cert *other, bool *result)
+nsNSSCertificateFakeTransport::Equals(nsIX509Cert*, bool*)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetSha256SubjectPublicKeyInfoDigest(nsACString_internal&)
+nsNSSCertificateFakeTransport::GetSha256SubjectPublicKeyInfoDigest(nsACString&)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 // NB: This serialization must match that of nsNSSCertificate.
 NS_IMETHODIMP
 nsNSSCertificateFakeTransport::Write(nsIObjectOutputStream* aStream)
 {
   // On a non-chrome process we don't have mCert because we lack
-  // nsNSSComponent.  nsNSSCertificateFakeTransport object is used only to carry the
-  // certificate serialization.
+  // nsNSSComponent. nsNSSCertificateFakeTransport object is used only to
+  // carry the certificate serialization.
 
   // This serialization has to match that of nsNSSCertificate,
   // so write a fake cached EV Status.
   uint32_t status = static_cast<uint32_t>(nsNSSCertificate::ev_status_unknown);
   nsresult rv = aStream->Write32(status);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   rv = aStream->Write32(mCertSerialization->len);
   if (NS_FAILED(rv)) {
     return rv;
   }
 
-  return aStream->WriteByteArray(mCertSerialization->data, mCertSerialization->len);
+  return aStream->WriteByteArray(mCertSerialization->data,
+                                 mCertSerialization->len);
 }
 
 NS_IMETHODIMP
 nsNSSCertificateFakeTransport::Read(nsIObjectInputStream* aStream)
 {
   // This serialization has to match that of nsNSSCertificate,
   // so read the cachedEVStatus but don't actually use it.
   uint32_t cachedEVStatus;
@@ -280,81 +265,83 @@ nsNSSCertificateFakeTransport::Read(nsIO
 
   nsXPIDLCString str;
   rv = aStream->ReadBytes(len, getter_Copies(str));
   if (NS_FAILED(rv)) {
     return rv;
   }
 
   // On a non-chrome process we cannot instatiate mCert because we lack
-  // nsNSSComponent.  nsNSSCertificateFakeTransport object is used only to carry the
-  // certificate serialization.
+  // nsNSSComponent. nsNSSCertificateFakeTransport object is used only to
+  // carry the certificate serialization.
 
   mCertSerialization = SECITEM_AllocItem(nullptr, nullptr, len);
   if (!mCertSerialization)
       return NS_ERROR_OUT_OF_MEMORY;
   PORT_Memcpy(mCertSerialization->data, str.Data(), len);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetInterfaces(uint32_t *count, nsIID * **array)
+nsNSSCertificateFakeTransport::GetInterfaces(uint32_t* count, nsIID*** array)
 {
   *count = 0;
   *array = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetHelperForLanguage(uint32_t language, nsISupports **_retval)
+nsNSSCertificateFakeTransport::GetHelperForLanguage(uint32_t,
+                                                    nsISupports** _retval)
 {
   *_retval = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetContractID(char * *aContractID)
+nsNSSCertificateFakeTransport::GetContractID(char** aContractID)
 {
   *aContractID = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetClassDescription(char * *aClassDescription)
+nsNSSCertificateFakeTransport::GetClassDescription(char** aClassDescription)
 {
   *aClassDescription = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetClassID(nsCID * *aClassID)
+nsNSSCertificateFakeTransport::GetClassID(nsCID** aClassID)
 {
   *aClassID = (nsCID*) nsMemory::Alloc(sizeof(nsCID));
   if (!*aClassID)
     return NS_ERROR_OUT_OF_MEMORY;
   return GetClassIDNoAlloc(*aClassID);
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetImplementationLanguage(uint32_t *aImplementationLanguage)
+nsNSSCertificateFakeTransport::GetImplementationLanguage(
+  uint32_t* aImplementationLanguage)
 {
   *aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetFlags(uint32_t *aFlags)
+nsNSSCertificateFakeTransport::GetFlags(uint32_t* aFlags)
 {
   *aFlags = nsIClassInfo::THREADSAFE;
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetClassIDNoAlloc(nsCID *aClassIDNoAlloc)
+nsNSSCertificateFakeTransport::GetClassIDNoAlloc(nsCID* aClassIDNoAlloc)
 {
   static NS_DEFINE_CID(kNSSCertificateCID, NS_X509CERT_CID);
 
   *aClassIDNoAlloc = kNSSCertificateCID;
   return NS_OK;
 }
 
 NS_IMETHODIMP
@@ -367,25 +354,25 @@ nsNSSCertificateFakeTransport::GetCertTy
 NS_IMETHODIMP
 nsNSSCertificateFakeTransport::GetIsSelfSigned(bool*)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::RequestUsagesArrayAsync(nsICertVerificationListener*)
+nsNSSCertificateFakeTransport::RequestUsagesArrayAsync(
+  nsICertVerificationListener*)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
-nsNSSCertificateFakeTransport::GetAllTokenNames(unsigned int*,
-                                                char16_t***)
+nsNSSCertificateFakeTransport::GetAllTokenNames(unsigned int*, char16_t***)
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 CERTCertificate*
 nsNSSCertificateFakeTransport::GetCert()
 {
@@ -402,9 +389,9 @@ nsNSSCertificateFakeTransport::ExportAsC
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMETHODIMP
 nsNSSCertificateFakeTransport::MarkForPermDeletion()
 {
   NS_NOTREACHED("Unimplemented on content process");
   return NS_ERROR_NOT_IMPLEMENTED;
-}
\ No newline at end of file
+}
--- a/security/manager/ssl/src/nsNSSCertificateFakeTransport.h
+++ b/security/manager/ssl/src/nsNSSCertificateFakeTransport.h
@@ -1,34 +1,33 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef _NS_NSSCERTIFICATECHILD_H_
-#define _NS_NSSCERTIFICATECHILD_H_
+#ifndef nsNSSCertificateFakeTransport_h
+#define nsNSSCertificateFakeTransport_h
 
-#include "nsIX509Cert.h"
+#include "nsIClassInfo.h"
 #include "nsISerializable.h"
-#include "nsIClassInfo.h"
+#include "nsIX509Cert.h"
 #include "secitem.h"
 
-/* Certificate */
 class nsNSSCertificateFakeTransport : public nsIX509Cert,
-                              public nsISerializable,
-                              public nsIClassInfo
+                                      public nsISerializable,
+                                      public nsIClassInfo
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIX509CERT
   NS_DECL_NSISERIALIZABLE
   NS_DECL_NSICLASSINFO
 
   nsNSSCertificateFakeTransport();
 
 protected:
   virtual ~nsNSSCertificateFakeTransport();
 
 private:
-  SECItem *mCertSerialization;
+  SECItem* mCertSerialization;
 };
 
-#endif /* _NS_NSSCERTIFICATECHILD_H_ */
+#endif // nsNSSCertificateFakeTransport_h