Fix for bug # 55055. Save CacheKey in SH for postdata results r=adamlock sr=rpotts

This commit is contained in:
radha%netscape.com 2005-08-18 11:16:09 +00:00
Родитель 6c2bfcf3c2
Коммит 2862a68f37
3 изменённых файлов: 35 добавлений и 12 удалений

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

@ -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);

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

@ -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;

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

@ -55,7 +55,7 @@ protected:
private:
nsCOMPtr<nsIURI> mURI;
nsCOMPtr<nsIURI> mURI;
nsCOMPtr<nsIDOMDocument> mDocument;
nsString mTitle;
nsCOMPtr<nsIInputStream> mPostData;
@ -63,8 +63,9 @@ private:
nsVoidArray mChildren;
PRUint32 mLoadType;
PRUint32 mID;
PRBool mIsFrameNavigation;
nsISHEntry * mParent; // weak reference
PRBool mIsFrameNavigation;
nsCOMPtr<nsISupports> mCacheKey;
nsISHEntry * mParent; // weak reference
};