Bug 1338901 - nsViewManager::ProcessPendingUpdatesForView should use AutoTArray to avoid alloc/free, r=tn

This commit is contained in:
Olli Pettay 2017-02-14 03:44:23 +02:00
parent 1da078f101
commit 35e2f8c417
2 changed files with 3 additions and 3 deletions

View File

@ -383,7 +383,7 @@ nsViewManager::ProcessPendingUpdatesForView(nsView* aView,
}
nsCOMPtr<nsIPresShell> rootShell(mPresShell);
nsTArray<nsCOMPtr<nsIWidget> > widgets;
AutoTArray<nsCOMPtr<nsIWidget>, 1> widgets;
aView->GetViewManager()->ProcessPendingUpdatesRecurse(aView, widgets);
for (uint32_t i = 0; i < widgets.Length(); ++i) {
nsView* view = nsView::GetViewFor(widgets[i]);
@ -422,7 +422,7 @@ nsViewManager::ProcessPendingUpdatesForView(nsView* aView,
void
nsViewManager::ProcessPendingUpdatesRecurse(nsView* aView,
nsTArray<nsCOMPtr<nsIWidget> >& aWidgets)
AutoTArray<nsCOMPtr<nsIWidget>, 1>& aWidgets)
{
if (mPresShell && mPresShell->IsNeverPainting()) {
return;

View File

@ -329,7 +329,7 @@ private:
void ProcessPendingUpdatesForView(nsView *aView,
bool aFlushDirtyRegion = true);
void ProcessPendingUpdatesRecurse(nsView* aView,
nsTArray<nsCOMPtr<nsIWidget> >& aWidgets);
AutoTArray<nsCOMPtr<nsIWidget>, 1>& aWidgets);
void ProcessPendingUpdatesPaint(nsIWidget* aWidget);
void FlushDirtyRegionToWidget(nsView* aView);