зеркало из https://github.com/mozilla/gecko-dev.git
Bug 995730 - Fix style violations in xpcom/base/ (part 2). r=froydnj
This commit is contained in:
Родитель
4756914940
Коммит
0d2648eb80
|
@ -73,7 +73,7 @@ private:
|
|||
// this constructor always, the compiler wouldn't generate a trivial
|
||||
// default constructor for us in non-debug mode.
|
||||
#ifdef DEBUG
|
||||
StaticMutex(StaticMutex& other);
|
||||
StaticMutex(StaticMutex& aOther);
|
||||
#endif
|
||||
|
||||
// Disallow these operators.
|
||||
|
|
|
@ -81,7 +81,7 @@ private:
|
|||
// this constructor always, the compiler wouldn't generate a trivial
|
||||
// default constructor for us in non-debug mode.
|
||||
#ifdef DEBUG
|
||||
StaticAutoPtr(StaticAutoPtr<T>& other);
|
||||
StaticAutoPtr(StaticAutoPtr<T>& aOther);
|
||||
#endif
|
||||
|
||||
void Assign(T* aNewPtr)
|
||||
|
|
|
@ -131,7 +131,7 @@ public:
|
|||
bool CanBeDeleted(const TimeStamp& aUntil) const;
|
||||
|
||||
static RecordBatch* Register();
|
||||
static void Close(void* data); // Registered on freeing thread data
|
||||
static void Close(void* aData); // Registered on freeing thread data
|
||||
static RecordBatch* Clone(RecordBatch* aLog, const TimeStamp& aSince);
|
||||
static void Delete(RecordBatch* aLog);
|
||||
|
||||
|
@ -181,9 +181,9 @@ RecordBatch::Register()
|
|||
}
|
||||
|
||||
void
|
||||
RecordBatch::Close(void* data)
|
||||
RecordBatch::Close(void* aData)
|
||||
{
|
||||
RecordBatch* batch = static_cast<RecordBatch*>(data);
|
||||
RecordBatch* batch = static_cast<RecordBatch*>(aData);
|
||||
batch->Close();
|
||||
}
|
||||
|
||||
|
@ -333,8 +333,8 @@ RecordBatch::CanBeDeleted(const TimeStamp& aUntil) const
|
|||
class EventFilter
|
||||
{
|
||||
public:
|
||||
static EventFilter* Build(const char* filterVar);
|
||||
bool EventPasses(const char* eventName);
|
||||
static EventFilter* Build(const char* aFilterVar);
|
||||
bool EventPasses(const char* aFilterVar);
|
||||
|
||||
~EventFilter()
|
||||
{
|
||||
|
@ -344,9 +344,9 @@ public:
|
|||
}
|
||||
|
||||
private:
|
||||
EventFilter(const char* eventName, EventFilter* next)
|
||||
: mFilter(PL_strdup(eventName))
|
||||
, mNext(next)
|
||||
EventFilter(const char* aEventName, EventFilter* aNext)
|
||||
: mFilter(PL_strdup(aEventName))
|
||||
, mNext(aNext)
|
||||
{
|
||||
MOZ_COUNT_CTOR(EventFilter);
|
||||
}
|
||||
|
@ -357,9 +357,9 @@ private:
|
|||
|
||||
// static
|
||||
EventFilter*
|
||||
EventFilter::Build(const char* filterVar)
|
||||
EventFilter::Build(const char* aFilterVar)
|
||||
{
|
||||
if (!filterVar || !*filterVar) {
|
||||
if (!aFilterVar || !*aFilterVar) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -370,7 +370,7 @@ EventFilter::Build(const char* filterVar)
|
|||
int pos = 0, count, delta = 0;
|
||||
|
||||
// Read up to a comma or EOF -> get name of an event first in the list
|
||||
count = sscanf(filterVar, "%63[^,]%n", eventName, &delta);
|
||||
count = sscanf(aFilterVar, "%63[^,]%n", eventName, &delta);
|
||||
if (count == 0) {
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -378,7 +378,7 @@ EventFilter::Build(const char* filterVar)
|
|||
pos = delta;
|
||||
|
||||
// Skip a comma, if present, accept spaces around it
|
||||
count = sscanf(filterVar + pos, " , %n", &delta);
|
||||
count = sscanf(aFilterVar + pos, " , %n", &delta);
|
||||
if (count != EOF) {
|
||||
pos += delta;
|
||||
}
|
||||
|
@ -386,18 +386,18 @@ EventFilter::Build(const char* filterVar)
|
|||
// eventName contains name of the first event in the list
|
||||
// second argument recursively parses the rest of the list string and
|
||||
// fills mNext of the just created EventFilter object chaining the objects
|
||||
return new EventFilter(eventName, Build(filterVar + pos));
|
||||
return new EventFilter(eventName, Build(aFilterVar + pos));
|
||||
}
|
||||
|
||||
bool
|
||||
EventFilter::EventPasses(const char* eventName)
|
||||
EventFilter::EventPasses(const char* aEventName)
|
||||
{
|
||||
if (!strcmp(eventName, mFilter)) {
|
||||
if (!strcmp(aEventName, mFilter)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (mNext) {
|
||||
return mNext->EventPasses(eventName);
|
||||
return mNext->EventPasses(aEventName);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -409,7 +409,8 @@ EventFilter* gEventFilter = nullptr;
|
|||
unsigned gThreadPrivateIndex;
|
||||
|
||||
// static
|
||||
bool CheckEventFilters(uint32_t aType, void* aItem, const char* aText)
|
||||
bool
|
||||
CheckEventFilters(uint32_t aType, void* aItem, const char* aText)
|
||||
{
|
||||
if (!gEventFilter) {
|
||||
return true;
|
||||
|
@ -560,7 +561,7 @@ VisualEventTracerLog::~VisualEventTracerLog()
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
VisualEventTracerLog::GetJSONString(nsACString& _retval)
|
||||
VisualEventTracerLog::GetJSONString(nsACString& aResult)
|
||||
{
|
||||
nsCString buffer;
|
||||
|
||||
|
@ -609,7 +610,7 @@ VisualEventTracerLog::GetJSONString(nsACString& _retval)
|
|||
}
|
||||
|
||||
buffer.Append(NS_LITERAL_CSTRING("]}\n"));
|
||||
_retval.Assign(buffer);
|
||||
aResult.Assign(buffer);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -698,7 +699,7 @@ VisualEventTracer::Stop()
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
VisualEventTracer::Snapshot(nsIVisualEventTracerLog** _result)
|
||||
VisualEventTracer::Snapshot(nsIVisualEventTracerLog** aResult)
|
||||
{
|
||||
if (!gInitialized) {
|
||||
return NS_ERROR_UNEXPECTED;
|
||||
|
@ -707,7 +708,7 @@ VisualEventTracer::Snapshot(nsIVisualEventTracerLog** _result)
|
|||
RecordBatch* batch = RecordBatch::CloneLog();
|
||||
|
||||
nsRefPtr<VisualEventTracerLog> log = new VisualEventTracerLog(batch);
|
||||
log.forget(_result);
|
||||
log.forget(aResult);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -213,16 +213,14 @@ public:
|
|||
};
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsAutoPtr<T>*
|
||||
inline nsAutoPtr<T>*
|
||||
address_of(nsAutoPtr<T>& aPtr)
|
||||
{
|
||||
return aPtr.get_address();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
const nsAutoPtr<T>*
|
||||
inline const nsAutoPtr<T>*
|
||||
address_of(const nsAutoPtr<T>& aPtr)
|
||||
{
|
||||
return aPtr.get_address();
|
||||
|
@ -277,8 +275,7 @@ private:
|
|||
};
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsAutoPtrGetterTransfers<T>
|
||||
inline nsAutoPtrGetterTransfers<T>
|
||||
getter_Transfers(nsAutoPtr<T>& aSmartPtr)
|
||||
/*
|
||||
Used around a |nsAutoPtr| when
|
||||
|
@ -293,8 +290,7 @@ getter_Transfers(nsAutoPtr<T>& aSmartPtr)
|
|||
// Comparing two |nsAutoPtr|s
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(const nsAutoPtr<T>& aLhs, const nsAutoPtr<U>& aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) == static_cast<const U*>(aRhs.get());
|
||||
|
@ -302,8 +298,7 @@ operator==(const nsAutoPtr<T>& aLhs, const nsAutoPtr<U>& aRhs)
|
|||
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(const nsAutoPtr<T>& aLhs, const nsAutoPtr<U>& aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) != static_cast<const U*>(aRhs.get());
|
||||
|
@ -313,32 +308,28 @@ operator!=(const nsAutoPtr<T>& aLhs, const nsAutoPtr<U>& aRhs)
|
|||
// Comparing an |nsAutoPtr| to a raw pointer
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(const nsAutoPtr<T>& aLhs, const U* aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) == static_cast<const U*>(aRhs);
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(const U* aLhs, const nsAutoPtr<T>& aRhs)
|
||||
{
|
||||
return static_cast<const U*>(aLhs) == static_cast<const T*>(aRhs.get());
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(const nsAutoPtr<T>& aLhs, const U* aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) != static_cast<const U*>(aRhs);
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(const U* aLhs, const nsAutoPtr<T>& aRhs)
|
||||
{
|
||||
return static_cast<const U*>(aLhs) != static_cast<const T*>(aRhs.get());
|
||||
|
@ -353,32 +344,28 @@ operator!=(const U* aLhs, const nsAutoPtr<T>& aRhs)
|
|||
|
||||
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(const nsAutoPtr<T>& aLhs, U* aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) == const_cast<const U*>(aRhs);
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(U* aLhs, const nsAutoPtr<T>& aRhs)
|
||||
{
|
||||
return const_cast<const U*>(aLhs) == static_cast<const T*>(aRhs.get());
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(const nsAutoPtr<T>& aLhs, U* aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) != const_cast<const U*>(aRhs);
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(U* aLhs, const nsAutoPtr<T>& aRhs)
|
||||
{
|
||||
return const_cast<const U*>(aLhs) != static_cast<const T*>(aRhs.get());
|
||||
|
@ -390,8 +377,7 @@ operator!=(U* aLhs, const nsAutoPtr<T>& aRhs)
|
|||
// Comparing an |nsAutoPtr| to |0|
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(const nsAutoPtr<T>& aLhs, NSCAP_Zero* aRhs)
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
|
@ -399,8 +385,7 @@ operator==(const nsAutoPtr<T>& aLhs, NSCAP_Zero* aRhs)
|
|||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(NSCAP_Zero* aLhs, const nsAutoPtr<T>& aRhs)
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
|
@ -408,8 +393,7 @@ operator==(NSCAP_Zero* aLhs, const nsAutoPtr<T>& aRhs)
|
|||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(const nsAutoPtr<T>& aLhs, NSCAP_Zero* aRhs)
|
||||
// specifically to allow |smartPtr != 0|
|
||||
{
|
||||
|
@ -417,8 +401,7 @@ operator!=(const nsAutoPtr<T>& aLhs, NSCAP_Zero* aRhs)
|
|||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(NSCAP_Zero* aLhs, const nsAutoPtr<T>& aRhs)
|
||||
// specifically to allow |0 != smartPtr|
|
||||
{
|
||||
|
@ -432,21 +415,19 @@ operator!=(NSCAP_Zero* aLhs, const nsAutoPtr<T>& aRhs)
|
|||
// because the compiler is lame.
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
operator==(const nsAutoPtr<T>& lhs, int rhs)
|
||||
inline bool
|
||||
operator==(const nsAutoPtr<T>& aLhs, int aRhs)
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
return static_cast<const void*>(lhs.get()) == reinterpret_cast<const void*>(rhs);
|
||||
return static_cast<const void*>(aLhs.get()) == reinterpret_cast<const void*>(aRhs);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
operator==(int lhs, const nsAutoPtr<T>& rhs)
|
||||
inline bool
|
||||
operator==(int aLhs, const nsAutoPtr<T>& aRhs)
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
return reinterpret_cast<const void*>(lhs) == static_cast<const void*>(rhs.get());
|
||||
return reinterpret_cast<const void*>(aLhs) == static_cast<const void*>(aRhs.get());
|
||||
}
|
||||
|
||||
#endif // !defined(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
|
||||
|
@ -616,16 +597,14 @@ public:
|
|||
};
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsAutoArrayPtr<T>*
|
||||
inline nsAutoArrayPtr<T>*
|
||||
address_of(nsAutoArrayPtr<T>& aPtr)
|
||||
{
|
||||
return aPtr.get_address();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
const nsAutoArrayPtr<T>*
|
||||
inline const nsAutoArrayPtr<T>*
|
||||
address_of(const nsAutoArrayPtr<T>& aPtr)
|
||||
{
|
||||
return aPtr.get_address();
|
||||
|
@ -680,8 +659,7 @@ private:
|
|||
};
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsAutoArrayPtrGetterTransfers<T>
|
||||
inline nsAutoArrayPtrGetterTransfers<T>
|
||||
getter_Transfers(nsAutoArrayPtr<T>& aSmartPtr)
|
||||
/*
|
||||
Used around a |nsAutoArrayPtr| when
|
||||
|
@ -696,8 +674,7 @@ getter_Transfers(nsAutoArrayPtr<T>& aSmartPtr)
|
|||
// Comparing two |nsAutoArrayPtr|s
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(const nsAutoArrayPtr<T>& aLhs, const nsAutoArrayPtr<U>& aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) == static_cast<const U*>(aRhs.get());
|
||||
|
@ -705,8 +682,7 @@ operator==(const nsAutoArrayPtr<T>& aLhs, const nsAutoArrayPtr<U>& aRhs)
|
|||
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(const nsAutoArrayPtr<T>& aLhs, const nsAutoArrayPtr<U>& aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) != static_cast<const U*>(aRhs.get());
|
||||
|
@ -716,32 +692,28 @@ operator!=(const nsAutoArrayPtr<T>& aLhs, const nsAutoArrayPtr<U>& aRhs)
|
|||
// Comparing an |nsAutoArrayPtr| to a raw pointer
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(const nsAutoArrayPtr<T>& aLhs, const U* aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) == static_cast<const U*>(aRhs);
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(const U* aLhs, const nsAutoArrayPtr<T>& aRhs)
|
||||
{
|
||||
return static_cast<const U*>(aLhs) == static_cast<const T*>(aRhs.get());
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(const nsAutoArrayPtr<T>& aLhs, const U* aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) != static_cast<const U*>(aRhs);
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(const U* aLhs, const nsAutoArrayPtr<T>& aRhs)
|
||||
{
|
||||
return static_cast<const U*>(aLhs) != static_cast<const T*>(aRhs.get());
|
||||
|
@ -756,32 +728,28 @@ operator!=(const U* aLhs, const nsAutoArrayPtr<T>& aRhs)
|
|||
|
||||
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(const nsAutoArrayPtr<T>& aLhs, U* aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) == const_cast<const U*>(aRhs);
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(U* aLhs, const nsAutoArrayPtr<T>& aRhs)
|
||||
{
|
||||
return const_cast<const U*>(aLhs) == static_cast<const T*>(aRhs.get());
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(const nsAutoArrayPtr<T>& aLhs, U* aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) != const_cast<const U*>(aRhs);
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(U* aLhs, const nsAutoArrayPtr<T>& aRhs)
|
||||
{
|
||||
return const_cast<const U*>(aLhs) != static_cast<const T*>(aRhs.get());
|
||||
|
@ -793,8 +761,7 @@ operator!=(U* aLhs, const nsAutoArrayPtr<T>& aRhs)
|
|||
// Comparing an |nsAutoArrayPtr| to |0|
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(const nsAutoArrayPtr<T>& aLhs, NSCAP_Zero* aRhs)
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
|
@ -802,8 +769,7 @@ operator==(const nsAutoArrayPtr<T>& aLhs, NSCAP_Zero* aRhs)
|
|||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(NSCAP_Zero* aLhs, const nsAutoArrayPtr<T>& aRhs)
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
|
@ -811,8 +777,7 @@ operator==(NSCAP_Zero* aLhs, const nsAutoArrayPtr<T>& aRhs)
|
|||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(const nsAutoArrayPtr<T>& aLhs, NSCAP_Zero* aRhs)
|
||||
// specifically to allow |smartPtr != 0|
|
||||
{
|
||||
|
@ -820,8 +785,7 @@ operator!=(const nsAutoArrayPtr<T>& aLhs, NSCAP_Zero* aRhs)
|
|||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(NSCAP_Zero* aLhs, const nsAutoArrayPtr<T>& aRhs)
|
||||
// specifically to allow |0 != smartPtr|
|
||||
{
|
||||
|
@ -835,21 +799,19 @@ operator!=(NSCAP_Zero* aLhs, const nsAutoArrayPtr<T>& aRhs)
|
|||
// because the compiler is lame.
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
operator==(const nsAutoArrayPtr<T>& lhs, int rhs)
|
||||
inline bool
|
||||
operator==(const nsAutoArrayPtr<T>& aLhs, int aRhs)
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
return static_cast<const void*>(lhs.get()) == reinterpret_cast<const void*>(rhs);
|
||||
return static_cast<const void*>(aLhs.get()) == reinterpret_cast<const void*>(aRhs);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
operator==(int lhs, const nsAutoArrayPtr<T>& rhs)
|
||||
inline bool
|
||||
operator==(int aLhs, const nsAutoArrayPtr<T>& aRhs)
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
return reinterpret_cast<const void*>(lhs) == static_cast<const void*>(rhs.get());
|
||||
return reinterpret_cast<const void*>(aLhs) == static_cast<const void*>(aRhs.get());
|
||||
}
|
||||
|
||||
#endif // !defined(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
|
||||
|
@ -1157,16 +1119,14 @@ ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
|
|||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsRefPtr<T>*
|
||||
inline nsRefPtr<T>*
|
||||
address_of(nsRefPtr<T>& aPtr)
|
||||
{
|
||||
return aPtr.get_address();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
const nsRefPtr<T>*
|
||||
inline const nsRefPtr<T>*
|
||||
address_of(const nsRefPtr<T>& aPtr)
|
||||
{
|
||||
return aPtr.get_address();
|
||||
|
@ -1221,8 +1181,7 @@ private:
|
|||
};
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
nsRefPtrGetterAddRefs<T>
|
||||
inline nsRefPtrGetterAddRefs<T>
|
||||
getter_AddRefs(nsRefPtr<T>& aSmartPtr)
|
||||
/*
|
||||
Used around a |nsRefPtr| when
|
||||
|
@ -1237,8 +1196,7 @@ getter_AddRefs(nsRefPtr<T>& aSmartPtr)
|
|||
// Comparing two |nsRefPtr|s
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(const nsRefPtr<T>& aLhs, const nsRefPtr<U>& aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) == static_cast<const U*>(aRhs.get());
|
||||
|
@ -1246,8 +1204,7 @@ operator==(const nsRefPtr<T>& aLhs, const nsRefPtr<U>& aRhs)
|
|||
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(const nsRefPtr<T>& aLhs, const nsRefPtr<U>& aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) != static_cast<const U*>(aRhs.get());
|
||||
|
@ -1257,32 +1214,28 @@ operator!=(const nsRefPtr<T>& aLhs, const nsRefPtr<U>& aRhs)
|
|||
// Comparing an |nsRefPtr| to a raw pointer
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(const nsRefPtr<T>& aLhs, const U* aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) == static_cast<const U*>(aRhs);
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(const U* aLhs, const nsRefPtr<T>& aRhs)
|
||||
{
|
||||
return static_cast<const U*>(aLhs) == static_cast<const T*>(aRhs.get());
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(const nsRefPtr<T>& aLhs, const U* aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) != static_cast<const U*>(aRhs);
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(const U* aLhs, const nsRefPtr<T>& aRhs)
|
||||
{
|
||||
return static_cast<const U*>(aLhs) != static_cast<const T*>(aRhs.get());
|
||||
|
@ -1297,32 +1250,28 @@ operator!=(const U* aLhs, const nsRefPtr<T>& aRhs)
|
|||
|
||||
#ifndef NSCAP_DONT_PROVIDE_NONCONST_OPEQ
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(const nsRefPtr<T>& aLhs, U* aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) == const_cast<const U*>(aRhs);
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(U* aLhs, const nsRefPtr<T>& aRhs)
|
||||
{
|
||||
return const_cast<const U*>(aLhs) == static_cast<const T*>(aRhs.get());
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(const nsRefPtr<T>& aLhs, U* aRhs)
|
||||
{
|
||||
return static_cast<const T*>(aLhs.get()) != const_cast<const U*>(aRhs);
|
||||
}
|
||||
|
||||
template <class T, class U>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(U* aLhs, const nsRefPtr<T>& aRhs)
|
||||
{
|
||||
return const_cast<const U*>(aLhs) != static_cast<const T*>(aRhs.get());
|
||||
|
@ -1334,8 +1283,7 @@ operator!=(U* aLhs, const nsRefPtr<T>& aRhs)
|
|||
// Comparing an |nsRefPtr| to |0|
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(const nsRefPtr<T>& aLhs, NSCAP_Zero* aRhs)
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
|
@ -1343,8 +1291,7 @@ operator==(const nsRefPtr<T>& aLhs, NSCAP_Zero* aRhs)
|
|||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator==(NSCAP_Zero* aLhs, const nsRefPtr<T>& aRhs)
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
|
@ -1352,8 +1299,7 @@ operator==(NSCAP_Zero* aLhs, const nsRefPtr<T>& aRhs)
|
|||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(const nsRefPtr<T>& aLhs, NSCAP_Zero* aRhs)
|
||||
// specifically to allow |smartPtr != 0|
|
||||
{
|
||||
|
@ -1361,8 +1307,7 @@ operator!=(const nsRefPtr<T>& aLhs, NSCAP_Zero* aRhs)
|
|||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
inline bool
|
||||
operator!=(NSCAP_Zero* aLhs, const nsRefPtr<T>& aRhs)
|
||||
// specifically to allow |0 != smartPtr|
|
||||
{
|
||||
|
@ -1376,28 +1321,25 @@ operator!=(NSCAP_Zero* aLhs, const nsRefPtr<T>& aRhs)
|
|||
// because the compiler is lame.
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
operator==(const nsRefPtr<T>& lhs, int rhs)
|
||||
inline bool
|
||||
operator==(const nsRefPtr<T>& aLhs, int aRhs)
|
||||
// specifically to allow |smartPtr == 0|
|
||||
{
|
||||
return static_cast<const void*>(lhs.get()) == reinterpret_cast<const void*>(rhs);
|
||||
return static_cast<const void*>(aLhs.get()) == reinterpret_cast<const void*>(aRhs);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
bool
|
||||
operator==(int lhs, const nsRefPtr<T>& rhs)
|
||||
inline bool
|
||||
operator==(int aLhs, const nsRefPtr<T>& aRhs)
|
||||
// specifically to allow |0 == smartPtr|
|
||||
{
|
||||
return reinterpret_cast<const void*>(lhs) == static_cast<const void*>(rhs.get());
|
||||
return reinterpret_cast<const void*>(aLhs) == static_cast<const void*>(aRhs.get());
|
||||
}
|
||||
|
||||
#endif // !defined(HAVE_CPP_TROUBLE_COMPARING_TO_ZERO)
|
||||
|
||||
template <class SourceType, class DestinationType>
|
||||
inline
|
||||
nsresult
|
||||
inline nsresult
|
||||
CallQueryInterface(nsRefPtr<SourceType>& aSourcePtr, DestinationType** aDestPtr)
|
||||
{
|
||||
return CallQueryInterface(aSourcePtr.get(), aDestPtr);
|
||||
|
@ -1450,48 +1392,42 @@ private:
|
|||
};
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
nsQueryObject<T>
|
||||
inline nsQueryObject<T>
|
||||
do_QueryObject(T* aRawPtr)
|
||||
{
|
||||
return nsQueryObject<T>(aRawPtr);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
nsQueryObject<T>
|
||||
inline nsQueryObject<T>
|
||||
do_QueryObject(nsCOMPtr<T>& aRawPtr)
|
||||
{
|
||||
return nsQueryObject<T>(aRawPtr);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
nsQueryObject<T>
|
||||
inline nsQueryObject<T>
|
||||
do_QueryObject(nsRefPtr<T>& aRawPtr)
|
||||
{
|
||||
return nsQueryObject<T>(aRawPtr);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
nsQueryObjectWithError<T>
|
||||
inline nsQueryObjectWithError<T>
|
||||
do_QueryObject(T* aRawPtr, nsresult* aErrorPtr)
|
||||
{
|
||||
return nsQueryObjectWithError<T>(aRawPtr, aErrorPtr);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
nsQueryObjectWithError<T>
|
||||
inline nsQueryObjectWithError<T>
|
||||
do_QueryObject(nsCOMPtr<T>& aRawPtr, nsresult* aErrorPtr)
|
||||
{
|
||||
return nsQueryObjectWithError<T>(aRawPtr, aErrorPtr);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
inline
|
||||
nsQueryObjectWithError<T>
|
||||
inline nsQueryObjectWithError<T>
|
||||
do_QueryObject(nsRefPtr<T>& aRawPtr, nsresult* aErrorPtr)
|
||||
{
|
||||
return nsQueryObjectWithError<T>(aRawPtr, aErrorPtr);
|
||||
|
|
|
@ -19,8 +19,8 @@ namespace mozilla {
|
|||
class CycleCollectedJSRuntime;
|
||||
|
||||
// See the comments in nsContentUtils.h for explanations of these functions.
|
||||
typedef void* (*DeferredFinalizeAppendFunction)(void* pointers, void* thing);
|
||||
typedef bool (*DeferredFinalizeFunction)(uint32_t slice, void* data);
|
||||
typedef void* (*DeferredFinalizeAppendFunction)(void* aPointers, void* aThing);
|
||||
typedef bool (*DeferredFinalizeFunction)(uint32_t aSlice, void* aData);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
typedef void (* FifoCallback)(const nsCString& inputStr);
|
||||
typedef void (*FifoCallback)(const nsCString& aInputStr);
|
||||
struct FifoInfo
|
||||
{
|
||||
nsCString mCommand;
|
||||
|
@ -142,7 +142,7 @@ private:
|
|||
FifoInfoArray mFifoInfo;
|
||||
};
|
||||
|
||||
typedef void (* PipeCallback)(const uint8_t recvSig);
|
||||
typedef void (*PipeCallback)(const uint8_t aRecvSig);
|
||||
struct SignalInfo
|
||||
{
|
||||
uint8_t mSignal;
|
||||
|
|
|
@ -154,20 +154,20 @@ static uint8_t sDumpAboutMemorySignum; // SIGRTMIN
|
|||
static uint8_t sDumpAboutMemoryAfterMMUSignum; // SIGRTMIN + 1
|
||||
static uint8_t sGCAndCCDumpSignum; // SIGRTMIN + 2
|
||||
|
||||
void doMemoryReport(const uint8_t recvSig)
|
||||
void doMemoryReport(const uint8_t aRecvSig)
|
||||
{
|
||||
// Dump our memory reports (but run this on the main thread!).
|
||||
bool doMMUFirst = recvSig == sDumpAboutMemoryAfterMMUSignum;
|
||||
LOG("SignalWatcher(sig %d) dispatching memory report runnable.", recvSig);
|
||||
bool doMMUFirst = aRecvSig == sDumpAboutMemoryAfterMMUSignum;
|
||||
LOG("SignalWatcher(sig %d) dispatching memory report runnable.", aRecvSig);
|
||||
nsRefPtr<DumpMemoryInfoToTempDirRunnable> runnable =
|
||||
new DumpMemoryInfoToTempDirRunnable(/* identifier = */ EmptyString(),
|
||||
doMMUFirst);
|
||||
NS_DispatchToMainThread(runnable);
|
||||
}
|
||||
|
||||
void doGCCCDump(const uint8_t recvSig)
|
||||
void doGCCCDump(const uint8_t aRecvSig)
|
||||
{
|
||||
LOG("SignalWatcher(sig %d) dispatching GC/CC log runnable.", recvSig);
|
||||
LOG("SignalWatcher(sig %d) dispatching GC/CC log runnable.", aRecvSig);
|
||||
// Dump GC and CC logs (from the main thread).
|
||||
nsRefPtr<GCAndCCLogDumpRunnable> runnable =
|
||||
new GCAndCCLogDumpRunnable(
|
||||
|
|
|
@ -15,8 +15,7 @@ public:
|
|||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSISTATUSREPORTER
|
||||
|
||||
nsStatusReporter(nsACString& process,
|
||||
nsACString& desc);
|
||||
nsStatusReporter(nsACString& aProcess, nsACString& aDesc);
|
||||
|
||||
virtual ~nsStatusReporter();
|
||||
|
||||
|
@ -37,5 +36,5 @@ public:
|
|||
virtual ~nsStatusReporterManager();
|
||||
|
||||
private:
|
||||
nsCOMArray<nsIStatusReporter> mReporters;
|
||||
nsCOMArray<nsIStatusReporter> mReporters;
|
||||
};
|
||||
|
|
|
@ -141,7 +141,7 @@ IsRunningInWindowsMetro()
|
|||
return false;
|
||||
}
|
||||
|
||||
typedef BOOL (WINAPI* IsImmersiveProcessFunc)(HANDLE process);
|
||||
typedef BOOL (WINAPI* IsImmersiveProcessFunc)(HANDLE aProcess);
|
||||
IsImmersiveProcessFunc IsImmersiveProcessPtr =
|
||||
(IsImmersiveProcessFunc)GetProcAddress(user32DLL,
|
||||
"IsImmersiveProcess");
|
||||
|
|
Загрузка…
Ссылка в новой задаче