Bug 972605, part 1 - Rename nsErrorService arguments to aFoo form. r=froydnj

This commit is contained in:
Andrew McCreight
2014-05-09 13:47:36 -07:00
parent bfd85bcc79
commit f229aebe9d
2 changed files with 21 additions and 21 deletions

View File

@@ -9,13 +9,13 @@
#include "nsAutoPtr.h"
static void*
CloneCString(nsHashKey *aKey, void *aData, void* closure)
CloneCString(nsHashKey *aKey, void *aData, void* aClosure)
{
return NS_strdup((const char*)aData);
}
static bool
DeleteCString(nsHashKey *aKey, void *aData, void* closure)
DeleteCString(nsHashKey *aKey, void *aData, void* aClosure)
{
NS_Free(aData);
return true;
@@ -27,12 +27,12 @@ nsInt2StrHashtable::nsInt2StrHashtable()
}
nsresult
nsInt2StrHashtable::Put(uint32_t key, const char* aData)
nsInt2StrHashtable::Put(uint32_t aKey, const char* aData)
{
char* value = NS_strdup(aData);
if (value == nullptr)
return NS_ERROR_OUT_OF_MEMORY;
nsPRUint32Key k(key);
nsPRUint32Key k(aKey);
char* oldValue = (char*)mHashtable.Put(&k, value);
if (oldValue)
NS_Free(oldValue);
@@ -40,9 +40,9 @@ nsInt2StrHashtable::Put(uint32_t key, const char* aData)
}
char*
nsInt2StrHashtable::Get(uint32_t key)
nsInt2StrHashtable::Get(uint32_t aKey)
{
nsPRUint32Key k(key);
nsPRUint32Key k(aKey);
const char* value = (const char*)mHashtable.Get(&k);
if (value == nullptr)
return nullptr;
@@ -50,9 +50,9 @@ nsInt2StrHashtable::Get(uint32_t key)
}
nsresult
nsInt2StrHashtable::Remove(uint32_t key)
nsInt2StrHashtable::Remove(uint32_t aKey)
{
nsPRUint32Key k(key);
nsPRUint32Key k(aKey);
char* oldValue = (char*)mHashtable.Remove(&k);
if (oldValue)
NS_Free(oldValue);
@@ -64,33 +64,33 @@ nsInt2StrHashtable::Remove(uint32_t key)
NS_IMPL_ISUPPORTS(nsErrorService, nsIErrorService)
nsresult
nsErrorService::Create(nsISupports* outer, const nsIID& aIID, void* *aInstancePtr)
nsErrorService::Create(nsISupports* aOuter, const nsIID& aIID, void** aInstancePtr)
{
if (NS_WARN_IF(outer))
if (NS_WARN_IF(aOuter))
return NS_ERROR_NO_AGGREGATION;
nsRefPtr<nsErrorService> serv = new nsErrorService();
return serv->QueryInterface(aIID, aInstancePtr);
}
NS_IMETHODIMP
nsErrorService::RegisterErrorStringBundle(int16_t errorModule, const char *stringBundleURL)
nsErrorService::RegisterErrorStringBundle(int16_t aErrorModule, const char* aStringBundleURL)
{
return mErrorStringBundleURLMap.Put(errorModule, stringBundleURL);
return mErrorStringBundleURLMap.Put(aErrorModule, aStringBundleURL);
}
NS_IMETHODIMP
nsErrorService::UnregisterErrorStringBundle(int16_t errorModule)
nsErrorService::UnregisterErrorStringBundle(int16_t aErrorModule)
{
return mErrorStringBundleURLMap.Remove(errorModule);
return mErrorStringBundleURLMap.Remove(aErrorModule);
}
NS_IMETHODIMP
nsErrorService::GetErrorStringBundle(int16_t errorModule, char **result)
nsErrorService::GetErrorStringBundle(int16_t aErrorModule, char** aResult)
{
char* value = mErrorStringBundleURLMap.Get(errorModule);
char* value = mErrorStringBundleURLMap.Get(aErrorModule);
if (value == nullptr)
return NS_ERROR_OUT_OF_MEMORY;
*result = value;
*aResult = value;
return NS_OK;
}