зеркало из https://github.com/mozilla/gecko-dev.git
Part of docshell/webshell landing prep work. The doc loader is being re-factored into the uri loader.
api synch of changes to nsIURIContentListener r=travis
This commit is contained in:
Родитель
96ecbd01d2
Коммит
83287af82d
|
@ -22,6 +22,7 @@
|
||||||
|
|
||||||
#include "nsDocShell.h"
|
#include "nsDocShell.h"
|
||||||
#include "nsDSURIContentListener.h"
|
#include "nsDSURIContentListener.h"
|
||||||
|
#include "nsIChannel.h"
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
//*** nsDSURIContentListener: Object Management
|
//*** nsDSURIContentListener: Object Management
|
||||||
|
@ -103,6 +104,39 @@ NS_IMETHODIMP nsDSURIContentListener::CanHandleContent(const char* aContentType,
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsDSURIContentListener::GetParentContentListener(nsIURIContentListener**
|
||||||
|
aParentListener)
|
||||||
|
{
|
||||||
|
*aParentListener = mParentContentListener;
|
||||||
|
NS_IF_ADDREF(*aParentListener);
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsDSURIContentListener::SetParentContentListener(nsIURIContentListener*
|
||||||
|
aParentListener)
|
||||||
|
{
|
||||||
|
// Weak Reference, don't addref
|
||||||
|
mParentContentListener = aParentListener;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsDSURIContentListener::GetLoadCookie(nsISupports ** aLoadCookie)
|
||||||
|
{
|
||||||
|
*aLoadCookie = mLoadCookie;
|
||||||
|
NS_IF_ADDREF(*aLoadCookie);
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsDSURIContentListener::SetLoadCookie(nsISupports * aLoadCookie)
|
||||||
|
{
|
||||||
|
mLoadCookie = aLoadCookie;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
// nsDSURIContentListener: Helpers
|
// nsDSURIContentListener: Helpers
|
||||||
//*****************************************************************************
|
//*****************************************************************************
|
||||||
|
@ -135,20 +169,6 @@ nsDocShell* nsDSURIContentListener::DocShell()
|
||||||
return mDocShell;
|
return mDocShell;
|
||||||
}
|
}
|
||||||
|
|
||||||
void nsDSURIContentListener::GetParentContentListener(nsIURIContentListener**
|
|
||||||
aParentListener)
|
|
||||||
{
|
|
||||||
*aParentListener = mParentContentListener;
|
|
||||||
NS_IF_ADDREF(*aParentListener);
|
|
||||||
}
|
|
||||||
|
|
||||||
void nsDSURIContentListener::SetParentContentListener(nsIURIContentListener*
|
|
||||||
aParentListener)
|
|
||||||
{
|
|
||||||
// Weak Reference, don't addref
|
|
||||||
mParentContentListener = aParentListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
void nsDSURIContentListener::GetPresContext(nsIPresContext** aPresContext)
|
void nsDSURIContentListener::GetPresContext(nsIPresContext** aPresContext)
|
||||||
{
|
{
|
||||||
*aPresContext = mPresContext;
|
*aPresContext = mPresContext;
|
||||||
|
|
|
@ -43,8 +43,6 @@ protected:
|
||||||
|
|
||||||
void DocShell(nsDocShell* aDocShell);
|
void DocShell(nsDocShell* aDocShell);
|
||||||
nsDocShell* DocShell();
|
nsDocShell* DocShell();
|
||||||
void GetParentContentListener(nsIURIContentListener** aParentListener);
|
|
||||||
void SetParentContentListener(nsIURIContentListener* aParentListener);
|
|
||||||
void GetPresContext(nsIPresContext** aPresContext);
|
void GetPresContext(nsIPresContext** aPresContext);
|
||||||
void SetPresContext(nsIPresContext* aPresContext);
|
void SetPresContext(nsIPresContext* aPresContext);
|
||||||
PRBool HandleInCurrentDocShell(const char* aContentType,
|
PRBool HandleInCurrentDocShell(const char* aContentType,
|
||||||
|
@ -54,6 +52,7 @@ protected:
|
||||||
protected:
|
protected:
|
||||||
nsDocShell* mDocShell;
|
nsDocShell* mDocShell;
|
||||||
nsCOMPtr<nsIPresContext> mPresContext;
|
nsCOMPtr<nsIPresContext> mPresContext;
|
||||||
|
nsCOMPtr<nsISupports> mLoadCookie; // the load cookie associated with the window context.
|
||||||
|
|
||||||
nsIURIContentListener* mParentContentListener; // Weak Reference
|
nsIURIContentListener* mParentContentListener; // Weak Reference
|
||||||
};
|
};
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
#include "nsIDOMDocument.h"
|
#include "nsIDOMDocument.h"
|
||||||
#include "nsIDOMElement.h"
|
#include "nsIDOMElement.h"
|
||||||
#include "nsIDocumentViewer.h"
|
#include "nsIDocumentViewer.h"
|
||||||
|
#include "nsIDocumentLoaderFactory.h"
|
||||||
#include "nsIDeviceContext.h"
|
#include "nsIDeviceContext.h"
|
||||||
#include "nsCURILoader.h"
|
#include "nsCURILoader.h"
|
||||||
#include "nsLayoutCID.h"
|
#include "nsLayoutCID.h"
|
||||||
|
@ -147,13 +148,17 @@ NS_IMETHODIMP nsDocShell::LoadURIVia(nsIURI* aUri,
|
||||||
// first, open a channel for the url
|
// first, open a channel for the url
|
||||||
nsCOMPtr<nsIChannel> channel;
|
nsCOMPtr<nsIChannel> channel;
|
||||||
nsCOMPtr<nsIInterfaceRequestor> capabilities (do_QueryInterface(NS_STATIC_CAST(nsIDocShell *, this)));
|
nsCOMPtr<nsIInterfaceRequestor> capabilities (do_QueryInterface(NS_STATIC_CAST(nsIDocShell *, this)));
|
||||||
nsCOMPtr<nsILoadGroup> loadGroup(do_QueryInterface(mLoadCookie));
|
|
||||||
|
// we need to get the load group from our load cookie so we can pass it into open uri...
|
||||||
|
nsCOMPtr<nsILoadGroup> loadGroup;
|
||||||
|
NS_ENSURE_SUCCESS(uriLoader->GetLoadGroupForContext(NS_STATIC_CAST(nsISupports *, (nsIDocShell *) this), getter_AddRefs(loadGroup)),
|
||||||
|
NS_ERROR_FAILURE);
|
||||||
|
|
||||||
NS_ENSURE_SUCCESS(NS_OpenURI(getter_AddRefs(channel), aUri, loadGroup, capabilities), NS_ERROR_FAILURE);
|
NS_ENSURE_SUCCESS(NS_OpenURI(getter_AddRefs(channel), aUri, loadGroup, capabilities), NS_ERROR_FAILURE);
|
||||||
|
|
||||||
|
|
||||||
NS_ENSURE_SUCCESS(uriLoader->OpenURIVia(channel, nsIURILoader::viewNormal, nsnull,
|
NS_ENSURE_SUCCESS(uriLoader->OpenURIVia(channel, nsIURILoader::viewNormal, nsnull,
|
||||||
NS_STATIC_CAST(nsIDocShell*, this), mLoadCookie,
|
NS_STATIC_CAST(nsIDocShell*, this), aAdapterBinding), NS_ERROR_FAILURE);
|
||||||
getter_AddRefs(mLoadCookie), aAdapterBinding), NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -356,8 +361,7 @@ NS_IMETHODIMP nsDocShell::GetParentURIContentListener(nsIURIContentListener**
|
||||||
NS_ENSURE_ARG_POINTER(aParent);
|
NS_ENSURE_ARG_POINTER(aParent);
|
||||||
NS_ENSURE_SUCCESS(EnsureContentListener(), NS_ERROR_FAILURE);
|
NS_ENSURE_SUCCESS(EnsureContentListener(), NS_ERROR_FAILURE);
|
||||||
|
|
||||||
mContentListener->GetParentContentListener(aParent);
|
return mContentListener->GetParentContentListener(aParent);
|
||||||
return NS_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsDocShell::SetParentURIContentListener(nsIURIContentListener*
|
NS_IMETHODIMP nsDocShell::SetParentURIContentListener(nsIURIContentListener*
|
||||||
|
@ -365,8 +369,7 @@ NS_IMETHODIMP nsDocShell::SetParentURIContentListener(nsIURIContentListener*
|
||||||
{
|
{
|
||||||
NS_ENSURE_SUCCESS(EnsureContentListener(), NS_ERROR_FAILURE);
|
NS_ENSURE_SUCCESS(EnsureContentListener(), NS_ERROR_FAILURE);
|
||||||
|
|
||||||
mContentListener->SetParentContentListener(aParent);
|
return mContentListener->SetParentContentListener(aParent);
|
||||||
return NS_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsDocShell::GetPrefs(nsIPref** aPrefs)
|
NS_IMETHODIMP nsDocShell::GetPrefs(nsIPref** aPrefs)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче