Fix for bug 115162 -- shrink data structures by converting PRBool to PRPackedBool. r=dp, sr=waterson

This commit is contained in:
sfraser%netscape.com 2001-12-14 23:13:08 +00:00
Родитель 383894bcd3
Коммит 2d9ef098bb
12 изменённых файлов: 110 добавлений и 86 удалений

Просмотреть файл

@ -1153,25 +1153,27 @@ protected:
// these are the same Document and PresContext owned by the DocViewer.
// we must share ownership.
nsCOMPtr<nsIDocument> mDocument;
nsCOMPtr<nsIPresContext> mPresContext;
nsCOMPtr<nsIStyleSet> mStyleSet;
nsICSSStyleSheet* mPrefStyleSheet; // mStyleSet owns it but we maintaina ref, may be null
PRPackedBool mEnablePrefStyleSheet;
nsIViewManager* mViewManager; // [WEAK] docViewer owns it so I don't have to
nsWeakPtr mHistoryState; // [WEAK] session history owns this
PRUint32 mUpdateCount;
nsCOMPtr<nsIDocument> mDocument;
nsCOMPtr<nsIPresContext> mPresContext;
nsCOMPtr<nsIStyleSet> mStyleSet;
nsICSSStyleSheet* mPrefStyleSheet; // mStyleSet owns it but we maintaina ref, may be null
nsIViewManager* mViewManager; // [WEAK] docViewer owns it so I don't have to
nsWeakPtr mHistoryState; // [WEAK] session history owns this
PRUint32 mUpdateCount;
// normal reflow commands
nsVoidArray mReflowCommands;
nsVoidArray mReflowCommands;
// reflow commands targeted at each aFrame who calls SendInterruptNotificationTo(aFrame, Timeout);
nsVoidArray mTimeoutReflowCommands;
nsVoidArray mTimeoutReflowCommands;
PRPackedBool mEnablePrefStyleSheet;
PRPackedBool mDocumentLoading;
PRPackedBool mIsReflowing;
PRPackedBool mIsDestroying;
PRPackedBool mDidInitialReflow;
PRPackedBool mIgnoreFrameDestruction;
nsIFrame* mCurrentEventFrame;
nsIFrame* mCurrentEventFrame;
nsIContent* mCurrentEventContent;
nsVoidArray mCurrentEventFrameStack;
nsVoidArray mCurrentEventContentStack;
@ -1184,16 +1186,16 @@ protected:
nsCOMPtr<nsIFrameSelection> mSelection;
nsCOMPtr<nsICaret> mCaret;
PRBool mDisplayNonTextSelection;
PRBool mScrollingEnabled; //used to disable programmable scrolling from outside
PRPackedBool mDisplayNonTextSelection;
PRPackedBool mScrollingEnabled; //used to disable programmable scrolling from outside
PRPackedBool mPendingReflowEvent;
PRPackedBool mBatchReflows; // When set to true, the pres shell batches reflow commands.
nsIFrameManager* mFrameManager; // we hold a reference
PresShellViewEventListener *mViewEventListener;
PRBool mPendingReflowEvent;
nsCOMPtr<nsIEventQueue> mEventQueue;
FrameArena mFrameArena;
StackArena* mStackArena;
PRInt32 mAccumulatedReflowTime; // Time spent in reflow command processing so far
PRPackedBool mBatchReflows; // When set to true, the pres shell batches reflow commands.
nsCOMPtr<nsIObserverService> mObserverService; // Observer service for reflow events
nsCOMPtr<nsIDragService> mDragService;
PRInt32 mRCCreatedDuringLoad; // Counter to keep track of reflow commands created during doc
@ -1208,12 +1210,12 @@ protected:
nsCallbackEventRequest* mFirstCallbackEventRequest;
nsCallbackEventRequest* mLastCallbackEventRequest;
PRBool mIsDocumentGone; // We've been disconnected from the document.
PRBool mPaintingSuppressed; // For all documents we initially lock down painting.
// We will refuse to paint the document until either
// (a) our timer fires or (b) all frames are constructed.
PRBool mShouldUnsuppressPainting; // Indicates that it is safe to unlock painting once all pending
// reflows have been processed.
PRPackedBool mIsDocumentGone; // We've been disconnected from the document.
PRPackedBool mPaintingSuppressed; // For all documents we initially lock down painting.
// We will refuse to paint the document until either
// (a) our timer fires or (b) all frames are constructed.
PRPackedBool mShouldUnsuppressPainting; // Indicates that it is safe to unlock painting once all pending
// reflows have been processed.
nsCOMPtr<nsITimer> mPaintSuppressionTimer; // This timer controls painting suppression. Until it fires
// or all frames are constructed, we won't paint anything but
// our <body> background and scrollbars.

