printf("Time spent in PresShell::ProcessReflowCommands(), this=%p, time=%d micro seconds\n", this, mAccumulatedReflowTime);
PRINTF("Time spent in PresShell::ProcessReflowCommands(), this=%p, time=%d micro seconds\n", this, mAccumulatedReflowTime);
PresShell::ProcessReflowCommands(PRBool aInterruptible){  MOZ_TIMER_DEBUGLOG(("Start: Reflow: PresShell::ProcessReflowCommands(), this=%p\n", this));  MOZ_TIMER_START(mReflowWatch);    PRTime beforeReflow, afterReflow;  PRInt64 diff;      if (0 != mReflowCommands.Count()) {    nsHTMLReflowMetrics   desiredSize(nsnull);    nsIRenderingContext*  rcx;    nsIFrame*             rootFrame;            mFrameManager->GetRootFrame(&rootFrame);    nsresult rv=CreateRenderingContext(rootFrame, &rcx);	  if (NS_FAILED(rv)) return rv;#ifdef DEBUG    if (GetVerifyReflowEnable()) {      if (VERIFY_REFLOW_ALL & gVerifyReflowFlags) {        printf("ProcessReflowCommands: begin incremental reflow\n");      }    }    if (VERIFY_REFLOW_DUMP_COMMANDS & gVerifyReflowFlags) {         PRInt32 i, n = mReflowCommands.Count();      printf("\nPresShell::ProcessReflowCommands: this=%p, count=%d\n", this, n);      for (i = 0; i < n; i++) {        nsIReflowCommand* rc = (nsIReflowCommand*)          mReflowCommands.ElementAt(i);        rc->List(stdout);      }    }#endif        mIsReflowing = PR_TRUE;    while (0 != mReflowCommands.Count()) {      // Use RemoveElementAt in case the reflowcommand dispatches a      // new one during its execution.      nsIReflowCommand* rc = (nsIReflowCommand*) mReflowCommands.ElementAt(0);      mReflowCommands.RemoveElementAt(0);      // Dispatch the reflow command      nsSize          maxSize;      rootFrame->GetSize(maxSize);      if (aInterruptible) beforeReflow = PR_Now();      rc->Dispatch(mPresContext, desiredSize, maxSize, *rcx); // dispatch the reflow command      if (aInterruptible) afterReflow = PR_Now();      ReflowCommandRemoved(rc);      NS_RELEASE(rc);      VERIFY_STYLE_TREE;      if (aInterruptible) {        PRInt64 totalTime;        PRInt64 maxTime;        LL_SUB(diff, afterReflow, beforeReflow);        LL_I2L(totalTime, mAccumulatedReflowTime);        LL_ADD(totalTime, totalTime, diff);        LL_L2I(mAccumulatedReflowTime, totalTime);        LL_I2L(maxTime, gMaxRCProcessingTime);        if (LL_CMP(totalTime, >, maxTime))          break;                }    }    NS_IF_RELEASE(rcx);    mIsReflowing = PR_FALSE;    if (aInterruptible) {      if (mReflowCommands.Count() > 0) {        // Reflow Commands are still queued up.        // Schedule a reflow event to handle them asynchronously.        PostReflowEvent();      }#ifdef DEBUG      if (VERIFY_REFLOW_DUMP_COMMANDS & gVerifyReflowFlags) {                printf("Time spent in PresShell::ProcessReflowCommands(), this=%p, time=%d micro seconds\n",           this, mAccumulatedReflowTime);      }#endif      mAccumulatedReflowTime = 0;    }    #ifdef DEBUG    if (VERIFY_REFLOW_DUMP_COMMANDS & gVerifyReflowFlags) {      printf("\nPresShell::ProcessReflowCommands() finished: this=%p\n", this);    }    if (nsIFrameDebug::GetVerifyTreeEnable()) {      nsIFrameDebug*  frameDebug;      if (NS_SUCCEEDED(rootFrame->QueryInterface(NS_GET_IID(nsIFrameDebug),                                                 (void**)&frameDebug))) {        frameDebug->VerifyTree();      }    }    if (GetVerifyReflowEnable()) {      // First synchronously render what we have so far so that we can      // see it.      nsIView* rootView;      mViewManager->GetRootView(rootView);      mViewManager->UpdateView(rootView, NS_VMREFRESH_IMMEDIATE);      mInVerifyReflow = PR_TRUE;      PRBool ok = VerifyIncrementalReflow();      mInVerifyReflow = PR_FALSE;      if (VERIFY_REFLOW_ALL & gVerifyReflowFlags) {        printf("ProcessReflowCommands: finished (%s)\n",               ok ? "ok" : "failed");      }      if (0 != mReflowCommands.Count()) {        printf("XXX yikes! reflow commands queued during verify-reflow\n");      }    }#endif  }    MOZ_TIMER_DEBUGLOG(("Stop: Reflow: PresShell::ProcessReflowCommands(), this=%p\n", this));  MOZ_TIMER_STOP(mReflowWatch);    HandlePostedDOMEvents();  HandlePostedAttributeChanges();  HandlePostedReflowCallbacks();  return NS_OK;}