diff --git a/view/src/nsViewManager.cpp b/view/src/nsViewManager.cpp index aa2bb227cedf..c38d2e5fe4f2 100644 --- a/view/src/nsViewManager.cpp +++ b/view/src/nsViewManager.cpp @@ -80,21 +80,6 @@ #define NSCOORD_NONE PR_INT32_MIN -void -nsViewManager::PostInvalidateEvent() -{ - NS_ASSERTION(IsRootVM(), "Caller screwed up"); - - if (!mInvalidateEvent.IsPending()) { - nsRefPtr ev = new nsInvalidateEvent(this); - if (NS_FAILED(NS_DispatchToCurrentThread(ev))) { - NS_WARNING("failed to dispatch nsInvalidateEvent"); - } else { - mInvalidateEvent = ev; - } - } -} - #undef DEBUG_MOUSE_LOCATION PRInt32 nsViewManager::mVMCount = 0; @@ -132,10 +117,6 @@ nsViewManager::~nsViewManager() mRootView = nsnull; } - // Make sure to revoke pending events for all viewmanagers, since some events - // are posted by a non-root viewmanager. - mInvalidateEvent.Revoke(); - if (!IsRootVM()) { // We have a strong ref to mRootViewManager NS_RELEASE(mRootViewManager); @@ -1387,11 +1368,7 @@ void nsViewManager::TriggerRefresh(PRUint32 aUpdateFlags) if (mUpdateBatchCnt > 0) return; - if (!mHasPendingUpdates) { - // Nothing to do - } else if (aUpdateFlags & NS_VMREFRESH_DEFERRED) { - PostInvalidateEvent(); - } else { // NO_SYNC + if (mHasPendingUpdates) { FlushPendingInvalidates(); } } @@ -1531,24 +1508,6 @@ nsViewManager::CallDidPaintOnObservers() } } -void -nsViewManager::ProcessInvalidateEvent() -{ - NS_ASSERTION(IsRootVM(), - "Incorrectly targeted invalidate event"); - // If we're in the middle of an update batch, just repost the event, - // to be processed when the batch ends. - bool processEvent = (mUpdateBatchCnt == 0); - if (processEvent) { - FlushPendingInvalidates(); - } - mInvalidateEvent.Forget(); - if (!processEvent) { - // We didn't actually process this event... post a new one - PostInvalidateEvent(); - } -} - NS_IMETHODIMP nsViewManager::GetLastUserEventTime(PRUint32& aTime) { diff --git a/view/src/nsViewManager.h b/view/src/nsViewManager.h index 1be861b4e5e8..f0be3f7d0f35 100644 --- a/view/src/nsViewManager.h +++ b/view/src/nsViewManager.h @@ -81,8 +81,6 @@ Composite() calls should also be forwarded to the root view manager. */ -class nsInvalidateEvent; - class nsViewManager : public nsIViewManager { public: nsViewManager(); @@ -142,7 +140,6 @@ public: NS_IMETHOD IsPainting(bool& aIsPainting); NS_IMETHOD GetLastUserEventTime(PRUint32& aTime); - void ProcessInvalidateEvent(); static PRUint32 gLastUserEventTime; /* Update the cached RootViewManager pointer on this view manager. */ @@ -259,8 +256,6 @@ private: // never null (if we have no ancestors, it will be |this|). nsViewManager *mRootViewManager; - nsRevocableEventPtr mInvalidateEvent; - // The following members should not be accessed directly except by // the root view manager. Some have accessor functions to enforce // this, as noted. @@ -281,24 +276,6 @@ private: //list of view managers static nsVoidArray *gViewManagers; - - void PostInvalidateEvent(); -}; - -class nsInvalidateEvent : public nsRunnable { -public: - nsInvalidateEvent(class nsViewManager *vm) : mViewManager(vm) { - NS_ASSERTION(mViewManager, "null parameter"); - } - void Revoke() { mViewManager = nsnull; } - - NS_IMETHOD Run() { - if (mViewManager) - mViewManager->ProcessInvalidateEvent(); - return NS_OK; - } -protected: - class nsViewManager *mViewManager; }; #endif /* nsViewManager_h___ */