Bug 1282279 - Fix style in nsClientAuthRemember.h/cpp r=keeler draft
authorJonathan Hao <jhao@mozilla.com>
Thu, 01 Dec 2016 12:06:40 +0800
changeset 446893 0bfd79a2d7967bd49a1110d2b4208e95683297f7
parent 446300 e72f9935adf501fb7ed8a2af537ff807565177f4
child 538903 2e5679c1d4fa1703ce1dddeb7ce4c9cb5589ea93
push id37919
push userbmo:jhao@mozilla.com
push dateFri, 02 Dec 2016 03:41:14 +0000
reviewerskeeler
bugs1282279
milestone53.0a1
Bug 1282279 - Fix style in nsClientAuthRemember.h/cpp r=keeler
security/manager/ssl/nsClientAuthRemember.cpp
security/manager/ssl/nsClientAuthRemember.h
--- a/security/manager/ssl/nsClientAuthRemember.cpp
+++ b/security/manager/ssl/nsClientAuthRemember.cpp
@@ -2,18 +2,18 @@
  *
  * 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/. */
 
 #include "nsClientAuthRemember.h"
 
 #include "nsIX509Cert.h"
+#include "mozilla/BasePrincipal.h"
 #include "mozilla/RefPtr.h"
-#include "mozilla/BasePrincipal.h"
 #include "nsCRT.h"
 #include "nsNSSCertHelper.h"
 #include "nsIObserverService.h"
 #include "nsNetUtil.h"
 #include "nsISupportsPrimitives.h"
 #include "nsPromiseFlatString.h"
 #include "nsThreadUtils.h"
 #include "nsStringBuffer.h"
@@ -54,19 +54,19 @@ nsClientAuthRememberService::Init()
   if (observerService) {
     observerService->AddObserver(this, "profile-before-change", true);
   }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
-nsClientAuthRememberService::Observe(nsISupports     *aSubject,
-                               const char      *aTopic,
-                               const char16_t *aData)
+nsClientAuthRememberService::Observe(nsISupports* aSubject,
+                                     const char* aTopic,
+                                     const char16_t* aData)
 {
   // check the topic
   if (!nsCRT::strcmp(aTopic, "profile-before-change")) {
     // The profile is about to change,
     // or is going away because the application is shutting down.
 
     ReentrantMonitorAutoEnter lock(monitor);
     RemoveAllFromMemory();
@@ -179,17 +179,17 @@ nsClientAuthRememberService::AddEntryToL
     ReentrantMonitorAutoEnter lock(monitor);
     nsClientAuthRememberEntry* entry = mSettingsTable.PutEntry(entryKey.get());
 
     if (!entry) {
       NS_ERROR("can't insert a null entry!");
       return NS_ERROR_OUT_OF_MEMORY;
     }
 
-    entry->mHostWithCert = entryKey;
+    entry->mEntryKey = entryKey;
 
     nsClientAuthRemember& settings = entry->mSettings;
     settings.mAsciiHost = aHostName;
     settings.mFingerprint = aFingerprint;
     settings.mDBKey = aDBKey;
   }
 
   return NS_OK;
--- a/security/manager/ssl/nsClientAuthRemember.h
+++ b/security/manager/ssl/nsClientAuthRemember.h
@@ -24,27 +24,27 @@ using mozilla::NeckoOriginAttributes;
 
 class nsClientAuthRemember
 {
 public:
 
   nsClientAuthRemember()
   {
   }
-  
-  nsClientAuthRemember(const nsClientAuthRemember &other)
+
+  nsClientAuthRemember(const nsClientAuthRemember& aOther)
   {
-    this->operator=(other);
+    this->operator=(aOther);
   }
 
-  nsClientAuthRemember &operator=(const nsClientAuthRemember &other)
+  nsClientAuthRemember& operator=(const nsClientAuthRemember& aOther)
   {
-    mAsciiHost = other.mAsciiHost;
-    mFingerprint = other.mFingerprint;
-    mDBKey = other.mDBKey;
+    mAsciiHost = aOther.mAsciiHost;
+    mFingerprint = aOther.mFingerprint;
+    mDBKey = aOther.mDBKey;
     return *this;
   }
 
   nsCString mAsciiHost;
   nsCString mFingerprint;
   nsCString mDBKey;
 };
 
@@ -57,79 +57,79 @@ class nsClientAuthRememberEntry final : 
     typedef const char* KeyType;
     typedef const char* KeyTypePointer;
 
     // do nothing with aHost - we require mHead to be set before we're live!
     explicit nsClientAuthRememberEntry(KeyTypePointer aHostWithCertUTF8)
     {
     }
 
-    nsClientAuthRememberEntry(const nsClientAuthRememberEntry& toCopy)
+    nsClientAuthRememberEntry(const nsClientAuthRememberEntry& aToCopy)
     {
-      mSettings = toCopy.mSettings;
+      mSettings = aToCopy.mSettings;
     }
 
     ~nsClientAuthRememberEntry()
     {
     }
 
     KeyType GetKey() const
     {
-      return HostWithCertPtr();
+      return EntryKeyPtr();
     }
 
     KeyTypePointer GetKeyPointer() const
     {
-      return HostWithCertPtr();
+      return EntryKeyPtr();
     }
 
     bool KeyEquals(KeyTypePointer aKey) const
     {
-      return !strcmp(HostWithCertPtr(), aKey);
+      return !strcmp(EntryKeyPtr(), aKey);
     }
 
     static KeyTypePointer KeyToPointer(KeyType aKey)
     {
       return aKey;
     }
 
     static PLDHashNumber HashKey(KeyTypePointer aKey)
     {
       return PLDHashTable::HashStringKey(aKey);
     }
 
     enum { ALLOW_MEMMOVE = false };
 
     // get methods
-    inline const nsCString &HostWithCert() const { return mHostWithCert; }
+    inline const nsCString& GetEntryKey() const { return mEntryKey; }
 
-    inline KeyTypePointer HostWithCertPtr() const
+    inline KeyTypePointer EntryKeyPtr() const
     {
-      return mHostWithCert.get();
+      return mEntryKey.get();
     }
 
     nsClientAuthRemember mSettings;
-    nsCString mHostWithCert;
+    nsCString mEntryKey;
 };
 
 class nsClientAuthRememberService final : public nsIObserver,
                                           public nsSupportsWeakReference
 {
 public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIOBSERVER
 
   nsClientAuthRememberService();
 
   nsresult Init();
 
   static void GetEntryKey(const nsACString& aHostName,
                           const NeckoOriginAttributes& aOriginAttributes,
                           const nsACString& aFingerprint,
-                          /* out */ nsACString& aEntryKey);
+                          /*out*/ nsACString& aEntryKey);
 
   nsresult RememberDecision(const nsACString& aHostName,
                             const NeckoOriginAttributes& aOriginAttributes,
                             CERTCertificate* aServerCert,
                             CERTCertificate* aClientCert);
 
   nsresult HasRememberedDecision(const nsACString& aHostName,
                                  const NeckoOriginAttributes& aOriginAttributes,