Bug 802902 - Live long and prosper Mr. View Manager. r=roc
authorMats Palmgren <matspal@gmail.com>
Mon, 22 Oct 2012 15:53:31 +0200
changeset 111157 e0f277dac81a4fe7ead018d82499584cf1c413e6
parent 111156 2612d7f2b20d75cfeb39f8b39e356b7126dbcec7
child 111158 e23d2e5ad482c3105e087dbdb341b1f94e47d416
push id93
push usernmatsakis@mozilla.com
push dateWed, 31 Oct 2012 21:26:57 +0000
reviewersroc
bugs802902
milestone19.0a1
Bug 802902 - Live long and prosper Mr. View Manager. r=roc
layout/base/nsRefreshDriver.cpp
view/src/nsView.cpp
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -423,17 +423,18 @@ nsRefreshDriver::Notify(nsITimer *aTimer
   }
   mPresShellsToInvalidateIfHidden.Clear();
 
   if (mViewManagerFlushIsPending) {
 #ifdef DEBUG_INVALIDATIONS
     printf("Starting ProcessPendingUpdates\n");
 #endif
     mViewManagerFlushIsPending = false;
-    mPresContext->GetPresShell()->GetViewManager()->ProcessPendingUpdates();
+    nsCOMPtr<nsIViewManager> vm = mPresContext->GetPresShell()->GetViewManager();
+    vm->ProcessPendingUpdates();
 #ifdef DEBUG_INVALIDATIONS
     printf("Ending ProcessPendingUpdates\n");
 #endif
   }
 
   if (mThrottled ||
       (mTimerIsPrecise !=
        (GetRefreshTimerType() == nsITimer::TYPE_REPEATING_PRECISE_CAN_SKIP))) {
--- a/view/src/nsView.cpp
+++ b/view/src/nsView.cpp
@@ -1022,33 +1022,35 @@ nsView::RequestWindowClose(nsIWidget* aW
   }
 
   return false;
 }
 
 void
 nsView::WillPaintWindow(nsIWidget* aWidget, bool aWillSendDidPaint)
 {
-  mViewManager->WillPaintWindow(aWidget, aWillSendDidPaint);
+  nsCOMPtr<nsViewManager> vm = mViewManager;
+  vm->WillPaintWindow(aWidget, aWillSendDidPaint);
 }
 
 bool
 nsView::PaintWindow(nsIWidget* aWidget, nsIntRegion aRegion, uint32_t aFlags)
 {
   mInAlternatePaint = aFlags & PAINT_IS_ALTERNATE;
   nsCOMPtr<nsViewManager> vm = mViewManager;
   bool result = vm->PaintWindow(aWidget, aRegion, aFlags);
   mInAlternatePaint = false;
   return result;
 }
 
 void
 nsView::DidPaintWindow()
 {
-  mViewManager->DidPaintWindow();
+  nsCOMPtr<nsViewManager> vm = mViewManager;
+  vm->DidPaintWindow();
 }
 
 nsEventStatus
 nsView::HandleEvent(nsGUIEvent* aEvent, bool aUseAttachedEvents)
 {
   NS_PRECONDITION(nullptr != aEvent->widget, "null widget ptr");
 
   nsEventStatus result = nsEventStatus_eIgnore;