Bug 1261115 - when Console is running in the main thread the existence of mWindow should always be ensured, r=smaug

This commit is contained in:
Andrea Marchesini 2016-04-12 06:12:07 -04:00
parent 943d93e831
commit c4cbf74421

View File

@ -886,6 +886,8 @@ NS_INTERFACE_MAP_END
/* static */ already_AddRefed<Console>
Console::Create(nsPIDOMWindowInner* aWindow, ErrorResult& aRv)
{
MOZ_ASSERT_IF(NS_IsMainThread(), aWindow);
RefPtr<Console> console = new Console(aWindow);
console->Initialize(aRv);
if (NS_WARN_IF(aRv.Failed())) {
@ -904,6 +906,8 @@ Console::Console(nsPIDOMWindowInner* aWindow)
, mInnerID(0)
, mStatus(eUnknown)
{
MOZ_ASSERT_IF(NS_IsMainThread(), aWindow);
if (mWindow) {
MOZ_ASSERT(mWindow->IsInnerWindow());
mInnerID = mWindow->WindowID();