icecat: add release icecat-140.8.0-2gnu1 for ecne
This commit is contained in:
parent
450538011a
commit
8eb1f1732f
616 changed files with 39955 additions and 33937 deletions
|
|
@ -90,15 +90,8 @@ class nsWindowWatcher;
|
|||
struct nsWatcherWindowEntry {
|
||||
nsWatcherWindowEntry(mozIDOMWindowProxy* aWindow,
|
||||
nsIWebBrowserChrome* aChrome)
|
||||
: mChrome(nullptr) {
|
||||
mWindow = aWindow;
|
||||
nsCOMPtr<nsISupportsWeakReference> supportsweak(do_QueryInterface(aChrome));
|
||||
if (supportsweak) {
|
||||
supportsweak->GetWeakReference(getter_AddRefs(mChromeWeak));
|
||||
} else {
|
||||
mChrome = aChrome;
|
||||
mChromeWeak = nullptr;
|
||||
}
|
||||
: mWindow(do_GetWeakReference(aWindow)),
|
||||
mChrome(do_GetWeakReference(aChrome)) {
|
||||
ReferenceSelf();
|
||||
}
|
||||
~nsWatcherWindowEntry() = default;
|
||||
|
|
@ -107,9 +100,8 @@ struct nsWatcherWindowEntry {
|
|||
void Unlink();
|
||||
void ReferenceSelf();
|
||||
|
||||
mozIDOMWindowProxy* mWindow;
|
||||
nsIWebBrowserChrome* mChrome;
|
||||
nsWeakPtr mChromeWeak;
|
||||
nsWeakPtr mWindow;
|
||||
nsWeakPtr mChrome;
|
||||
// each struct is in a circular, doubly-linked list
|
||||
nsWatcherWindowEntry* mYounger; // next younger in sequence
|
||||
nsWatcherWindowEntry* mOlder;
|
||||
|
|
@ -193,10 +185,15 @@ nsWatcherWindowEnumerator::GetNext(nsISupports** aResult) {
|
|||
|
||||
*aResult = nullptr;
|
||||
|
||||
if (mCurrentPosition) {
|
||||
CallQueryInterface(mCurrentPosition->mWindow, aResult);
|
||||
while (mCurrentPosition) {
|
||||
nsCOMPtr<mozIDOMWindowProxy> window =
|
||||
do_QueryReferent(mCurrentPosition->mWindow);
|
||||
if (window) {
|
||||
CallQueryInterface(window, aResult);
|
||||
mCurrentPosition = FindNext();
|
||||
return NS_OK;
|
||||
}
|
||||
mCurrentPosition = FindNext();
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
|
@ -1622,14 +1619,7 @@ nsWindowWatcher::AddWindow(mozIDOMWindowProxy* aWindow,
|
|||
// its chrome mapping and return
|
||||
info = FindWindowEntry(aWindow);
|
||||
if (info) {
|
||||
nsCOMPtr<nsISupportsWeakReference> supportsweak(
|
||||
do_QueryInterface(aChrome));
|
||||
if (supportsweak) {
|
||||
supportsweak->GetWeakReference(getter_AddRefs(info->mChromeWeak));
|
||||
} else {
|
||||
info->mChrome = aChrome;
|
||||
info->mChromeWeak = nullptr;
|
||||
}
|
||||
info->mChrome = do_GetWeakReference(aChrome);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
@ -1683,7 +1673,8 @@ nsWatcherWindowEntry* nsWindowWatcher::FindWindowEntry(
|
|||
info = mOldestWindow;
|
||||
listEnd = nullptr;
|
||||
while (info != listEnd) {
|
||||
if (info->mWindow == aWindow) {
|
||||
nsCOMPtr<mozIDOMWindowProxy> window = do_QueryReferent(info->mWindow);
|
||||
if (window && window == aWindow) {
|
||||
return info;
|
||||
}
|
||||
info = info->mYounger;
|
||||
|
|
@ -1714,8 +1705,11 @@ nsresult nsWindowWatcher::RemoveWindow(nsWatcherWindowEntry* aInfo) {
|
|||
// send notifications.
|
||||
nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
|
||||
if (os) {
|
||||
nsCOMPtr<nsISupports> domwin(do_QueryInterface(aInfo->mWindow));
|
||||
os->NotifyObservers(domwin, "domwindowclosed", nullptr);
|
||||
nsCOMPtr<mozIDOMWindowProxy> window = do_QueryReferent(aInfo->mWindow);
|
||||
if (window) {
|
||||
nsCOMPtr<nsISupports> domwin(do_QueryInterface(window));
|
||||
os->NotifyObservers(domwin, "domwindowclosed", nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
delete aInfo;
|
||||
|
|
@ -1733,12 +1727,8 @@ nsWindowWatcher::GetChromeForWindow(mozIDOMWindowProxy* aWindow,
|
|||
MutexAutoLock lock(mListLock);
|
||||
nsWatcherWindowEntry* info = FindWindowEntry(aWindow);
|
||||
if (info) {
|
||||
if (info->mChromeWeak) {
|
||||
return info->mChromeWeak->QueryReferent(
|
||||
NS_GET_IID(nsIWebBrowserChrome), reinterpret_cast<void**>(aResult));
|
||||
}
|
||||
*aResult = info->mChrome;
|
||||
NS_IF_ADDREF(*aResult);
|
||||
nsCOMPtr<nsIWebBrowserChrome> chrome = do_QueryReferent(info->mChrome);
|
||||
chrome.forget(aResult);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue