mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1189369, part 2 - Don't implicitly convert nsMaybeWeakPtr to an nsCOMPtr. r=mak
This is only used in a few places, and it obscures what is happening.
This commit is contained in:
parent
bba2a0f5bf
commit
3eefc726cc
@ -36,10 +36,8 @@ public:
|
||||
return mPtr == other.mPtr;
|
||||
}
|
||||
|
||||
operator const nsCOMPtr<T>() const { return GetValue(); }
|
||||
|
||||
nsISupports* GetRawValue() const { return mPtr.get(); }
|
||||
protected:
|
||||
|
||||
const nsCOMPtr<T> GetValue() const {
|
||||
return nsCOMPtr<T>(dont_AddRef(static_cast<T*>
|
||||
(GetValueAs(NS_GET_TEMPLATE_IID(T)))));
|
||||
@ -99,7 +97,7 @@ ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback,
|
||||
|
||||
#define ENUMERATE_WEAKARRAY(array, type, method) \
|
||||
for (uint32_t array_idx = 0; array_idx < array.Length(); ++array_idx) { \
|
||||
const nsCOMPtr<type> &e = array.ElementAt(array_idx); \
|
||||
const nsCOMPtr<type> &e = array.ElementAt(array_idx).GetValue(); \
|
||||
if (e) \
|
||||
e->method; \
|
||||
}
|
||||
|
@ -2536,7 +2536,7 @@ nsNavBookmarks::GetObservers(uint32_t* _count,
|
||||
|
||||
// Then add the other observers.
|
||||
for (uint32_t i = 0; i < mObservers.Length(); ++i) {
|
||||
const nsCOMPtr<nsINavBookmarkObserver> &observer = mObservers.ElementAt(i);
|
||||
const nsCOMPtr<nsINavBookmarkObserver> &observer = mObservers.ElementAt(i).GetValue();
|
||||
// Skip nullified weak observers.
|
||||
if (observer)
|
||||
observers.AppendElement(observer);
|
||||
|
@ -2281,7 +2281,7 @@ nsNavHistory::GetObservers(uint32_t* _count,
|
||||
|
||||
// Then add the other observers.
|
||||
for (uint32_t i = 0; i < mObservers.Length(); ++i) {
|
||||
const nsCOMPtr<nsINavHistoryObserver> &observer = mObservers.ElementAt(i);
|
||||
const nsCOMPtr<nsINavHistoryObserver> &observer = mObservers.ElementAt(i).GetValue();
|
||||
// Skip nullified weak observers.
|
||||
if (observer)
|
||||
observers.AppendElement(observer);
|
||||
|
Loading…
Reference in New Issue
Block a user