diff --git a/docshell/shistory/public/nsISHEntry.idl b/docshell/shistory/public/nsISHEntry.idl index 0a655ded051..6eec094c446 100644 --- a/docshell/shistory/public/nsISHEntry.idl +++ b/docshell/shistory/public/nsISHEntry.idl @@ -100,6 +100,8 @@ void create(in nsIURI aURI, in wstring aTitle, in nsIDOMDocument aDocument, in nsIInputStream aInputStream, in nsILayoutHistoryState aHistoryLayoutState, in nsISupports aCacheKey); +nsISHEntry clone(); + /** Attribute that indicates if this entry is for a subframe navigation */ void SetIsSubFrame(in boolean aFlag); diff --git a/docshell/shistory/src/nsSHEntry.cpp b/docshell/shistory/src/nsSHEntry.cpp index baa0bca0eab..09f512ca6d7 100644 --- a/docshell/shistory/src/nsSHEntry.cpp +++ b/docshell/shistory/src/nsSHEntry.cpp @@ -253,7 +253,7 @@ NS_IMETHODIMP nsSHEntry::SetExpirationStatus(PRBool aFlag) return NS_OK; } -nsresult +NS_IMETHODIMP nsSHEntry::Create(nsIURI * aURI, const PRUnichar * aTitle, nsIDOMDocument * aDOMDocument, nsIInputStream * aInputStream, nsILayoutHistoryState * aHistoryLayoutState, nsISupports * aCacheKey) @@ -283,6 +283,37 @@ nsSHEntry::Create(nsIURI * aURI, const PRUnichar * aTitle, nsIDOMDocument * aDOM } +NS_IMETHODIMP +nsSHEntry::Clone(nsISHEntry ** aResult) +{ + nsresult rv; + nsSHEntry *dest; + + dest = new nsSHEntry(); + if (!dest) { + return NS_ERROR_OUT_OF_MEMORY; + } + NS_ADDREF(dest); + + dest->SetURI(mURI); + dest->SetReferrerURI(mReferrerURI); + dest->SetPostData(mPostData); + dest->SetLayoutHistoryState(mLayoutHistoryState); + dest->SetTitle(mTitle.get()); + dest->SetParent(mParent); + dest->SetID(mID); + dest->SetIsSubFrame(mIsFrameNavigation); + dest->SetExpirationStatus(mExpired); + dest->SetSaveLayoutStateFlag(mSaveLayoutState); + dest->SetCacheKey(mCacheKey); + + rv = dest->QueryInterface(NS_GET_IID(nsISHEntry), (void**) aResult); + NS_RELEASE(dest); + + return rv; +} + + NS_IMETHODIMP nsSHEntry::GetParent(nsISHEntry ** aResult) {