From 7bf7fbfa732b49c7f272ccf49ca580038542c4c3 Mon Sep 17 00:00:00 2001 From: "radha%netscape.com" Date: Fri, 13 Apr 2001 22:19:21 +0000 Subject: [PATCH] Fix for bug # 55055. Save CacheKey in SH for postdata results r=adamlock sr=rpotts --- .../components/shistory/public/nsISHEntry.idl | 6 +++- xpfe/components/shistory/src/nsSHEntry.cpp | 34 ++++++++++++++----- xpfe/components/shistory/src/nsSHEntry.h | 7 ++-- 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/xpfe/components/shistory/public/nsISHEntry.idl b/xpfe/components/shistory/public/nsISHEntry.idl index 4b6eac8b176b..7fc400d0d9ab 100644 --- a/xpfe/components/shistory/public/nsISHEntry.idl +++ b/xpfe/components/shistory/public/nsISHEntry.idl @@ -68,9 +68,13 @@ attribute unsigned long loadType; */ attribute unsigned long ID; +/** attribute to set and get the cache key for the entry */ +attribute nsISupports cacheKey; + /** Additional ways to create an entry */ void create(in nsIURI aURI, in wstring aTitle, in nsIDOMDocument aDocument, - in nsIInputStream aInputStream, in nsILayoutHistoryState aHistoryLayoutState); + in nsIInputStream aInputStream, in nsILayoutHistoryState aHistoryLayoutState, + in nsISupports aCacheKey); /** Attribute that indicates if this entry is for a subframe navigation */ void SetIsSubFrame(in boolean aFlag); diff --git a/xpfe/components/shistory/src/nsSHEntry.cpp b/xpfe/components/shistory/src/nsSHEntry.cpp index d66affde6681..9023d78e9cbc 100644 --- a/xpfe/components/shistory/src/nsSHEntry.cpp +++ b/xpfe/components/shistory/src/nsSHEntry.cpp @@ -193,23 +193,41 @@ NS_IMETHODIMP nsSHEntry::SetIsSubFrame(PRBool aFlag) mIsFrameNavigation = aFlag; return NS_OK; } + +NS_IMETHODIMP nsSHEntry::GetCacheKey(nsISupports** aResult) +{ + NS_ENSURE_ARG_POINTER(aResult); + + *aResult = mCacheKey; + NS_IF_ADDREF(*aResult); + return NS_OK; +} + +NS_IMETHODIMP nsSHEntry::SetCacheKey(nsISupports* aCacheKey) +{ + mCacheKey = aCacheKey; + return NS_OK; +} + nsresult nsSHEntry::Create(nsIURI * aURI, const PRUnichar * aTitle, nsIDOMDocument * aDOMDocument, - nsIInputStream * aInputStream, nsILayoutHistoryState * aHistoryLayoutState) + nsIInputStream * aInputStream, nsILayoutHistoryState * aHistoryLayoutState, + nsISupports * aCacheKey) { - SetURI(aURI); + SetURI(aURI); SetTitle(aTitle); SetDocument(aDOMDocument); SetPostData(aInputStream); SetLayoutHistoryState(aHistoryLayoutState); - - // Set the LoadType by default to loadHistory during creation + SetCacheKey(aCacheKey); + + // Set the LoadType by default to loadHistory during creation SetLoadType((PRInt32)nsIDocShellLoadInfo::loadHistory); - // By default all entries are set false for subframe flag. - // nsDocShell::CloneAndReplace() which creates entries for - // all subframe navigations, sets the flag to true. - SetIsSubFrame(PR_FALSE); + // By default all entries are set false for subframe flag. + // nsDocShell::CloneAndReplace() which creates entries for + // all subframe navigations, sets the flag to true. + SetIsSubFrame(PR_FALSE); return NS_OK; diff --git a/xpfe/components/shistory/src/nsSHEntry.h b/xpfe/components/shistory/src/nsSHEntry.h index 11d372941ba8..3a82b92177c7 100644 --- a/xpfe/components/shistory/src/nsSHEntry.h +++ b/xpfe/components/shistory/src/nsSHEntry.h @@ -55,7 +55,7 @@ protected: private: - nsCOMPtr mURI; + nsCOMPtr mURI; nsCOMPtr mDocument; nsString mTitle; nsCOMPtr mPostData; @@ -63,8 +63,9 @@ private: nsVoidArray mChildren; PRUint32 mLoadType; PRUint32 mID; - PRBool mIsFrameNavigation; - nsISHEntry * mParent; // weak reference + PRBool mIsFrameNavigation; + nsCOMPtr mCacheKey; + nsISHEntry * mParent; // weak reference };