bug 239604. make uriloader more doxygen friendly, and remove unused "command"
parameter from nsIContentHandler::handleContent, and change the type of aWindowContext to nsIInterfaceRequestor. r=bzbarsky sr=darin git-svn-id: svn://10.0.0.236/trunk@154988 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -172,10 +172,9 @@ nsBookmarkContentHandler.prototype = {
|
||||
|
||||
_bundle: null,
|
||||
|
||||
handleContent: function (aContentType, aCommand, aWindowTarget, aRequest)
|
||||
handleContent: function (aContentType, aWindowTarget, aRequest)
|
||||
{
|
||||
var ireq = aWindowTarget.QueryInterface(Components.interfaces.nsIInterfaceRequestor);
|
||||
var win = ireq.getInterface(Components.interfaces.nsIDOMWindowInternal);
|
||||
var win = aWindowTarget.getInterface(Components.interfaces.nsIDOMWindowInternal);
|
||||
|
||||
// It'd be nicer if the add bookmark dialog was parameterizable enough
|
||||
// to be able to open here, instead of just showing a prompt, but that can
|
||||
|
||||
@@ -108,14 +108,14 @@ function (iid) {
|
||||
}
|
||||
|
||||
ICALContentHandler.prototype.handleContent =
|
||||
function (aContentType, aCommand, aWindowTarget, aRequest)
|
||||
function (aContentType, aWindowTarget, aRequest)
|
||||
{
|
||||
var e;
|
||||
var channel = aRequest.QueryInterface(nsIChannel);
|
||||
|
||||
/*
|
||||
dump ("ICALContentHandler.handleContent (" + aContentType + ", " +
|
||||
aCommand + ", " + aWindowTarget + ", " + channel.URI.spec + ")\n");
|
||||
aWindowTarget + ", " + channel.URI.spec + ")\n");
|
||||
*/
|
||||
|
||||
var windowManager =
|
||||
|
||||
@@ -387,8 +387,7 @@ NS_IMETHODIMP nsDocShell::GetInterface(const nsIID & aIID, void **aSink)
|
||||
NS_ENSURE_TRUE(uriLoader, NS_ERROR_FAILURE);
|
||||
nsCOMPtr<nsIDocumentLoader> docLoader;
|
||||
NS_ENSURE_SUCCESS(uriLoader->
|
||||
GetDocumentLoaderForContext(NS_STATIC_CAST
|
||||
(nsIDocShell *, this),
|
||||
GetDocumentLoaderForContext(this,
|
||||
getter_AddRefs
|
||||
(docLoader)),
|
||||
NS_ERROR_FAILURE);
|
||||
@@ -5338,8 +5337,7 @@ nsDocShell::DoURILoad(nsIURI * aURI,
|
||||
|
||||
// we need to get the load group from our load cookie so we can pass it into open uri...
|
||||
nsCOMPtr<nsILoadGroup> loadGroup;
|
||||
rv = uriLoader->GetLoadGroupForContext(NS_STATIC_CAST
|
||||
(nsIDocShell *, this),
|
||||
rv = uriLoader->GetLoadGroupForContext(this,
|
||||
getter_AddRefs(loadGroup));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
@@ -5709,7 +5707,7 @@ nsresult nsDocShell::DoChannelLoad(nsIChannel * aChannel,
|
||||
|
||||
rv = aURILoader->OpenURI(aChannel,
|
||||
(mLoadType == LOAD_LINK),
|
||||
NS_STATIC_CAST(nsIDocShell *, this));
|
||||
this);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
@@ -1211,7 +1211,7 @@ NS_IMETHODIMP nsWebShell::Create()
|
||||
nsCOMPtr<nsIURILoader> uriLoader = do_GetService(NS_URI_LOADER_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
rv = uriLoader->GetDocumentLoaderForContext(NS_STATIC_CAST(nsIWebShell*, this),
|
||||
rv = uriLoader->GetDocumentLoaderForContext(this,
|
||||
getter_AddRefs(mDocLoader));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
|
||||
@@ -595,8 +595,7 @@ void CTests::OnTestsAddUriContentListenerByOpenUri()
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsISupports> mySupports = do_QueryInterface(NS_STATIC_CAST(nsIURIContentListener*, qaBrowserImpl));
|
||||
rv = myLoader->OpenURI(theChannel, PR_TRUE, mySupports);
|
||||
rv = myLoader->OpenURI(theChannel, PR_TRUE, qaBrowserImpl);
|
||||
RvTestResult(rv, "nsIUriLoader->OpenURI() test", 2);
|
||||
}
|
||||
|
||||
@@ -870,8 +869,7 @@ void CTests::OnVerifybugs169617()
|
||||
rv = NS_NewChannel(getter_AddRefs(theChannel), theURI, nsnull, nsnull);
|
||||
RvTestResult(rv, "NS_NewChannel() test for file url", 1);
|
||||
|
||||
nsCOMPtr<nsISupports> mySupports = do_QueryInterface(NS_STATIC_CAST(nsIURIContentListener*, qaBrowserImpl));
|
||||
rv = myLoader->OpenURI(theChannel, PR_TRUE, mySupports);
|
||||
rv = myLoader->OpenURI(theChannel, PR_TRUE, qaBrowserImpl);
|
||||
RvTestResult(rv, "nsIUriLoader->OpenURI() test for file url", 2);
|
||||
|
||||
}
|
||||
@@ -892,8 +890,7 @@ void CTests::OnVerifybugs170274()
|
||||
rv = NS_NewChannel(getter_AddRefs(theChannel), theURI, nsnull, nsnull);
|
||||
RvTestResult(rv, "NS_NewChannel() test for data url", 1);
|
||||
|
||||
nsCOMPtr<nsISupports> mySupports = do_QueryInterface(NS_STATIC_CAST(nsIURIContentListener*, qaBrowserImpl));
|
||||
rv = myLoader->OpenURI(theChannel, PR_TRUE, mySupports);
|
||||
rv = myLoader->OpenURI(theChannel, PR_TRUE, qaBrowserImpl);
|
||||
RvTestResult(rv, "nsIUriLoader->OpenURI() test for data url", 2);
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ function (iid)
|
||||
}
|
||||
|
||||
IRCContentHandler.prototype.handleContent =
|
||||
function (contentType, command, windowTarget, request)
|
||||
function (contentType, windowTarget, request)
|
||||
{
|
||||
var e;
|
||||
var channel = request.QueryInterface(nsIChannel);
|
||||
|
||||
@@ -415,7 +415,7 @@ function jsdh_qi(iid)
|
||||
}
|
||||
|
||||
JSDContentHandler.prototype.handleContent =
|
||||
function jsdh_handle(contentType, command, windowTarget, request)
|
||||
function jsdh_handle(contentType, windowTarget, request)
|
||||
{
|
||||
var e;
|
||||
var channel = request.QueryInterface(nsIChannel);
|
||||
|
||||
@@ -114,15 +114,14 @@ function (iid) {
|
||||
}
|
||||
|
||||
XMLTermContentHandler.prototype.handleContent =
|
||||
function (aContentType, aCommand, aWindowContext, aRequest)
|
||||
function (aContentType, aWindowContext, aRequest)
|
||||
{
|
||||
var e;
|
||||
|
||||
var aChannel = aRequest.QueryInterface(Components.interfaces.nsIChannel);
|
||||
|
||||
debug("XMLTermContentHandler.handleContent (" + aContentType + ", " +
|
||||
aCommand + ", " + aWindowContext + ", " +
|
||||
aChannel.URI.spec + ")\n");
|
||||
aWindowContext + ", " + aChannel.URI.spec + ")\n");
|
||||
|
||||
var xmltermChromeURL = "chrome://xmlterm/content/xmlterm.xul?"+aChannel.URI.spec;
|
||||
//dump("XMLTermContentHandler:xmltermChromeURL = " + xmltermChromeURL + "\n");
|
||||
|
||||
@@ -2009,8 +2009,9 @@ static void convertFromVObject(VObject *vObj, nsIAbCard *aCard)
|
||||
return;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsAddressBook::HandleContent(const char * aContentType, const char * aCommand,
|
||||
nsISupports * aWindowContext, nsIRequest *request)
|
||||
NS_IMETHODIMP nsAddressBook::HandleContent(const char * aContentType,
|
||||
nsIInterfaceRequestor * aWindowContext,
|
||||
nsIRequest *request)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(request);
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@ nsMessengerContentHandler::~nsMessengerContentHandler()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMessengerContentHandler::HandleContent(const char * aContentType, const char * aCommand,
|
||||
nsISupports * aWindowContext, nsIRequest *request)
|
||||
NS_IMETHODIMP nsMessengerContentHandler::HandleContent(const char * aContentType,
|
||||
nsIInterfaceRequestor* aWindowContext, nsIRequest *request)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
if (!request)
|
||||
|
||||
@@ -183,7 +183,6 @@
|
||||
#include "nsSmtpServer.h"
|
||||
#include "nsSmtpDataSource.h"
|
||||
#include "nsSmtpDelegateFactory.h"
|
||||
#include "nsIContentHandler.h"
|
||||
#include "nsMsgRecipientArray.h"
|
||||
#include "nsMsgComposeStringBundle.h"
|
||||
#include "nsMsgCompUtils.h"
|
||||
|
||||
@@ -67,7 +67,6 @@
|
||||
#include "nsSmtpServer.h"
|
||||
#include "nsSmtpDataSource.h"
|
||||
#include "nsSmtpDelegateFactory.h"
|
||||
#include "nsIContentHandler.h"
|
||||
#include "nsMsgRecipientArray.h"
|
||||
#include "nsMsgComposeStringBundle.h"
|
||||
#include "nsMsgCompUtils.h"
|
||||
|
||||
@@ -56,8 +56,8 @@ nsMsgComposeContentHandler::~nsMsgComposeContentHandler()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsMsgComposeContentHandler::HandleContent(const char * aContentType, const char * aCommand,
|
||||
nsISupports * aWindowContext, nsIRequest *request)
|
||||
NS_IMETHODIMP nsMsgComposeContentHandler::HandleContent(const char * aContentType,
|
||||
nsIInterfaceRequestor* aWindowContext, nsIRequest *request)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
if (!request)
|
||||
|
||||
@@ -356,13 +356,12 @@ nsURLFetcher::FireURLRequest(nsIURI *aURL, nsILocalFile *localFile, nsIFileOutpu
|
||||
nsCOMPtr<nsIURILoader> pURILoader (do_GetService(NS_URI_LOADER_CONTRACTID));
|
||||
NS_ENSURE_TRUE(pURILoader, NS_ERROR_FAILURE);
|
||||
|
||||
nsCOMPtr<nsISupports> cntListener (do_QueryInterface(NS_STATIC_CAST(nsIStreamListener *, this)));
|
||||
nsCOMPtr<nsIChannel> channel;
|
||||
nsCOMPtr<nsILoadGroup> loadGroup;
|
||||
pURILoader->GetLoadGroupForContext(cntListener, getter_AddRefs(loadGroup));
|
||||
pURILoader->GetLoadGroupForContext(this, getter_AddRefs(loadGroup));
|
||||
NS_ENSURE_SUCCESS(NS_NewChannel(getter_AddRefs(channel), aURL, nsnull, loadGroup, this), NS_ERROR_FAILURE);
|
||||
|
||||
return pURILoader->OpenURI(channel, PR_FALSE, cntListener);
|
||||
return pURILoader->OpenURI(channel, PR_FALSE, this);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
||||
@@ -3581,7 +3581,7 @@ NS_IMETHODIMP nsImapService::GetCacheSession(nsICacheSession **result)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsImapService::HandleContent(const char * aContentType, const char * aCommand, nsISupports * aWindowContext, nsIRequest *request)
|
||||
nsImapService::HandleContent(const char * aContentType, nsIInterfaceRequestor* aWindowContext, nsIRequest *request)
|
||||
{
|
||||
nsresult rv;
|
||||
NS_ENSURE_ARG_POINTER(request);
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
#include "nsNNTPNewsgroupList.h"
|
||||
#include "nsNNTPArticleList.h"
|
||||
#include "nsNewsDownloadDialogArgs.h"
|
||||
#include "nsIContentHandler.h"
|
||||
#include "nsCURILoader.h"
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNntpUrl)
|
||||
|
||||
@@ -1740,7 +1740,7 @@ NS_IMETHODIMP nsNntpService::GetChromeUrlForTask(char **aChromeUrlForTask)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNntpService::HandleContent(const char * aContentType, const char * aCommand, nsISupports * aWindowContext, nsIRequest *request)
|
||||
nsNntpService::HandleContent(const char * aContentType, nsIInterfaceRequestor* aWindowContext, nsIRequest *request)
|
||||
{
|
||||
nsresult rv;
|
||||
NS_ENSURE_ARG_POINTER(request);
|
||||
|
||||
@@ -80,7 +80,6 @@
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsIXULWindow.h"
|
||||
#include "nsIChromeRegistry.h"
|
||||
#include "nsIContentHandler.h"
|
||||
#include "nsIEventQueueService.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsBuildID.h"
|
||||
|
||||
@@ -37,15 +37,32 @@
|
||||
|
||||
#include "nsISupports.idl"
|
||||
interface nsIRequest;
|
||||
interface nsIInterfaceRequestor;
|
||||
|
||||
[scriptable, uuid(2F0F927A-8677-11d3-989D-001083010E9B)]
|
||||
[scriptable, uuid(49439df2-b3d2-441c-bf62-866bdaf56fd2)]
|
||||
interface nsIContentHandler : nsISupports
|
||||
{
|
||||
/* HandleContent works as the name implies =).
|
||||
aRequest is a request whose content type is already known (aContentType) */
|
||||
/**
|
||||
* Tells the content handler to take over handling the content. If this
|
||||
* function succeeds, the URI Loader will leave this request alone, ignoring
|
||||
* progress notifications. Failure of this method will cause the request to be
|
||||
* cancelled, unless the error code is NS_ERROR_WONT_HANDLE_CONTENT (see
|
||||
* below).
|
||||
*
|
||||
* @param aWindowContext
|
||||
* Window context, used to get things like the current nsIDOMWindow
|
||||
* for this request. May be null.
|
||||
* @param aContentType
|
||||
* The content type of aRequest
|
||||
* @param aRequest
|
||||
* A request whose content type is already known.
|
||||
*
|
||||
* @throw NS_ERROR_WONT_HANDLE_CONTENT Indicates that this handler does not
|
||||
* want to handle this content. A different way for handling this
|
||||
* content should be tried.
|
||||
*/
|
||||
void handleContent(in string aContentType,
|
||||
in string aCommand,
|
||||
in nsISupports aWindowContext,
|
||||
in nsIInterfaceRequestor aWindowContext,
|
||||
in nsIRequest aRequest);
|
||||
};
|
||||
|
||||
|
||||
@@ -35,6 +35,12 @@
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIRequest;
|
||||
interface nsIStreamListener;
|
||||
interface nsIURI;
|
||||
|
||||
/**
|
||||
* nsIURIContentListener is an interface used by components which
|
||||
* want to know (and have a chance to handle) a particular content type.
|
||||
@@ -44,13 +50,6 @@
|
||||
*
|
||||
* @status FROZEN
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
interface nsIRequest;
|
||||
interface nsIStreamListener;
|
||||
interface nsIURI;
|
||||
|
||||
[scriptable, uuid(94928AB3-8B63-11d3-989D-001083010E9B)]
|
||||
interface nsIURIContentListener : nsISupports
|
||||
{
|
||||
|
||||
@@ -46,6 +46,7 @@ interface nsIChannel;
|
||||
interface nsIRequest;
|
||||
interface nsIStreamListener;
|
||||
interface nsIInputStream;
|
||||
interface nsIInterfaceRequestor;
|
||||
|
||||
/**
|
||||
* The uri dispatcher is responsible for taking uri's, determining
|
||||
@@ -67,7 +68,7 @@ interface nsIInputStream;
|
||||
* or helper app. Or it may hand the url off to an OS registered
|
||||
* application.
|
||||
*/
|
||||
[scriptable, uuid(40AECB53-8B65-11d3-989D-001083010E9B)]
|
||||
[scriptable, uuid(59432929-288b-4fa9-83c9-a5bc8d7ca3bd)]
|
||||
interface nsIURILoader : nsISupports
|
||||
{
|
||||
/**
|
||||
@@ -96,13 +97,13 @@ interface nsIURILoader : nsISupports
|
||||
* If you are running the url from a doc shell or a web shell, this is
|
||||
* your window context. If you have a content listener you want to
|
||||
* give first crack to, the uri loader needs to be able to get it
|
||||
* from the window context (we'll use nsIInterfaceRequestor). We will
|
||||
* also be using nsIInterfaceRequestor to get at the progress event
|
||||
* sink interface.
|
||||
* from the window context. We will also be using the window context
|
||||
* to get at the progress event sink interface.
|
||||
* <b>Must not be null!</b>
|
||||
*/
|
||||
void openURI(in nsIChannel aChannel,
|
||||
in boolean aIsContentPreferred,
|
||||
in nsISupports aWindowContext);
|
||||
in nsIInterfaceRequestor aWindowContext);
|
||||
|
||||
|
||||
/**
|
||||
@@ -114,7 +115,7 @@ interface nsIURILoader : nsISupports
|
||||
* dirty little back door for sneaking the load group out in case you need
|
||||
* it to create the channel before calling openURI
|
||||
*/
|
||||
nsILoadGroup getLoadGroupForContext(in nsISupports aWindowContext);
|
||||
nsIDocumentLoader getDocumentLoaderForContext (in nsISupports aWindowContext);
|
||||
nsILoadGroup getLoadGroupForContext(in nsIInterfaceRequestor aWindowContext);
|
||||
nsIDocumentLoader getDocumentLoaderForContext (in nsIInterfaceRequestor aWindowContext);
|
||||
};
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
nsDocumentOpenInfo();
|
||||
|
||||
// Real constructor
|
||||
nsDocumentOpenInfo(nsISupports* aWindowContext,
|
||||
nsDocumentOpenInfo(nsIInterfaceRequestor* aWindowContext,
|
||||
PRBool aIsContentPreferred,
|
||||
nsURILoader* aURILoader);
|
||||
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
NS_DECL_NSISTREAMLISTENER
|
||||
|
||||
protected:
|
||||
virtual ~nsDocumentOpenInfo();
|
||||
~nsDocumentOpenInfo();
|
||||
|
||||
protected:
|
||||
/**
|
||||
@@ -151,11 +151,10 @@ protected:
|
||||
nsCOMPtr<nsIStreamListener> m_targetStreamListener;
|
||||
|
||||
/**
|
||||
* A pointer to the entity that originated the load. This should
|
||||
* implement nsIInterfaceRequestor; we depend on getting things like
|
||||
* nsIURIContentListeners, nsIDOMWindows, etc off of it.
|
||||
* A pointer to the entity that originated the load. We depend on getting
|
||||
* things like nsIURIContentListeners, nsIDOMWindows, etc off of it.
|
||||
*/
|
||||
nsCOMPtr<nsISupports> m_originalContext;
|
||||
nsCOMPtr<nsIInterfaceRequestor> m_originalContext;
|
||||
|
||||
/**
|
||||
* Boolean to pass to CanHandleContent (also determines whether we
|
||||
@@ -189,7 +188,7 @@ nsDocumentOpenInfo::nsDocumentOpenInfo()
|
||||
NS_NOTREACHED("This should never be called\n");
|
||||
}
|
||||
|
||||
nsDocumentOpenInfo::nsDocumentOpenInfo(nsISupports* aWindowContext,
|
||||
nsDocumentOpenInfo::nsDocumentOpenInfo(nsIInterfaceRequestor* aWindowContext,
|
||||
PRBool aIsContentPreferred,
|
||||
nsURILoader* aURILoader)
|
||||
: m_originalContext(aWindowContext),
|
||||
@@ -510,7 +509,7 @@ nsresult nsDocumentOpenInfo::DispatchContent(nsIRequest *request, nsISupports *
|
||||
do_CreateInstance(handlerContractID.get());
|
||||
if (contentHandler) {
|
||||
LOG((" Content handler found"));
|
||||
rv = contentHandler->HandleContent(mContentType.get(), "view",
|
||||
rv = contentHandler->HandleContent(mContentType.get(),
|
||||
m_originalContext, request);
|
||||
// XXXbz returning an error code to represent handling the
|
||||
// content is just bizarre!
|
||||
@@ -782,7 +781,7 @@ NS_IMETHODIMP nsURILoader::UnRegisterContentListener(nsIURIContentListener * aCo
|
||||
|
||||
NS_IMETHODIMP nsURILoader::OpenURI(nsIChannel *channel,
|
||||
PRBool aIsContentPreferred,
|
||||
nsISupports * aWindowContext)
|
||||
nsIInterfaceRequestor *aWindowContext)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(channel);
|
||||
|
||||
@@ -842,27 +841,26 @@ NS_IMETHODIMP nsURILoader::Stop(nsISupports* aLoadCookie)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsURILoader::GetLoadGroupForContext(nsISupports * aWindowContext,
|
||||
nsURILoader::GetLoadGroupForContext(nsIInterfaceRequestor* aWindowContext,
|
||||
nsILoadGroup ** aLoadGroup)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIInterfaceRequestor> loadCookieForWindow;
|
||||
|
||||
// Initialize the [out] parameter...
|
||||
*aLoadGroup= nsnull;
|
||||
*aLoadGroup = nsnull;
|
||||
|
||||
NS_ENSURE_ARG(aWindowContext);
|
||||
|
||||
rv = SetupLoadCookie(aWindowContext, getter_AddRefs(loadCookieForWindow));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = loadCookieForWindow->GetInterface(NS_GET_IID(nsILoadGroup),
|
||||
(void **) aLoadGroup);
|
||||
rv = CallGetInterface(loadCookieForWindow.get(), aLoadGroup);
|
||||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsURILoader::GetDocumentLoaderForContext(nsISupports * aWindowContext,
|
||||
nsURILoader::GetDocumentLoaderForContext(nsIInterfaceRequestor * aWindowContext,
|
||||
nsIDocumentLoader ** aDocLoader)
|
||||
{
|
||||
nsresult rv;
|
||||
@@ -876,12 +874,11 @@ nsURILoader::GetDocumentLoaderForContext(nsISupports * aWindowContext,
|
||||
rv = SetupLoadCookie(aWindowContext, getter_AddRefs(loadCookieForWindow));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = loadCookieForWindow->GetInterface(NS_GET_IID(nsIDocumentLoader),
|
||||
(void **) aDocLoader);
|
||||
rv = CallGetInterface(loadCookieForWindow.get(), aDocLoader);
|
||||
return rv;
|
||||
}
|
||||
|
||||
nsresult nsURILoader::SetupLoadCookie(nsISupports * aWindowContext,
|
||||
nsresult nsURILoader::SetupLoadCookie(nsIInterfaceRequestor * aWindowContext,
|
||||
nsIInterfaceRequestor ** aLoadCookie)
|
||||
{
|
||||
// first, see if we have already set a load cookie on the cnt listener..
|
||||
@@ -941,8 +938,7 @@ nsresult nsURILoader::SetupLoadCookie(nsISupports * aWindowContext,
|
||||
// loadCookie may be null - for example, <a target="popupWin"> if popupWin is
|
||||
// not a defined window. The following prevents a crash (Bug 32898)
|
||||
if (loadCookie) {
|
||||
rv = loadCookie->QueryInterface(NS_GET_IID(nsIInterfaceRequestor),
|
||||
(void**)aLoadCookie);
|
||||
rv = CallQueryInterface(loadCookie, aLoadCookie);
|
||||
} else {
|
||||
rv = NS_ERROR_UNEXPECTED;
|
||||
}
|
||||
|
||||
@@ -62,16 +62,18 @@ public:
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
nsURILoader();
|
||||
virtual ~nsURILoader();
|
||||
~nsURILoader();
|
||||
|
||||
protected:
|
||||
// we shouldn't need to have an owning ref count on registered
|
||||
// content listeners because they are supposed to unregister themselves
|
||||
// when they go away. This array stores weak references
|
||||
/**
|
||||
* we shouldn't need to have an owning ref count on registered
|
||||
* content listeners because they are supposed to unregister themselves
|
||||
* when they go away. This array stores weak references
|
||||
*/
|
||||
nsCOMArray<nsIWeakReference> m_listeners;
|
||||
|
||||
// prepare the load cookie for the window context
|
||||
nsresult SetupLoadCookie(nsISupports * aWindowContext, nsIInterfaceRequestor ** aLoadCookie);
|
||||
/** prepare the load cookie for the window context */
|
||||
nsresult SetupLoadCookie(nsIInterfaceRequestor * aWindowContext, nsIInterfaceRequestor ** aLoadCookie);
|
||||
|
||||
#ifdef PR_LOGGING
|
||||
/**
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsIRequest.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsIInterfaceRequestor.h"
|
||||
|
||||
|
||||
// used to manage our in memory data source of helper applications
|
||||
@@ -490,7 +491,7 @@ nsresult nsExternalHelperAppService::InitDataSource()
|
||||
|
||||
NS_IMETHODIMP nsExternalHelperAppService::DoContent(const nsACString& aMimeContentType,
|
||||
nsIRequest *aRequest,
|
||||
nsISupports *aWindowContext,
|
||||
nsIInterfaceRequestor *aWindowContext,
|
||||
nsIStreamListener ** aStreamListener)
|
||||
{
|
||||
nsAutoString fileName;
|
||||
@@ -622,7 +623,7 @@ nsExternalAppHandler * nsExternalHelperAppService::CreateNewExternalHandler(nsIM
|
||||
const nsCSubstring& aTempFileExtension,
|
||||
const nsAString& aFileName,
|
||||
PRBool aIsAttachment,
|
||||
nsISupports * aWindowContext)
|
||||
nsIInterfaceRequestor * aWindowContext)
|
||||
{
|
||||
nsExternalAppHandler* handler = nsnull;
|
||||
NS_NEWXPCOM(handler, nsExternalAppHandler);
|
||||
@@ -1767,7 +1768,7 @@ nsresult nsExternalAppHandler::ExecuteDesiredAction()
|
||||
|
||||
nsresult nsExternalAppHandler::Init(nsIMIMEInfo * aMIMEInfo,
|
||||
const nsCSubstring& aTempFileExtension,
|
||||
nsISupports * aWindowContext,
|
||||
nsIInterfaceRequestor* aWindowContext,
|
||||
const nsAString& aSuggestedFilename,
|
||||
PRBool aIsAttachment)
|
||||
{
|
||||
|
||||
@@ -111,7 +111,7 @@ public:
|
||||
const nsCSubstring& aFileExtension,
|
||||
const nsAString& aFileName,
|
||||
PRBool aIsAttachment,
|
||||
nsISupports * aWindowContext);
|
||||
nsIInterfaceRequestor* aWindowContext);
|
||||
|
||||
/**
|
||||
* Given a content type, look up the user override information to see if
|
||||
@@ -297,7 +297,7 @@ public:
|
||||
~nsExternalAppHandler();
|
||||
|
||||
nsresult Init(nsIMIMEInfo * aMIMEInfo, const nsCSubstring& aFileExtension,
|
||||
nsISupports * aWindowContext,
|
||||
nsIInterfaceRequestor * aWindowContext,
|
||||
const nsAString& aFilename,
|
||||
PRBool aIsAttachment);
|
||||
|
||||
@@ -307,7 +307,7 @@ protected:
|
||||
nsString mTempFileExtension;
|
||||
nsCOMPtr<nsIMIMEInfo> mMimeInfo;
|
||||
nsCOMPtr<nsIOutputStream> mOutStream; /**< output stream to the temp file */
|
||||
nsCOMPtr<nsISupports> mWindowContext;
|
||||
nsCOMPtr<nsIInterfaceRequestor> mWindowContext;
|
||||
/**
|
||||
* The following field is set if we were processing an http channel that had
|
||||
* a content disposition header which specified the SUGGESTED file name we
|
||||
|
||||
@@ -28,12 +28,13 @@ interface nsIStreamListener;
|
||||
interface nsIFile;
|
||||
interface nsIMIMEInfo;
|
||||
interface nsIWebProgressListener;
|
||||
interface nsIInterfaceRequestor;
|
||||
|
||||
/**
|
||||
* The external helper app service is used for finding and launching
|
||||
* platform specific external applications for a given mime content type.
|
||||
*/
|
||||
[scriptable, uuid(8a902933-d1a2-48a1-93a5-da64d6a2786f)]
|
||||
[scriptable, uuid(0ea90cf3-2dd9-470f-8f76-f141743c5678)]
|
||||
interface nsIExternalHelperAppService : nsISupports
|
||||
{
|
||||
/**
|
||||
@@ -49,7 +50,7 @@ interface nsIExternalHelperAppService : nsISupports
|
||||
* @return A nsIStreamListener which the caller should pump the data into.
|
||||
*/
|
||||
nsIStreamListener doContent (in ACString aMimeContentType, in nsIRequest aRequest,
|
||||
in nsISupports aWindowContext);
|
||||
in nsIInterfaceRequestor aWindowContext);
|
||||
|
||||
/**
|
||||
* Returns true if data from a URL with this extension combination
|
||||
|
||||
@@ -121,12 +121,12 @@ class nsMIMEInfoBase : public nsIMIMEInfo {
|
||||
static NS_HIDDEN_(nsresult) LaunchWithIProcess(nsIFile* aApp, nsIFile* aFile);
|
||||
|
||||
// member variables
|
||||
nsCStringArray mExtensions; // array of file extensions associated w/ this MIME obj
|
||||
nsString mDescription; // human readable description
|
||||
PRUint32 mMacType, mMacCreator; // Mac file type and creator
|
||||
nsCStringArray mExtensions; ///< array of file extensions associated w/ this MIME obj
|
||||
nsString mDescription; ///< human readable description
|
||||
PRUint32 mMacType, mMacCreator; ///< Mac file type and creator
|
||||
nsCString mMIMEType;
|
||||
nsCOMPtr<nsIFile> mPreferredApplication; // preferred application associated with this type.
|
||||
nsMIMEInfoHandleAction mPreferredAction; // preferred action to associate with this type
|
||||
nsCOMPtr<nsIFile> mPreferredApplication; ///< preferred application associated with this type.
|
||||
nsMIMEInfoHandleAction mPreferredAction; ///< preferred action to associate with this type
|
||||
nsString mPreferredAppDescription;
|
||||
nsString mDefaultAppDescription;
|
||||
PRBool mAlwaysAskBeforeHandling;
|
||||
@@ -150,7 +150,11 @@ class nsMIMEInfoImpl : public nsMIMEInfoBase {
|
||||
NS_IMETHOD GetDefaultDescription(nsAString& aDefaultDescription);
|
||||
|
||||
// additional methods
|
||||
void SetDefaultApplication(nsIFile* aApp) { mDefaultApplication = aApp; }
|
||||
/**
|
||||
* Sets the default application. Supposed to be only called by the OS Helper
|
||||
* App Services; the default application is immutable after it is first set.
|
||||
*/
|
||||
void SetDefaultApplication(nsIFile* aApp) { if (!mDefaultApplication) mDefaultApplication = aApp; }
|
||||
protected:
|
||||
// nsMIMEInfoBase methods
|
||||
/**
|
||||
@@ -160,7 +164,7 @@ class nsMIMEInfoImpl : public nsMIMEInfoBase {
|
||||
virtual NS_HIDDEN_(nsresult) LaunchDefaultWithFile(nsIFile* aFile);
|
||||
|
||||
|
||||
nsCOMPtr<nsIFile> mDefaultApplication; // default application associated with this type.
|
||||
nsCOMPtr<nsIFile> mDefaultApplication; ///< default application associated with this type.
|
||||
};
|
||||
|
||||
#endif //__nsmimeinfoimpl_h___
|
||||
|
||||
@@ -78,7 +78,6 @@
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsIXULWindow.h"
|
||||
#include "nsIChromeRegistry.h"
|
||||
#include "nsIContentHandler.h"
|
||||
#include "nsIEventQueueService.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsBuildID.h"
|
||||
|
||||
@@ -793,8 +793,7 @@ NS_IMETHODIMP nsBrowserContentHandler::GetDefaultArgs(PRUnichar **aDefaultArgs)
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsBrowserContentHandler::HandleContent(const char * aContentType,
|
||||
const char * aCommand,
|
||||
nsISupports * aWindowContext,
|
||||
nsIInterfaceRequestor * aWindowContext,
|
||||
nsIRequest * aRequest)
|
||||
{
|
||||
// create a new browser window to handle the content
|
||||
|
||||
@@ -244,7 +244,7 @@ nsresult
|
||||
nsDownloadManager::GetDataSource(nsIRDFDataSource** aDataSource)
|
||||
{
|
||||
*aDataSource = mDataSource;
|
||||
NS_IF_ADDREF(*aDataSource);
|
||||
NS_ADDREF(*aDataSource);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -811,7 +811,7 @@ XRemoteService::OpenURL(nsCString &aArgument,
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
// load it
|
||||
rv = loader->OpenURI(channel, PR_TRUE, listenerRef);
|
||||
rv = loader->OpenURI(channel, PR_TRUE, listener);
|
||||
}
|
||||
|
||||
else if (newTab && aOpenBrowser) {
|
||||
|
||||
@@ -111,8 +111,7 @@ nsInstallTrigger::SetScriptObject(void *aScriptObject)
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsInstallTrigger::HandleContent(const char * aContentType,
|
||||
const char * aCommand,
|
||||
nsISupports* aWindowContext,
|
||||
nsIInterfaceRequestor* aWindowContext,
|
||||
nsIRequest* request)
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
Reference in New Issue
Block a user