Bug 1046841 - Fix more style violations in previously touched .h files in xpcom/. r=froydnj

This commit is contained in:
Birunthan Mohanathas 2014-08-25 12:17:24 -07:00
parent dffead394b
commit 16471161bb
22 changed files with 89 additions and 89 deletions

View File

@ -154,7 +154,8 @@ public:
}
const char* library = mLibraryStrings.Intern(details.library);
entry.Replace(aPc, details.function, library, details.loffset, details.filename, details.lineno);
entry.Replace(aPc, details.function, library, details.loffset,
details.filename, details.lineno);
} else {
mNumCacheHits++;

View File

@ -121,22 +121,13 @@ protected:
size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
void UnmarkSkippableJSHolders();
virtual void TraverseAdditionalNativeRoots(nsCycleCollectionNoteRootCallback& aCb)
{
}
virtual void TraceAdditionalNativeGrayRoots(JSTracer* aTracer)
{
}
virtual void
TraverseAdditionalNativeRoots(nsCycleCollectionNoteRootCallback& aCb) {}
virtual void TraceAdditionalNativeGrayRoots(JSTracer* aTracer) {}
virtual void CustomGCCallback(JSGCStatus aStatus)
{
}
virtual void CustomOutOfMemoryCallback()
{
}
virtual void CustomLargeAllocationFailureCallback()
{
}
virtual void CustomGCCallback(JSGCStatus aStatus) {}
virtual void CustomOutOfMemoryCallback() {}
virtual void CustomLargeAllocationFailureCallback() {}
virtual bool CustomContextCallback(JSContext* aCx, unsigned aOperation)
{
return true; // Don't block context creation.
@ -191,8 +182,8 @@ private:
static void TraceBlackJS(JSTracer* aTracer, void* aData);
static void TraceGrayJS(JSTracer* aTracer, void* aData);
static void GCCallback(JSRuntime* aRuntime, JSGCStatus aStatus, void* aData);
static void OutOfMemoryCallback(JSContext *aContext, void *aData);
static void LargeAllocationFailureCallback(void *aData);
static void OutOfMemoryCallback(JSContext* aContext, void* aData);
static void LargeAllocationFailureCallback(void* aData);
static bool ContextCallback(JSContext* aCx, unsigned aOperation,
void* aData);
@ -240,7 +231,7 @@ public:
MOZ_END_NESTED_ENUM_CLASS(OOMState)
private:
void AnnotateAndSetOutOfMemory(OOMState *aStatePtr, OOMState aNewState);
void AnnotateAndSetOutOfMemory(OOMState* aStatePtr, OOMState aNewState);
void OnGC(JSGCStatus aStatus);
void OnOutOfMemory();
void OnLargeAllocationFailure();

View File

@ -54,15 +54,9 @@ public:
return *this;
}
T* get() const
{
return mRawPtr;
}
T* get() const { return mRawPtr; }
operator T*() const
{
return get();
}
operator T*() const { return get(); }
T* operator->() const
{
@ -70,10 +64,7 @@ public:
return get();
}
T& operator*() const
{
return *get();
}
T& operator*() const { return *get(); }
private:
// Disallow copy constructor, but only in debug mode. We only define
@ -120,15 +111,9 @@ public:
return (this = aRhs.mRawPtr);
}
T* get() const
{
return mRawPtr;
}
T* get() const { return mRawPtr; }
operator T*() const
{
return get();
}
operator T*() const { return get(); }
T* operator->() const
{
@ -136,10 +121,7 @@ public:
return get();
}
T& operator*() const
{
return *get();
}
T& operator*() const { return *get(); }
private:
void AssignWithAddref(T* aNewPtr)

View File

