Added a CreateLoadInfo to nsIDocShell to facilitate creating a loadInfo object without having to go through xpcom. This also allows the docshell to do any setup it may need to do.

git-svn-id: svn://10.0.0.236/trunk@64601 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
tbogard%aol.net
2000-03-30 12:52:02 +00:00
parent 4990287698
commit e00bf6eecd
4 changed files with 25 additions and 4 deletions

View File

@@ -21,7 +21,6 @@
* Pierre Phaneuf <pp@ludusdesign.com>
*/
#include "nsDocShell.h"
#include "nsIComponentManager.h"
#include "nsIContent.h"
#include "nsIDocument.h"
@@ -43,6 +42,10 @@
#include "nsGfxCIID.h"
#include "nsIPrompt.h" // as long as ReportScriptError raises an alert box.
// Local Includes
#include "nsDocShell.h"
#include "nsDocShellLoadInfo.h"
// Interfaces Needed
#include "nsIGlobalHistory.h"
#include "nsIHTTPChannel.h"
@@ -195,6 +198,17 @@ NS_IMETHODIMP nsDocShell::LoadURI(nsIURI* aURI, nsIURI* aReferrer)
return NS_OK;
}
NS_IMETHODIMP nsDocShell::CreateLoadInfo(nsIDocShellLoadInfo** aLoadInfo)
{
nsDocShellLoadInfo* loadInfo = new nsDocShellLoadInfo();
NS_ENSURE_TRUE(loadInfo, NS_ERROR_OUT_OF_MEMORY);
nsCOMPtr<nsIDocShellLoadInfo> localRef(loadInfo);
*aLoadInfo = localRef;
NS_ADDREF(*aLoadInfo);
return NS_OK;
}
NS_IMETHODIMP nsDocShell::StopLoad()
{
if(mLoadCookie)

View File

@@ -46,7 +46,7 @@ NS_IMPL_RELEASE(nsDocShellLoadInfo)
NS_INTERFACE_MAP_BEGIN(nsDocShellLoadInfo)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDocShellLoadInfo)
NS_INTERFACE_MAP_ENTRY(nsIDocShellLoadInfo)
NS_INTERFACE_MAP_END
NS_INTERFACE_MAP_END
//*****************************************************************************
// nsDocShellLoadInfo::nsIDocShellLoadInfo

View File

@@ -35,12 +35,12 @@
class nsDocShellLoadInfo : public nsIDocShellLoadInfo
{
public:
NS_DECL_ISUPPORTS
nsDocShellLoadInfo();
NS_DECL_ISUPPORTS
NS_DECL_NSIDOCSHELLLOADINFO
protected:
nsDocShellLoadInfo();
virtual ~nsDocShellLoadInfo();
protected:

View File

@@ -42,6 +42,7 @@
interface nsIChromeEventHandler;
interface nsIDocumentLoaderObserver;
interface nsIDocShellLoadInfo;
[scriptable, uuid(69E5DE00-7B8B-11d3-AF61-00A024FFC08C)]
interface nsIDocShell : nsISupports
@@ -59,6 +60,12 @@ interface nsIDocShell : nsISupports
*/
[noscript]void loadURI(in nsIURI uri, in nsIURI referrer);
/*
Creates a DocShellLoadInfo object that you can manipulate and then pass to
loadURI.
*/
void createLoadInfo(out nsIDocShellLoadInfo loadInfo);
/*
Stops a current load. This simply stops the network portion of the load.
If you wish to do a complete stop, then you should us the