mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
Bug 1458999: Nullcheck for release, assert elsewhere. r=enn
This should allow us to figure out what's killing the window mid-flight, in case there's something to fix in the chrome JS code. MozReview-Commit-ID: 1xx1AVdspB2
This commit is contained in:
parent
aa2cf73671
commit
b8a33cdbac
@ -449,6 +449,9 @@ NS_IMETHODIMP nsXULWindow::Create()
|
||||
|
||||
NS_IMETHODIMP nsXULWindow::Destroy()
|
||||
{
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mSyncingAttributesToWidget,
|
||||
"Destroying the window from SyncAttributesToWidget?");
|
||||
|
||||
if (!mWindow)
|
||||
return NS_OK;
|
||||
|
||||
@ -1549,6 +1552,11 @@ void nsXULWindow::SyncAttributesToWidget()
|
||||
if (!windowElement)
|
||||
return;
|
||||
|
||||
AutoRestore<bool> scope { mSyncingAttributesToWidget };
|
||||
mSyncingAttributesToWidget = true;
|
||||
|
||||
MOZ_DIAGNOSTIC_ASSERT(mWindow, "No widget on SyncAttributesToWidget?");
|
||||
|
||||
nsAutoString attr;
|
||||
|
||||
// "hidechrome" attribute
|
||||
@ -1557,6 +1565,8 @@ void nsXULWindow::SyncAttributesToWidget()
|
||||
mWindow->HideWindowChrome(true);
|
||||
}
|
||||
|
||||
NS_ENSURE_TRUE_VOID(mWindow);
|
||||
|
||||
// "chromemargin" attribute
|
||||
nsIntMargin margins;
|
||||
windowElement->GetAttribute(NS_LITERAL_STRING("chromemargin"), attr);
|
||||
@ -1565,12 +1575,16 @@ void nsXULWindow::SyncAttributesToWidget()
|
||||
mWindow->SetNonClientMargins(tmp);
|
||||
}
|
||||
|
||||
NS_ENSURE_TRUE_VOID(mWindow);
|
||||
|
||||
// "windowtype" attribute
|
||||
windowElement->GetAttribute(WINDOWTYPE_ATTRIBUTE, attr);
|
||||
if (!attr.IsEmpty()) {
|
||||
mWindow->SetWindowClass(attr);
|
||||
}
|
||||
|
||||
NS_ENSURE_TRUE_VOID(mWindow);
|
||||
|
||||
// "id" attribute for icon
|
||||
windowElement->GetAttribute(NS_LITERAL_STRING("id"), attr);
|
||||
if (attr.IsEmpty()) {
|
||||
@ -1578,18 +1592,26 @@ void nsXULWindow::SyncAttributesToWidget()
|
||||
}
|
||||
mWindow->SetIcon(attr);
|
||||
|
||||
NS_ENSURE_TRUE_VOID(mWindow);
|
||||
|
||||
// "drawtitle" attribute
|
||||
windowElement->GetAttribute(NS_LITERAL_STRING("drawtitle"), attr);
|
||||
mWindow->SetDrawsTitle(attr.LowerCaseEqualsLiteral("true"));
|
||||
|
||||
NS_ENSURE_TRUE_VOID(mWindow);
|
||||
|
||||
// "toggletoolbar" attribute
|
||||
windowElement->GetAttribute(NS_LITERAL_STRING("toggletoolbar"), attr);
|
||||
mWindow->SetShowsToolbarButton(attr.LowerCaseEqualsLiteral("true"));
|
||||
|
||||
NS_ENSURE_TRUE_VOID(mWindow);
|
||||
|
||||
// "fullscreenbutton" attribute
|
||||
windowElement->GetAttribute(NS_LITERAL_STRING("fullscreenbutton"), attr);
|
||||
mWindow->SetShowsFullScreenButton(attr.LowerCaseEqualsLiteral("true"));
|
||||
|
||||
NS_ENSURE_TRUE_VOID(mWindow);
|
||||
|
||||
// "macanimationtype" attribute
|
||||
windowElement->GetAttribute(NS_LITERAL_STRING("macanimationtype"), attr);
|
||||
if (attr.EqualsLiteral("document")) {
|
||||
|
@ -180,6 +180,7 @@ protected:
|
||||
// mDestroying is used to prevent reentry into into Destroy(), which can
|
||||
// otherwise happen due to script running as we tear down various things.
|
||||
bool mDestroying;
|
||||
bool mSyncingAttributesToWidget = false;
|
||||
bool mRegistered;
|
||||
uint32_t mPersistentAttributesDirty; // persistentAttributes
|
||||
uint32_t mPersistentAttributesMask;
|
||||
|
Loading…
Reference in New Issue
Block a user