@ -53,8 +53,10 @@ public:
virtual nsresult LogMessageWithMode(nsIConsoleMessage* aMessage,
OutputMode aOutputMode);
typedef nsInterfaceHashtable<nsISupportsHashKey, nsIConsoleListener> ListenerHash;
void EnumerateListeners(ListenerHash::EnumReadFunction aFunction, void* aClosure);
typedef nsInterfaceHashtable<nsISupportsHashKey,
nsIConsoleListener> ListenerHash;
void EnumerateListeners(ListenerHash::EnumReadFunction aFunction,
void* aClosure);
private:
~nsConsoleService();

View File

@ -23,7 +23,8 @@ SanitizeEnvironmentVariables()
DWORD bufferSize = GetEnvironmentVariableW(L"PATH", nullptr, 0);
if (bufferSize) {
wchar_t* originalPath = new wchar_t[bufferSize];
if (bufferSize - 1 == GetEnvironmentVariableW(L"PATH", originalPath, bufferSize)) {
if (bufferSize - 1 == GetEnvironmentVariableW(L"PATH", originalPath,
bufferSize)) {
bufferSize = ExpandEnvironmentStringsW(originalPath, nullptr, 0);
if (bufferSize) {
wchar_t* newPath = new wchar_t[bufferSize];

View File

@ -109,7 +109,8 @@ public:
nsresult AddObject(T* aObj)
{
nsExpirationState* state = aObj->GetExpirationState();
NS_ASSERTION(!state->IsTracked(), "Tried to add an object that's already tracked");
NS_ASSERTION(!state->IsTracked(),
"Tried to add an object that's already tracked");
nsTArray<T*>& generation = mGenerations[mNewestGeneration];
uint32_t index = generation.Length();
if (index > nsExpirationState::MAX_INDEX_IN_GENERATION) {

View File

@ -20,8 +20,8 @@
{0x93, 0xb6, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
typedef nsInterfaceHashtable<nsCharPtrHashKey, nsISupports>
nsProperties_HashBase;
typedef nsInterfaceHashtable<nsCharPtrHashKey,
nsISupports> nsProperties_HashBase;
class nsProperties MOZ_FINAL
: public nsIProperties

View File

@ -296,7 +296,7 @@ public:
index_type i = 0;
size_type len = aStart->mOrderedLT.Length();
for (const OrderingEntry* const* it = aStart->mOrderedLT.Elements(); i < len; ++i, ++it) {
for (auto it = aStart->mOrderedLT.Elements(); i < len; ++i, ++it) {
if (InTransitiveClosure(*it, aTarget)) {
return true;
}
@ -347,7 +347,7 @@ public:
index_type i = 0;
size_type len = aStart->mOrderedLT.Length();
for (const OrderingEntry* const* it = aStart->mOrderedLT.Elements(); i < len; ++i, ++it) {
for (auto it = aStart->mOrderedLT.Elements(); i < len; ++i, ++it) {
aChain->AppendElement((*it)->mResource);
if (GetDeductionChain_Helper(*it, aTarget, aChain)) {
return true;

View File

@ -129,7 +129,8 @@ public:
}
NS_WARN_UNUSED_RESULT bool Put(KeyType aKey, const UserDataType& aData,
const fallible_t&) {
const fallible_t&)
{
EntryType* ent = this->PutEntry(aKey);
if (!ent) {
return false;
@ -223,7 +224,7 @@ public:
*/
typedef size_t
(*SizeOfEntryExcludingThisFun)(KeyType aKey,
const DataType &aData,
const DataType& aData,
mozilla::MallocSizeOf aMallocSizeOf,
void* aUserArg);

View File

@ -31,7 +31,8 @@ NS_COM_GLUE nsresult CallGetClassObject(const char* aContractID,
class NS_COM_GLUE nsCreateInstanceByCID : public nsCOMPtr_helper
{
public:
nsCreateInstanceByCID(const nsCID& aCID, nsISupports* aOuter, nsresult* aErrorPtr)
nsCreateInstanceByCID(const nsCID& aCID, nsISupports* aOuter,
nsresult* aErrorPtr)
: mCID(aCID)
, mOuter(aOuter)
, mErrorPtr(aErrorPtr)

View File

@ -177,7 +177,10 @@ class nsMainThreadPtrHandle
public:
nsMainThreadPtrHandle() : mPtr(nullptr) {}
explicit nsMainThreadPtrHandle(nsMainThreadPtrHolder<T>* aHolder) : mPtr(aHolder) {}
explicit nsMainThreadPtrHandle(nsMainThreadPtrHolder<T>* aHolder)
: mPtr(aHolder)
{
}
nsMainThreadPtrHandle(const nsMainThreadPtrHandle& aOther)
: mPtr(aOther.mPtr)
{

View File

@ -473,7 +473,7 @@ public:
}
// Invoke the copy-constructor in place.
template<class A>
static inline void Construct(E* aE, A &&aArg)
static inline void Construct(E* aE, A&& aArg)
{
typedef typename mozilla::RemoveCV<E>::Type E_NoCV;
typedef typename mozilla::RemoveCV<A>::Type A_NoCV;
@ -1103,8 +1103,9 @@ public:
{
// Adjust memory allocation up-front to catch errors.
if (!Alloc::Successful(this->EnsureCapacity(Length() + aArrayLen - aCount,
sizeof(elem_type))))
sizeof(elem_type)))) {
return nullptr;
}
DestructRange(aStart, aCount);
this->ShiftData(aStart, aCount, aArrayLen,
sizeof(elem_type), MOZ_ALIGNOF(elem_type));
@ -1164,8 +1165,9 @@ public:
elem_type* InsertElementAt(index_type aIndex)
{
if (!Alloc::Successful(this->EnsureCapacity(Length() + 1,
sizeof(elem_type))))
sizeof(elem_type)))) {
return nullptr;
}
this->ShiftData(aIndex, 0, 1, sizeof(elem_type), MOZ_ALIGNOF(elem_type));
elem_type* elem = Elements() + aIndex;
elem_traits::Construct(elem);
@ -1177,11 +1179,13 @@ public:
elem_type* InsertElementAt(index_type aIndex, elem_type&& aItem)
{
if (!Alloc::Successful(this->EnsureCapacity(Length() + 1,
sizeof(elem_type))))
sizeof(elem_type)))) {
return nullptr;
}
this->ShiftData(aIndex, 0, 1, sizeof(elem_type), MOZ_ALIGNOF(elem_type));
elem_type* elem = Elements() + aIndex;
nsTArrayElementTraits<elem_type>::Construct(elem, mozilla::Forward<elem_type>(aItem));
nsTArrayElementTraits<elem_type>::Construct(elem,
mozilla::Forward<elem_type>(aItem));
return elem;
}
@ -1257,8 +1261,9 @@ public:
elem_type* AppendElements(const Item* aArray, size_type aArrayLen)
{
if (!Alloc::Successful(this->EnsureCapacity(Length() + aArrayLen,
sizeof(elem_type))))
sizeof(elem_type)))) {
return nullptr;
}
index_type len = Length();
AssignRange(len, aArrayLen, aArray);
this->IncrementLength(aArrayLen);
@ -1283,11 +1288,13 @@ public:
elem_type* AppendElement(elem_type&& aItem)
{
if (!Alloc::Successful(this->EnsureCapacity(Length() + 1,
sizeof(elem_type))))
sizeof(elem_type)))) {
return nullptr;
}
index_type len = Length();
elem_type* iter = Elements() + len;
nsTArrayElementTraits<elem_type>::Construct(iter, mozilla::Forward<elem_type>(aItem));
nsTArrayElementTraits<elem_type>::Construct(iter,
mozilla::Forward<elem_type>(aItem));
this->IncrementLength(1);
return iter;
}
@ -1299,8 +1306,9 @@ public:
elem_type* AppendElements(size_type aCount)
{
if (!Alloc::Successful(this->EnsureCapacity(Length() + aCount,
sizeof(elem_type))))
sizeof(elem_type)))) {
return nullptr;
}
elem_type* elems = Elements() + Length();
size_type i;
for (i = 0; i < aCount; ++i) {
@ -1325,8 +1333,9 @@ public:
index_type len = Length();
index_type otherLen = aArray.Length();
if (!Alloc::Successful(this->EnsureCapacity(len + otherLen,
sizeof(elem_type))))
sizeof(elem_type)))) {
return nullptr;
}
copy_type::CopyElements(Elements() + len, aArray.Elements(), otherLen,
sizeof(elem_type));
this->IncrementLength(otherLen);
@ -1433,7 +1442,7 @@ public:
// removes elements from the array (see also RemoveElementsAt).
// @param aNewLen The desired length of this array.
// @return True if the operation succeeded; false otherwise.
// See also TruncateLength if the new length is guaranteed to be smaller than
// See also TruncateLength if the new length is guaranteed to be smaller than
// the old.
typename Alloc::ResultType SetLength(size_type aNewLen)
{

View File

@ -294,7 +294,11 @@ template<class ClassType, bool Owning>
struct nsRunnableMethodReceiver<ClassType, void, Owning>
{
ClassType* mObj;
explicit nsRunnableMethodReceiver(ClassType* aObj) : mObj(aObj) { NS_IF_ADDREF(mObj); }
explicit nsRunnableMethodReceiver(ClassType* aObj)
: mObj(aObj)
{
NS_IF_ADDREF(mObj);
}
~nsRunnableMethodReceiver() { Revoke(); }
void Revoke() { NS_IF_RELEASE(mObj); }
};

View File

@ -46,7 +46,8 @@ namespace mozilla {
int32_t NS_COM_GLUE CompareVersions(const char* aStrA, const char* aStrB);
#ifdef XP_WIN
int32_t NS_COM_GLUE CompareVersions(const char16_t* aStrA, const char16_t* aStrB);
int32_t NS_COM_GLUE CompareVersions(const char16_t* aStrA,
const char16_t* aStrB);
#endif
struct NS_COM_GLUE Version

View File

@ -18,22 +18,20 @@
/**
* Enabled preloading of dynamically loaded libraries
*/
extern "C" NS_HIDDEN_(void)
XPCOMGlueEnablePreload();
extern "C" NS_HIDDEN_(void) XPCOMGlueEnablePreload();
/**
* Initialize the XPCOM glue by dynamically linking against the XPCOM
* shared library indicated by xpcomFile.
*/
extern "C" NS_HIDDEN_(nsresult)
XPCOMGlueStartup(const char* xpcomFile);
extern "C" NS_HIDDEN_(nsresult) XPCOMGlueStartup(const char* xpcomFile);
typedef void (*NSFuncPtr)();
struct nsDynamicFunctionLoad
{
const char *functionName;
NSFuncPtr *function;
const char* functionName;
NSFuncPtr* function;
};
/**
@ -45,7 +43,7 @@ struct nsDynamicFunctionLoad
* functions were found.
*/
extern "C" NS_HIDDEN_(nsresult)
XPCOMGlueLoadXULFunctions(const nsDynamicFunctionLoad *symbols);
XPCOMGlueLoadXULFunctions(const nsDynamicFunctionLoad* symbols);
#endif // XPCOM_GLUE
#endif // nsXPCOMGlue_h__

View File

@ -35,7 +35,8 @@ NtPathToDosPath(const nsAString& aNtPath, nsAString& aDosPath)
nsAutoString logicalDrives;
DWORD len = 0;
while (true) {
len = GetLogicalDriveStringsW(len, reinterpret_cast<wchar_t*>(logicalDrives.BeginWriting()));
len = GetLogicalDriveStringsW(
len, reinterpret_cast<wchar_t*>(logicalDrives.BeginWriting()));
if (!len) {
return false;
} else if (len > logicalDrives.Length()) {

View File

@ -24,8 +24,6 @@ class nsDirectoryService MOZ_FINAL
, public nsIDirectoryServiceProvider2
{
public:
// nsISupports interface
NS_DECL_THREADSAFE_ISUPPORTS
NS_DECL_NSIPROPERTIES

View File

@ -18,7 +18,8 @@ inline nsresult
NS_GetSpecialDirectory(const char* aSpecialDirName, nsIFile** aResult)
{
nsresult rv;
nsCOMPtr<nsIProperties> serv(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
nsCOMPtr<nsIProperties> serv(do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID,
&rv));
if (NS_FAILED(rv)) {
return rv;
}

View File

@ -122,13 +122,15 @@ public:
if (aN > 0) {
difference_type step = XPCOM_MIN(aN, size_forward());
NS_ASSERTION(step > 0, "can't advance a reading iterator beyond the end of a string");
NS_ASSERTION(step > 0,
"can't advance a reading iterator beyond the end of a string");
mPosition += step;
} else if (aN < 0) {
difference_type step = XPCOM_MAX(aN, -size_backward());
NS_ASSERTION(step < 0, "can't advance (backward) a reading iterator beyond the end of a string");
NS_ASSERTION(step < 0,
"can't advance (backward) a reading iterator beyond the end of a string");
mPosition += step;
}
@ -248,13 +250,15 @@ public:
if (aN > 0) {
difference_type step = XPCOM_MIN(aN, size_forward());
NS_ASSERTION(step > 0, "can't advance a writing iterator beyond the end of a string");
NS_ASSERTION(step > 0,
"can't advance a writing iterator beyond the end of a string");
mPosition += step;
} else if (aN < 0) {
difference_type step = XPCOM_MAX(aN, -size_backward());
NS_ASSERTION(step < 0, "can't advance (backward) a writing iterator beyond the end of a string");
NS_ASSERTION(step < 0,
"can't advance (backward) a writing iterator beyond the end of a string");
mPosition += step;
}
@ -263,7 +267,8 @@ public:
void write(const value_type* aS, uint32_t aN)
{
NS_ASSERTION(size_forward() > 0, "You can't |write| into an |nsWritingIterator| with no space!");
NS_ASSERTION(size_forward() > 0,
"You can't |write| into an |nsWritingIterator| with no space!");
nsCharTraits<value_type>::move(mPosition, aS, aN);
advance(difference_type(aN));

View File

@ -768,7 +768,8 @@ public:
size_type GetMutableData(wchar_t** aData, size_type aNewLen, const fallible_t&)
{
return GetMutableData(reinterpret_cast<char16_t**>(aData), aNewLen, fallible_t());
return GetMutableData(reinterpret_cast<char16_t**>(aData), aNewLen,
fallible_t());
}
#endif
@ -958,8 +959,7 @@ protected:
{
aCutLength = XPCOM_MIN(aCutLength, mLength - aCutStart);
uint32_t newTotalLen = mLength - aCutLength + aNewLength;
if (aCutStart == mLength && Capacity() > newTotalLen)
{
if (aCutStart == mLength && Capacity() > newTotalLen) {
mFlags &= ~F_VOIDED;
mData[newTotalLen] = char_type(0);
mLength = newTotalLen;

View File

@ -40,7 +40,7 @@ void Shutdown();
/**
* Notify the hang monitor of activity which will reset its internal timer.
*
*
* @param activityType The type of activity being reported.
* @see ActivityType
*/

View File

@ -62,7 +62,7 @@ public:
void Fire();
// If a failure is encountered, the reference is returned to the caller
static already_AddRefed<nsTimerImpl> PostTimerEvent(
already_AddRefed<nsTimerImpl> aTimerRef);
already_AddRefed<nsTimerImpl> aTimerRef);
void SetDelayInternal(uint32_t aDelay);
NS_DECL_THREADSAFE_ISUPPORTS