From 5144bf31998b416c984494ea1a5fa7b99ce1fc9d Mon Sep 17 00:00:00 2001 From: Justin Lebar Date: Mon, 31 Oct 2011 22:33:24 -0400 Subject: [PATCH] Bug 698656 - mParent pointer should be on nsSHEntry, not nsSHEntryShared. r=bz --- docshell/shistory/src/nsSHEntry.cpp | 5 +++-- docshell/shistory/src/nsSHEntry.h | 1 + docshell/shistory/src/nsSHEntryShared.cpp | 2 -- docshell/shistory/src/nsSHEntryShared.h | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docshell/shistory/src/nsSHEntry.cpp b/docshell/shistory/src/nsSHEntry.cpp index c3ce68d4c81a..cd4f4a61de9b 100644 --- a/docshell/shistory/src/nsSHEntry.cpp +++ b/docshell/shistory/src/nsSHEntry.cpp @@ -81,6 +81,7 @@ nsSHEntry::nsSHEntry(const nsSHEntry &other) , mID(other.mID) , mScrollPositionX(0) // XXX why not copy? , mScrollPositionY(0) // XXX why not copy? + , mParent(nsnull) , mURIWasModified(other.mURIWasModified) , mStateData(other.mStateData) { @@ -417,7 +418,7 @@ NS_IMETHODIMP nsSHEntry::GetParent(nsISHEntry ** aResult) { NS_ENSURE_ARG_POINTER(aResult); - *aResult = mShared->mParent; + *aResult = mParent; NS_IF_ADDREF(*aResult); return NS_OK; } @@ -430,7 +431,7 @@ nsSHEntry::SetParent(nsISHEntry * aParent) * * XXX this method should not be scriptable if this is the case!! */ - mShared->mParent = aParent; + mParent = aParent; return NS_OK; } diff --git a/docshell/shistory/src/nsSHEntry.h b/docshell/shistory/src/nsSHEntry.h index 4e3eeee29cd0..4525f6c680b3 100644 --- a/docshell/shistory/src/nsSHEntry.h +++ b/docshell/shistory/src/nsSHEntry.h @@ -90,6 +90,7 @@ private: PRUint32 mID; PRInt32 mScrollPositionX; PRInt32 mScrollPositionY; + nsISHEntry* mParent; nsCOMArray mChildren; bool mURIWasModified; nsCOMPtr mStateData; diff --git a/docshell/shistory/src/nsSHEntryShared.cpp b/docshell/shistory/src/nsSHEntryShared.cpp index ba8089d4e6dc..64e22b872324 100644 --- a/docshell/shistory/src/nsSHEntryShared.cpp +++ b/docshell/shistory/src/nsSHEntryShared.cpp @@ -93,7 +93,6 @@ nsSHEntryShared::Shutdown() nsSHEntryShared::nsSHEntryShared() : mDocShellID(0) - , mParent(nsnull) , mIsFrameNavigation(false) , mSaveLayoutState(true) , mSticky(true) @@ -136,7 +135,6 @@ nsSHEntryShared::Duplicate(nsSHEntryShared *aEntry) newEntry->mDocShellID = aEntry->mDocShellID; newEntry->mChildShells.AppendObjects(aEntry->mChildShells); newEntry->mOwner = aEntry->mOwner; - newEntry->mParent = aEntry->mParent; newEntry->mContentType.Assign(aEntry->mContentType); newEntry->mIsFrameNavigation = aEntry->mIsFrameNavigation; newEntry->mSaveLayoutState = aEntry->mSaveLayoutState; diff --git a/docshell/shistory/src/nsSHEntryShared.h b/docshell/shistory/src/nsSHEntryShared.h index 134079ef7086..fa13cffb45fc 100644 --- a/docshell/shistory/src/nsSHEntryShared.h +++ b/docshell/shistory/src/nsSHEntryShared.h @@ -99,7 +99,6 @@ class nsSHEntryShared : public nsIBFCacheEntry, PRUint64 mDocShellID; nsCOMArray mChildShells; nsCOMPtr mOwner; - nsISHEntry* mParent; nsCString mContentType; bool mIsFrameNavigation; bool mSaveLayoutState;