bool AssertAppStatus(PContentParent* aActor, unsigned short aStatus) { const InfallibleTArray<PBrowserParent*>& browsers = aActor->ManagedPBrowserParent(); for (uint32_t i = 0; i < browsers.Length(); ++i) { if (AssertAppStatus(browsers[i], aStatus)) { return true; } } return false; }
bool AssertAppStatus(PContentParent* aActor, unsigned short aStatus) { nsTArray<TabContext> contextArray = static_cast<ContentParent*>(aActor)->GetManagedTabContext(); for (uint32_t i = 0; i < contextArray.Length(); ++i) { if (AssertAppStatus(contextArray[i], aStatus)) { return true; } } NS_ERROR( nsPrintfCString( "Security problem: Content process does not have `%d' status. It will be killed.", aStatus).get()); static_cast<ContentParent*>(aActor)->KillHard("AssertAppStatus"); return false; }