Просмотреть файл

@ -230,34 +230,42 @@ protected:
nscoord mMinimumFontSize;
PRInt32 mFontScaler;
PRPackedBool mUseDocumentFonts; // set in GetUserPrefs
nscolor mDefaultColor; // set in GetUserPrefs
nscolor mDefaultBackgroundColor; // set in GetUserPrefs
PRPackedBool mUseDocumentColors; // set in GetUserPrefs
nscolor mLinkColor; // set in GetUserPrefs
nscolor mVisitedLinkColor; // set in GetUserPrefs
PRPackedBool mUnderlineLinks; // set in GetUserPrefs
PRPackedBool mUseFocusColors; // set in GetUserPrefs
nscolor mDefaultColor; // set in GetUserPrefs
nscolor mDefaultBackgroundColor; // set in GetUserPrefs
nscolor mLinkColor; // set in GetUserPrefs
nscolor mVisitedLinkColor; // set in GetUserPrefs
nscolor mFocusTextColor; // set in GetUserPrefs
nscolor mFocusBackgroundColor; // set in GetUserPrefs
PRUint8 mFocusRingWidth; // set in GetUserPrefs
PRPackedBool mFocusRingOnAnything; // set in GetUserPrefs
nsString mDefaultBackgroundImage;
PRPackedBool mDrawBackground;
PRUint8 mDefaultBackgroundImageAttachment;
PRUint8 mDefaultBackgroundImageRepeat;
nscoord mDefaultBackgroundImageOffsetX;
nscoord mDefaultBackgroundImageOffsetY;
PRUint8 mDefaultBackgroundImageAttachment;
PRBool mDrawBackground;
nsString mDefaultBackgroundImage;
nsSupportsHashtable mImageLoaders;
nsCOMPtr<nsIEventStateManager> mEventManager;
nsCOMPtr<nsIURI> mBaseURL;
nsCompatibility mCompatibilityMode;
PRPackedBool mCompatibilityLocked;
nsWidgetRendering mWidgetRenderingMode;
PRUint16 mImageAnimationMode;
PRPackedBool mImageAnimationStopped; // image animation stopped
PRUint16 mImageAnimationMode;
PRPackedBool mStopped; // loading stopped
PRPackedBool mStopChrome; // should we stop chrome?
#ifdef IBMBIDI

Просмотреть файл

@ -193,14 +193,14 @@ public:
nsIScrollableView* mScrollableView;
nsSize mMaxElementSize;
PRBool mNeverHasVerticalScrollbar;
PRBool mNeverHasHorizontalScrollbar;
PRPackedBool mNeverHasVerticalScrollbar;
PRPackedBool mNeverHasHorizontalScrollbar;
PRBool mHasVerticalScrollbar;
PRBool mHasHorizontalScrollbar;
PRBool mFirstPass;
PRBool mIsRoot;
PRBool mNeverReflowed;
PRPackedBool mHasVerticalScrollbar;
PRPackedBool mHasHorizontalScrollbar;
PRPackedBool mFirstPass;
PRPackedBool mIsRoot;
PRPackedBool mNeverReflowed;
};
NS_IMPL_ISUPPORTS2(nsGfxScrollFrameInner, nsIDocumentObserver, nsIScrollPositionListener)
@ -968,7 +968,9 @@ nsGfxScrollFrameInner::AddRemoveScrollbar(nsBoxLayoutState& aState, nsRect& aScr
if (!aAdd)
SetScrollbarVisibility(mHScrollbarBox, aAdd);
PRBool fit = AddRemoveScrollbar(mHasHorizontalScrollbar, aScrollAreaSize.y, aScrollAreaSize.height, hSize.height, aOnTop, aAdd);
PRBool hasHorizontalScrollbar;
PRBool fit = AddRemoveScrollbar(hasHorizontalScrollbar, aScrollAreaSize.y, aScrollAreaSize.height, hSize.height, aOnTop, aAdd);
mHasHorizontalScrollbar = hasHorizontalScrollbar; // because mHasHorizontalScrollbar is a PRPackedBool
if (!fit)
SetScrollbarVisibility(mHScrollbarBox, !aAdd);
@ -987,7 +989,9 @@ nsGfxScrollFrameInner::AddRemoveScrollbar(nsBoxLayoutState& aState, nsRect& aScr
SetScrollbarVisibility(mVScrollbarBox, aAdd);
nsBox::AddMargin(mVScrollbarBox, vSize);
PRBool fit = AddRemoveScrollbar(mHasVerticalScrollbar, aScrollAreaSize.x, aScrollAreaSize.width, vSize.width, aOnTop, aAdd);
PRBool hasVerticalScrollbar;
PRBool fit = AddRemoveScrollbar(hasVerticalScrollbar, aScrollAreaSize.x, aScrollAreaSize.width, vSize.width, aOnTop, aAdd);
mHasVerticalScrollbar = hasVerticalScrollbar; // because mHasVerticalScrollbar is a PRPackedBool
if (!fit)
SetScrollbarVisibility(mVScrollbarBox, !aAdd);

Просмотреть файл

@ -246,7 +246,7 @@ private:
PRPackedBool mCanSendLoadEvent;
PRPackedBool mImageBlocked; // true if the image has been blocked
PRBool mFailureReplace;
PRPackedBool mFailureReplace;
nsMargin mBorderPadding;
PRUint32 mNaturalImageWidth,

Просмотреть файл

@ -94,9 +94,9 @@ public:
nsCOMPtr<nsIContent> mArea;
nscoord* mCoords;
PRInt32 mNumCoords;
PRBool mSuppressFeedback;
PRBool mHasURL;
PRBool mHasFocus;
PRPackedBool mSuppressFeedback;
PRPackedBool mHasURL;
PRPackedBool mHasFocus;
nsIFrame* mImageFrame;
};

Просмотреть файл

@ -193,14 +193,14 @@ public:
nsIScrollableView* mScrollableView;
nsSize mMaxElementSize;
PRBool mNeverHasVerticalScrollbar;
PRBool mNeverHasHorizontalScrollbar;
PRPackedBool mNeverHasVerticalScrollbar;
PRPackedBool mNeverHasHorizontalScrollbar;
PRBool mHasVerticalScrollbar;
PRBool mHasHorizontalScrollbar;
PRBool mFirstPass;
PRBool mIsRoot;
PRBool mNeverReflowed;
PRPackedBool mHasVerticalScrollbar;
PRPackedBool mHasHorizontalScrollbar;
PRPackedBool mFirstPass;
PRPackedBool mIsRoot;
PRPackedBool mNeverReflowed;
};
NS_IMPL_ISUPPORTS2(nsGfxScrollFrameInner, nsIDocumentObserver, nsIScrollPositionListener)
@ -968,7 +968,9 @@ nsGfxScrollFrameInner::AddRemoveScrollbar(nsBoxLayoutState& aState, nsRect& aScr
if (!aAdd)
SetScrollbarVisibility(mHScrollbarBox, aAdd);
PRBool fit = AddRemoveScrollbar(mHasHorizontalScrollbar, aScrollAreaSize.y, aScrollAreaSize.height, hSize.height, aOnTop, aAdd);
PRBool hasHorizontalScrollbar;
PRBool fit = AddRemoveScrollbar(hasHorizontalScrollbar, aScrollAreaSize.y, aScrollAreaSize.height, hSize.height, aOnTop, aAdd);
mHasHorizontalScrollbar = hasHorizontalScrollbar; // because mHasHorizontalScrollbar is a PRPackedBool
if (!fit)
SetScrollbarVisibility(mHScrollbarBox, !aAdd);
@ -987,7 +989,9 @@ nsGfxScrollFrameInner::AddRemoveScrollbar(nsBoxLayoutState& aState, nsRect& aScr
SetScrollbarVisibility(mVScrollbarBox, aAdd);
nsBox::AddMargin(mVScrollbarBox, vSize);
PRBool fit = AddRemoveScrollbar(mHasVerticalScrollbar, aScrollAreaSize.x, aScrollAreaSize.width, vSize.width, aOnTop, aAdd);
PRBool hasVerticalScrollbar;
PRBool fit = AddRemoveScrollbar(hasVerticalScrollbar, aScrollAreaSize.x, aScrollAreaSize.width, vSize.width, aOnTop, aAdd);
mHasVerticalScrollbar = hasVerticalScrollbar; // because mHasVerticalScrollbar is a PRPackedBool
if (!fit)
SetScrollbarVisibility(mVScrollbarBox, !aAdd);

Просмотреть файл

@ -246,7 +246,7 @@ private:
PRPackedBool mCanSendLoadEvent;
PRPackedBool mImageBlocked; // true if the image has been blocked
PRBool mFailureReplace;
PRPackedBool mFailureReplace;
nsMargin mBorderPadding;
PRUint32 mNaturalImageWidth,

Просмотреть файл

@ -94,9 +94,9 @@ public:
nsCOMPtr<nsIContent> mArea;
nscoord* mCoords;
PRInt32 mNumCoords;
PRBool mSuppressFeedback;
PRBool mHasURL;
PRBool mHasFocus;
PRPackedBool mSuppressFeedback;
PRPackedBool mHasURL;
PRPackedBool mHasFocus;
nsIFrame* mImageFrame;
};

Просмотреть файл

@ -1153,25 +1153,27 @@ protected:
// these are the same Document and PresContext owned by the DocViewer.
// we must share ownership.
nsCOMPtr<nsIDocument> mDocument;
nsCOMPtr<nsIPresContext> mPresContext;
nsCOMPtr<nsIStyleSet> mStyleSet;
nsICSSStyleSheet* mPrefStyleSheet; // mStyleSet owns it but we maintaina ref, may be null
PRPackedBool mEnablePrefStyleSheet;
nsIViewManager* mViewManager; // [WEAK] docViewer owns it so I don't have to
nsWeakPtr mHistoryState; // [WEAK] session history owns this
PRUint32 mUpdateCount;
nsCOMPtr<nsIDocument> mDocument;
nsCOMPtr<nsIPresContext> mPresContext;
nsCOMPtr<nsIStyleSet> mStyleSet;
nsICSSStyleSheet* mPrefStyleSheet; // mStyleSet owns it but we maintaina ref, may be null
nsIViewManager* mViewManager; // [WEAK] docViewer owns it so I don't have to
nsWeakPtr mHistoryState; // [WEAK] session history owns this
PRUint32 mUpdateCount;
// normal reflow commands
nsVoidArray mReflowCommands;
nsVoidArray mReflowCommands;
// reflow commands targeted at each aFrame who calls SendInterruptNotificationTo(aFrame, Timeout);
nsVoidArray mTimeoutReflowCommands;
nsVoidArray mTimeoutReflowCommands;
PRPackedBool mEnablePrefStyleSheet;
PRPackedBool mDocumentLoading;
PRPackedBool mIsReflowing;
PRPackedBool mIsDestroying;
PRPackedBool mDidInitialReflow;
PRPackedBool mIgnoreFrameDestruction;
nsIFrame* mCurrentEventFrame;
nsIFrame* mCurrentEventFrame;
nsIContent* mCurrentEventContent;
nsVoidArray mCurrentEventFrameStack;
nsVoidArray mCurrentEventContentStack;
@ -1184,16 +1186,16 @@ protected:
nsCOMPtr<nsIFrameSelection> mSelection;
nsCOMPtr<nsICaret> mCaret;
PRBool mDisplayNonTextSelection;
PRBool mScrollingEnabled; //used to disable programmable scrolling from outside
PRPackedBool mDisplayNonTextSelection;
PRPackedBool mScrollingEnabled; //used to disable programmable scrolling from outside
PRPackedBool mPendingReflowEvent;
PRPackedBool mBatchReflows; // When set to true, the pres shell batches reflow commands.
nsIFrameManager* mFrameManager; // we hold a reference
PresShellViewEventListener *mViewEventListener;
PRBool mPendingReflowEvent;
nsCOMPtr<nsIEventQueue> mEventQueue;
FrameArena mFrameArena;
StackArena* mStackArena;
PRInt32 mAccumulatedReflowTime; // Time spent in reflow command processing so far
PRPackedBool mBatchReflows; // When set to true, the pres shell batches reflow commands.
nsCOMPtr<nsIObserverService> mObserverService; // Observer service for reflow events
nsCOMPtr<nsIDragService> mDragService;
PRInt32 mRCCreatedDuringLoad; // Counter to keep track of reflow commands created during doc
@ -1208,12 +1210,12 @@ protected:
nsCallbackEventRequest* mFirstCallbackEventRequest;
nsCallbackEventRequest* mLastCallbackEventRequest;
PRBool mIsDocumentGone; // We've been disconnected from the document.
PRBool mPaintingSuppressed; // For all documents we initially lock down painting.
// We will refuse to paint the document until either
// (a) our timer fires or (b) all frames are constructed.
PRBool mShouldUnsuppressPainting; // Indicates that it is safe to unlock painting once all pending
// reflows have been processed.
PRPackedBool mIsDocumentGone; // We've been disconnected from the document.
PRPackedBool mPaintingSuppressed; // For all documents we initially lock down painting.
// We will refuse to paint the document until either
// (a) our timer fires or (b) all frames are constructed.
PRPackedBool mShouldUnsuppressPainting; // Indicates that it is safe to unlock painting once all pending
// reflows have been processed.
nsCOMPtr<nsITimer> mPaintSuppressionTimer; // This timer controls painting suppression. Until it fires
// or all frames are constructed, we won't paint anything but
// our <body> background and scrollbars.

Просмотреть файл

@ -144,16 +144,17 @@ private:
nsCOMPtr<imgIDecoderObserver> mListener;
nsString mSrc; // The raw image source.
PRBool mUseSrcAttr; // Whether or not the image src comes from an attribute.
PRPackedBool mUseSrcAttr; // Whether or not the image src comes from an attribute.
PRPackedBool mSizeFrozen;
PRPackedBool mHasImage;
nsRect mSubRect; // If set, indicates that only the portion of the image specified by the rect should be used.
nsSize mIntrinsicSize;
PRInt32 mLoadFlags;
PRBool mSizeFrozen;
nsSize mImageSize;
PRBool mHasImage;
}; // class nsImageBoxFrame

Просмотреть файл

@ -173,9 +173,12 @@ nsMenuPopupFrame::Init(nsIPresContext* aPresContext,
nsCOMPtr<nsILookAndFeel> lookAndFeel;
nsComponentManager::CreateInstance(kLookAndFeelCID, nsnull, NS_GET_IID(nsILookAndFeel),
getter_AddRefs(lookAndFeel));
if ( lookAndFeel )
lookAndFeel->GetMetric(nsILookAndFeel::eMetric_MenusCanOverlapOSBar, mMenuCanOverlapOSBar);
if ( lookAndFeel ) {
PRBool tempBool;
lookAndFeel->GetMetric(nsILookAndFeel::eMetric_MenusCanOverlapOSBar, tempBool);
mMenuCanOverlapOSBar = tempBool;
}
// XXX Hack
mPresContext = aPresContext;

Просмотреть файл

@ -211,12 +211,12 @@ protected:
nsIMenuFrame* mTimerMenu; // A menu awaiting closure.
nsCOMPtr<nsITimer> mCloseTimer; // Close timer.
PRBool mIsContextMenu; // is this a context menu?
PRPackedBool mIsContextMenu; // is this a context menu?
PRBool mMenuCanOverlapOSBar; // can we appear over the taskbar/menubar?
PRPackedBool mMenuCanOverlapOSBar; // can we appear over the taskbar/menubar?
PRBool mShouldAutoPosition; // Should SyncViewWithFrame be allowed to auto position popup?
PRBool mShouldRollup; // Should this menupopup be allowed to dismiss automatically?
PRPackedBool mShouldAutoPosition; // Should SyncViewWithFrame be allowed to auto position popup?
PRPackedBool mShouldRollup; // Should this menupopup be allowed to dismiss automatically?
}; // class nsMenuPopupFrame