зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1765961 - Avoid some warning spam in nsGlobalWindowOuter. r=smaug
NS_ENSURE_TRUE prints to stderr, which is noisy (this can happen legitimately). Differential Revision: https://phabricator.services.mozilla.com/D144416
This commit is contained in:
Родитель
57656e5c90
Коммит
74e34694dc
|
@ -4140,11 +4140,17 @@ already_AddRefed<nsIWidget> nsGlobalWindowOuter::GetMainWidget() {
|
|||
|
||||
nsIWidget* nsGlobalWindowOuter::GetNearestWidget() const {
|
||||
nsIDocShell* docShell = GetDocShell();
|
||||
NS_ENSURE_TRUE(docShell, nullptr);
|
||||
if (!docShell) {
|
||||
return nullptr;
|
||||
}
|
||||
PresShell* presShell = docShell->GetPresShell();
|
||||
NS_ENSURE_TRUE(presShell, nullptr);
|
||||
if (!presShell) {
|
||||
return nullptr;
|
||||
}
|
||||
nsIFrame* rootFrame = presShell->GetRootFrame();
|
||||
NS_ENSURE_TRUE(rootFrame, nullptr);
|
||||
if (!rootFrame) {
|
||||
return nullptr;
|
||||
}
|
||||
return rootFrame->GetView()->GetNearestWidget(nullptr);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче