2001-09-28 20:14:13 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
1999-10-29 21:46:18 +00:00
|
|
|
|
1999-11-02 19:36:43 +00:00
|
|
|
#ifndef nsURILoader_h__
|
|
|
|
#define nsURILoader_h__
|
1999-10-29 21:46:18 +00:00
|
|
|
|
1999-11-02 19:36:43 +00:00
|
|
|
#include "nsCURILoader.h"
|
1999-11-05 06:01:05 +00:00
|
|
|
#include "nsISupportsUtils.h"
|
2002-12-11 00:15:19 +00:00
|
|
|
#include "nsCOMArray.h"
|
1999-10-29 21:46:18 +00:00
|
|
|
#include "nsCOMPtr.h"
|
2000-05-07 02:01:10 +00:00
|
|
|
#include "nsIInterfaceRequestor.h"
|
2001-09-05 21:28:38 +00:00
|
|
|
#include "nsIInterfaceRequestorUtils.h"
|
2000-10-19 10:25:49 +00:00
|
|
|
#include "nsString.h"
|
2002-12-11 00:15:19 +00:00
|
|
|
#include "nsIWeakReference.h"
|
1999-10-29 21:46:18 +00:00
|
|
|
|
2003-10-30 02:03:41 +00:00
|
|
|
#ifdef MOZ_LOGGING
|
|
|
|
// Uncomment the next line to force logging on in release builds
|
|
|
|
// #define FORCE_PR_LOG
|
|
|
|
#endif
|
|
|
|
#include "prlog.h"
|
|
|
|
|
2003-10-09 04:00:01 +00:00
|
|
|
class nsDocumentOpenInfo;
|
|
|
|
|
2000-01-17 19:55:27 +00:00
|
|
|
class nsURILoader : public nsIURILoader
|
1999-10-29 21:46:18 +00:00
|
|
|
{
|
|
|
|
public:
|
1999-11-02 19:36:43 +00:00
|
|
|
NS_DECL_NSIURILOADER
|
1999-10-29 21:46:18 +00:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
|
1999-11-02 19:36:43 +00:00
|
|
|
nsURILoader();
|
2004-04-16 21:06:07 +00:00
|
|
|
~nsURILoader();
|
1999-10-29 21:46:18 +00:00
|
|
|
|
|
|
|
protected:
|
2006-01-28 14:06:31 +00:00
|
|
|
/**
|
|
|
|
* Equivalent to nsIURILoader::openChannel, but allows specifying whether the
|
|
|
|
* channel is opened already.
|
|
|
|
*/
|
|
|
|
NS_HIDDEN_(nsresult) OpenChannel(nsIChannel* channel,
|
|
|
|
PRUint32 aFlags,
|
|
|
|
nsIInterfaceRequestor* aWindowContext,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aChannelOpen,
|
2006-01-28 14:06:31 +00:00
|
|
|
nsIStreamListener** aListener);
|
|
|
|
|
2004-04-16 21:06:07 +00:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
2002-12-11 00:15:19 +00:00
|
|
|
nsCOMArray<nsIWeakReference> m_listeners;
|
1999-10-29 21:46:18 +00:00
|
|
|
|
2003-10-30 02:03:41 +00:00
|
|
|
#ifdef PR_LOGGING
|
|
|
|
/**
|
|
|
|
* NSPR logging. The module is called "URILoader"
|
|
|
|
*/
|
|
|
|
static PRLogModuleInfo* mLog;
|
|
|
|
#endif
|
|
|
|
|
2003-10-09 04:00:01 +00:00
|
|
|
friend class nsDocumentOpenInfo;
|
1999-10-29 21:46:18 +00:00
|
|
|
};
|
|
|
|
|
2007-08-31 23:18:46 +00:00
|
|
|
/**
|
2007-10-29 18:29:14 +00:00
|
|
|
* The load has been cancelled because it was found on a malware or phishing blacklist.
|
2007-08-31 23:18:46 +00:00
|
|
|
* XXX: this belongs in an nsDocShellErrors.h file of some sort.
|
|
|
|
*/
|
|
|
|
#define NS_ERROR_MALWARE_URI NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_URILOADER, 30)
|
2007-10-29 18:29:14 +00:00
|
|
|
#define NS_ERROR_PHISHING_URI NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_URILOADER, 31)
|
2007-08-31 23:18:46 +00:00
|
|
|
|
2008-04-03 03:02:08 +00:00
|
|
|
/**
|
|
|
|
* Used when "Save Link As..." doesn't see the headers quickly enough to choose
|
|
|
|
* a filename. See nsContextMenu.js.
|
|
|
|
*/
|
2009-02-16 11:27:22 +00:00
|
|
|
#define NS_ERROR_SAVE_LINK_AS_TIMEOUT NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_URILOADER, 32)
|
|
|
|
|
|
|
|
/** Used when the data from a channel has already been parsed and cached
|
|
|
|
* so it doesn't need to be reparsed from the original source.
|
|
|
|
*/
|
|
|
|
#define NS_ERROR_PARSED_DATA_CACHED NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_URILOADER, 33)
|
2008-04-03 03:02:08 +00:00
|
|
|
|
1999-11-02 19:36:43 +00:00
|
|
|
#endif /* nsURILoader_h__ */
|