Changed the nsISHEntry interface to deal with layoutStateHistory in terms of a types nsILayoutHistoryState rather than just an nsISupports. Also changed the implementation to hold on to it with an nsCOMPtr rather than a raw pointer.
git-svn-id: svn://10.0.0.236/trunk@64974 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
d93b9c94c3
commit
e17906d5a3
@ -32,6 +32,8 @@
|
||||
#include "domstubs.idl"
|
||||
#include "nsIInputStream.idl"
|
||||
|
||||
interface nsILayoutHistoryState;
|
||||
|
||||
[scriptable, uuid(65281BA1-988A-11d3-BDC7-0050040A9B44)]
|
||||
interface nsISHEntry : nsISupports
|
||||
{
|
||||
@ -49,14 +51,14 @@ attribute wstring title;
|
||||
attribute nsIInputStream postData;
|
||||
|
||||
/** LayoutHistoryState for scroll position and form values */
|
||||
attribute nsISupports layoutHistoryState;
|
||||
attribute nsILayoutHistoryState layoutHistoryState;
|
||||
|
||||
/** Parent of the current entry */
|
||||
attribute nsISHEntry parent;
|
||||
|
||||
/** Additional ways to create an entry */
|
||||
void create(in nsIURI aURI, in wstring aTitle, in nsIDOMDocument aDocument,
|
||||
in nsIInputStream aInputStream, in nsISupports aHistoryLayoutState);
|
||||
in nsIInputStream aInputStream, in nsILayoutHistoryState aHistoryLayoutState);
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ mTitle = nsnull;
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSHEntry::Create(nsIURI * aURI, const PRUnichar * aTitle, nsIDOMDocument * aDOMDocument,
|
||||
nsIInputStream * aInputStream, nsISupports * aHistoryLayoutState)
|
||||
nsIInputStream * aInputStream, nsILayoutHistoryState * aHistoryLayoutState)
|
||||
{
|
||||
SetURI(aURI);
|
||||
SetTitle(aTitle);
|
||||
@ -96,7 +96,6 @@ nsSHEntry::~nsSHEntry()
|
||||
NS_IF_RELEASE(mURI);
|
||||
NS_IF_RELEASE(mPostData);
|
||||
NS_IF_RELEASE(mDocument);
|
||||
NS_IF_RELEASE(mLayoutHistoryState);
|
||||
if (mTitle)
|
||||
delete mTitle;
|
||||
|
||||
@ -200,20 +199,18 @@ nsSHEntry::SetPostData(nsIInputStream * aPostData)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSHEntry::GetLayoutHistoryState(nsISupports ** aResult)
|
||||
nsSHEntry::GetLayoutHistoryState(nsILayoutHistoryState ** aResult)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
*aResult = mLayoutHistoryState;
|
||||
NS_IF_ADDREF(mLayoutHistoryState);
|
||||
return NS_OK;
|
||||
NS_ENSURE_ARG_POINTER(aResult);
|
||||
*aResult = mLayoutHistoryState;
|
||||
NS_IF_ADDREF(*aResult);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSHEntry::SetLayoutHistoryState(nsISupports * aState)
|
||||
nsSHEntry::SetLayoutHistoryState(nsILayoutHistoryState * aState)
|
||||
{
|
||||
NS_IF_RELEASE(mLayoutHistoryState);
|
||||
mLayoutHistoryState = aState;
|
||||
NS_IF_ADDREF(aState);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
#include "nsISHContainer.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsString.h"
|
||||
#include "nsILayoutHistoryState.h"
|
||||
|
||||
class nsSHEnumerator;
|
||||
class nsSHEntry : public nsISHEntry,
|
||||
@ -53,7 +54,7 @@ private:
|
||||
nsIDOMDocument * mDocument;
|
||||
nsString * mTitle;
|
||||
nsIInputStream * mPostData;
|
||||
nsISupports * mLayoutHistoryState;
|
||||
nsCOMPtr<nsILayoutHistoryState> mLayoutHistoryState;
|
||||
nsVoidArray mChildren;
|
||||
nsISHEntry * mParent; // weak reference to parent
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
#include "nsIGenericFactory.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsString.h"
|
||||
#include "nsILayoutHistoryState.h"
|
||||
|
||||
|
||||
#ifdef XXX_NS_DEBUG // XXX: we'll need a logging facility for debugging
|
||||
@ -225,7 +226,7 @@ nsSHistory::PrintHistory()
|
||||
if (!NS_SUCCEEDED(rv) && !entry)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsISupports> layoutHistoryState;
|
||||
nsCOMPtr<nsILayoutHistoryState> layoutHistoryState;
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
PRUnichar * title;
|
||||
char * titleCStr=nsnull;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user