зеркало из https://github.com/mozilla/pjs.git
Last of the necko ifdefs. Now we link with necko.
This commit is contained in:
Родитель
9a161d923f
Коммит
f5e1196f42
|
@ -24,7 +24,10 @@
|
|||
#include "nsIDeviceContext.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsIStreamListener.h"
|
||||
#ifndef NECKO
|
||||
#include "nsINetSupport.h"
|
||||
#include "nsIRefreshUrl.h"
|
||||
#endif
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIScriptContextOwner.h"
|
||||
#include "nsIDocumentLoaderObserver.h"
|
||||
|
@ -45,7 +48,6 @@
|
|||
//#include "nsPluginsCID.h"
|
||||
#include "nsIPluginManager.h"
|
||||
#include "nsIPref.h"
|
||||
#include "nsIRefreshUrl.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsITimerCallback.h"
|
||||
#include "jsurl.h"
|
||||
|
@ -57,6 +59,7 @@
|
|||
#include "nsIStreamObserver.h"
|
||||
#include "nsIWebShellServices.h"
|
||||
#include "nsIGlobalHistory.h"
|
||||
#include "prmem.h"
|
||||
|
||||
#ifdef XP_PC
|
||||
#include <windows.h>
|
||||
|
@ -130,8 +133,10 @@ class nsWebShell : public nsIWebShell,
|
|||
public nsILinkHandler,
|
||||
public nsIScriptContextOwner,
|
||||
public nsIDocumentLoaderObserver,
|
||||
#ifndef NECKO
|
||||
public nsIRefreshUrl,
|
||||
public nsINetSupport,
|
||||
#endif
|
||||
// public nsIStreamObserver,
|
||||
public nsIClipboardCommands
|
||||
{
|
||||
|
@ -210,17 +215,29 @@ public:
|
|||
NS_IMETHOD LoadURL(const PRUnichar *aURLSpec,
|
||||
nsIPostData* aPostData=nsnull,
|
||||
PRBool aModifyHistory=PR_TRUE,
|
||||
#ifdef NECKO
|
||||
PRUint32 aType = nsIChannel::LOAD_NORMAL,
|
||||
#else
|
||||
nsURLReloadType aType = nsURLReload,
|
||||
#endif
|
||||
const PRUint32 localIP = 0);
|
||||
NS_IMETHOD LoadURL(const PRUnichar *aURLSpec,
|
||||
const char* aCommand,
|
||||
nsIPostData* aPostData=nsnull,
|
||||
PRBool aModifyHistory=PR_TRUE,
|
||||
#ifdef NECKO
|
||||
PRUint32 aType = nsIChannel::LOAD_NORMAL,
|
||||
#else
|
||||
nsURLReloadType aType = nsURLReload,
|
||||
#endif
|
||||
const PRUint32 localIP = 0);
|
||||
|
||||
NS_IMETHOD Stop(void);
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD Reload(PRUint32 aType);
|
||||
#else
|
||||
NS_IMETHOD Reload(nsURLReloadType aType);
|
||||
#endif
|
||||
|
||||
// History api's
|
||||
NS_IMETHOD Back(void);
|
||||
|
@ -278,6 +295,30 @@ public:
|
|||
NS_IMETHOD GetScriptGlobalObject(nsIScriptGlobalObject **aGlobal);
|
||||
NS_IMETHOD ReleaseScriptContext(nsIScriptContext *aContext);
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIDocumentLoaderObserver
|
||||
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL,
|
||||
const char* aCommand);
|
||||
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
PRInt32 aStatus,
|
||||
nsIDocumentLoaderObserver * );
|
||||
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, const char* aContentType,
|
||||
nsIContentViewer* aViewer);
|
||||
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, PRUint32 aProgress,
|
||||
PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, nsString& aMsg);
|
||||
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, PRInt32 aStatus);
|
||||
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
const char *aContentType,
|
||||
const char *aCommand );
|
||||
#else
|
||||
// nsIDocumentLoaderObserver
|
||||
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL,
|
||||
|
@ -300,6 +341,7 @@ public:
|
|||
nsIURI* aURL,
|
||||
const char *aContentType,
|
||||
const char *aCommand );
|
||||
#endif
|
||||
// NS_IMETHOD OnConnectionsComplete();
|
||||
|
||||
// nsIRefreshURL interface methods...
|
||||
|
@ -395,7 +437,9 @@ protected:
|
|||
nsIWidget* mWindow;
|
||||
nsIDocumentLoader* mDocLoader;
|
||||
nsIDocumentLoaderObserver* mDocLoaderObserver;
|
||||
#ifndef NECKO
|
||||
nsINetSupport* mNetSupport;
|
||||
#endif
|
||||
|
||||
nsIWebShell* mParent;
|
||||
nsVoidArray mChildren;
|
||||
|
@ -430,7 +474,11 @@ protected:
|
|||
nsresult DoLoadURL(const nsString& aUrlSpec,
|
||||
const char* aCommand,
|
||||
nsIPostData* aPostData,
|
||||
#ifdef NECKO
|
||||
PRUint32 aType,
|
||||
#else
|
||||
nsURLReloadType aType,
|
||||
#endif
|
||||
const PRUint32 aLocalIP);
|
||||
|
||||
float mZoom;
|
||||
|
@ -467,7 +515,10 @@ static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
|||
static NS_DEFINE_IID(kIScriptContextOwnerIID, NS_ISCRIPTCONTEXTOWNER_IID);
|
||||
static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
#ifndef NECKO
|
||||
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
|
||||
static NS_DEFINE_IID(kRefreshURLIID, NS_IREFRESHURL_IID);
|
||||
#endif
|
||||
static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID);
|
||||
static NS_DEFINE_IID(kIWebShellServicesIID, NS_IWEB_SHELL_SERVICES_IID);
|
||||
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);
|
||||
|
@ -476,7 +527,6 @@ static NS_DEFINE_IID(kIPluginHostIID, NS_IPLUGINHOST_IID);
|
|||
//static NS_DEFINE_IID(kCPluginHostCID, NS_PLUGIN_HOST_CID);
|
||||
static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
|
||||
static NS_DEFINE_IID(kIDocumentViewerIID, NS_IDOCUMENT_VIEWER_IID);
|
||||
static NS_DEFINE_IID(kRefreshURLIID, NS_IREFRESHURL_IID);
|
||||
static NS_DEFINE_IID(kITimerCallbackIID, NS_ITIMERCALLBACK_IID);
|
||||
static NS_DEFINE_IID(kIWebShellContainerIID, NS_IWEB_SHELL_CONTAINER_IID);
|
||||
static NS_DEFINE_IID(kIBrowserWindowIID, NS_IBROWSER_WINDOW_IID);
|
||||
|
@ -596,7 +646,9 @@ nsWebShell::~nsWebShell()
|
|||
NS_IF_RELEASE(mPrefs);
|
||||
NS_IF_RELEASE(mContainer);
|
||||
NS_IF_RELEASE(mObserver);
|
||||
#ifndef NECKO
|
||||
NS_IF_RELEASE(mNetSupport);
|
||||
#endif
|
||||
|
||||
if (nsnull != mScriptGlobal) {
|
||||
mScriptGlobal->SetWebShell(nsnull);
|
||||
|
@ -729,6 +781,7 @@ nsWebShell::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
#ifndef NECKO
|
||||
if (aIID.Equals(kRefreshURLIID)) {
|
||||
*aInstancePtr = (void*)(nsIRefreshUrl*)this;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -739,6 +792,7 @@ nsWebShell::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
if (aIID.Equals(kIClipboardCommandsIID)) {
|
||||
*aInstancePtr = (void*) ((nsIClipboardCommands*)this);
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -840,11 +894,19 @@ nsWebShell::GetContentViewer(nsIContentViewer** aResult)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::HandleUnknownContentType(nsIDocumentLoader* loader,
|
||||
#ifdef NECKO
|
||||
nsIChannel* channel,
|
||||
#else
|
||||
nsIURI* aURL,
|
||||
#endif
|
||||
const char *aContentType,
|
||||
const char *aCommand ) {
|
||||
// If we have a doc loader observer, let it respond to this.
|
||||
#ifdef NECKO
|
||||
return mDocLoaderObserver ? mDocLoaderObserver->HandleUnknownContentType( mDocLoader, channel, aContentType, aCommand )
|
||||
#else
|
||||
return mDocLoaderObserver ? mDocLoaderObserver->HandleUnknownContentType( mDocLoader, aURL, aContentType, aCommand )
|
||||
#endif
|
||||
: NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -1181,11 +1243,15 @@ NS_IMETHODIMP
|
|||
nsWebShell::SetObserver(nsIStreamObserver* anObserver)
|
||||
{
|
||||
NS_IF_RELEASE(mObserver);
|
||||
#ifndef NECKO
|
||||
NS_IF_RELEASE(mNetSupport);
|
||||
#endif
|
||||
|
||||
mObserver = anObserver;
|
||||
if (nsnull != mObserver) {
|
||||
#ifndef NECKO
|
||||
mObserver->QueryInterface(kINetSupportIID, (void **) &mNetSupport);
|
||||
#endif
|
||||
NS_ADDREF(mObserver);
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -1633,7 +1699,11 @@ NS_IMETHODIMP
|
|||
nsWebShell::LoadURL(const PRUnichar *aURLSpec,
|
||||
nsIPostData* aPostData,
|
||||
PRBool aModifyHistory,
|
||||
#ifdef NECKO
|
||||
PRUint32 aType,
|
||||
#else
|
||||
nsURLReloadType aType,
|
||||
#endif
|
||||
const PRUint32 aLocalIP)
|
||||
{
|
||||
// Initialize margnwidth, marginheight. Put scrolling back the way it was
|
||||
|
@ -1647,7 +1717,11 @@ nsresult
|
|||
nsWebShell::DoLoadURL(const nsString& aUrlSpec,
|
||||
const char* aCommand,
|
||||
nsIPostData* aPostData,
|
||||
#ifdef NECKO
|
||||
PRUint32 aType,
|
||||
#else
|
||||
nsURLReloadType aType,
|
||||
#endif
|
||||
const PRUint32 aLocalIP)
|
||||
|
||||
|
||||
|
@ -1655,7 +1729,12 @@ nsWebShell::DoLoadURL(const nsString& aUrlSpec,
|
|||
|
||||
// If it's a normal reload that uses the cache, look at the destination anchor
|
||||
// and see if it's an element within the current document
|
||||
if ((aType == nsURLReload) && (nsnull != mContentViewer)) {
|
||||
#ifdef NECKO
|
||||
if ((aType == nsIChannel::LOAD_NORMAL) && (nsnull != mContentViewer))
|
||||
#else
|
||||
if ((aType == nsURLReload) && (nsnull != mContentViewer))
|
||||
#endif
|
||||
{
|
||||
nsCOMPtr<nsIDocumentViewer> docViewer;
|
||||
if (NS_SUCCEEDED(mContentViewer->QueryInterface(kIDocumentViewerIID,
|
||||
getter_AddRefs(docViewer)))) {
|
||||
|
@ -1685,10 +1764,25 @@ nsWebShell::DoLoadURL(const nsString& aUrlSpec,
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
#endif // NECKO
|
||||
|
||||
if ((PRBool)docURL->Equals(url)) {
|
||||
#ifdef NECKO
|
||||
PRBool eq;
|
||||
rv = docURL->Equals(url, &eq);
|
||||
if (NS_SUCCEEDED(rv) && eq)
|
||||
#else
|
||||
if ((PRBool)docURL->Equals(url))
|
||||
#endif
|
||||
{
|
||||
// See if there's a destination anchor
|
||||
#ifdef NECKO
|
||||
char* ref = nsnull;
|
||||
nsCOMPtr<nsIURL> url2 = do_QueryInterface(url);
|
||||
if (url2) {
|
||||
rv = url2->GetRef(&ref);
|
||||
}
|
||||
#else
|
||||
const char* ref;
|
||||
url->GetRef(&ref);
|
||||
#endif
|
||||
|
||||
if (nsnull != ref) {
|
||||
// Get the pres shell object
|
||||
|
@ -1737,7 +1831,11 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec,
|
|||
const char* aCommand,
|
||||
nsIPostData* aPostData,
|
||||
PRBool aModifyHistory,
|
||||
#ifdef NECKO
|
||||
PRUint32 aType,
|
||||
#else
|
||||
nsURLReloadType aType,
|
||||
#endif
|
||||
const PRUint32 aLocalIP)
|
||||
{
|
||||
|
||||
|
@ -1866,7 +1964,11 @@ NS_IMETHODIMP nsWebShell::Stop(void)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsWebShell::Reload(PRUint32 aType)
|
||||
#else
|
||||
NS_IMETHODIMP nsWebShell::Reload(nsURLReloadType aType)
|
||||
#endif
|
||||
{
|
||||
nsString* s = (nsString*) mHistory.ElementAt(mHistoryIndex);
|
||||
if (nsnull != s) {
|
||||
|
@ -1928,7 +2030,11 @@ nsWebShell::GoTo(PRInt32 aHistoryIndex)
|
|||
rv = DoLoadURL(urlSpec, // URL string
|
||||
"view", // Command
|
||||
nsnull, // Post Data
|
||||
#ifdef NECKO
|
||||
nsIChannel::LOAD_NORMAL, // the reload type
|
||||
#else
|
||||
nsURLReload, // the reload type
|
||||
#endif
|
||||
0); // load attributes
|
||||
}
|
||||
return rv;
|
||||
|
@ -2613,16 +2719,27 @@ nsWebShell::OnStartDocumentLoad(nsIDocumentLoader* loader,
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
#ifdef NECKO
|
||||
nsIChannel* channel,
|
||||
#else
|
||||
nsIURI* aURL,
|
||||
#endif
|
||||
PRInt32 aStatus,
|
||||
nsIDocumentLoaderObserver * aWebShell)
|
||||
{
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
|
||||
#if DEBUG_nisheeth
|
||||
const char* spec;
|
||||
aURL->GetSpec(&spec);
|
||||
printf("nsWebShell::OnEndDocumentLoad:%p: loader=%p url=%s status=%d\n", this, loader, spec, aStatus);
|
||||
#endif
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
||||
if (!mProcessedEndDocumentLoad) {
|
||||
mProcessedEndDocumentLoad = PR_TRUE;
|
||||
|
@ -2648,13 +2765,20 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
|||
// Fire the EndLoadURL of the web shell container
|
||||
if (nsnull != aURL) {
|
||||
nsAutoString urlString;
|
||||
#ifdef NECKO
|
||||
char* spec;
|
||||
#else
|
||||
const char* spec;
|
||||
#endif
|
||||
rv = aURL->GetSpec(&spec);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
urlString = spec;
|
||||
if (nsnull != mContainer) {
|
||||
rv = mContainer->EndLoadURL(this, urlString.GetUnicode(), 0);
|
||||
}
|
||||
#ifdef NECKO
|
||||
nsCRT::free(spec);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2683,7 +2807,11 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
|||
* Fire the OnEndDocumentLoad of the DocLoaderobserver
|
||||
*/
|
||||
if (dlObserver && (nsnull != aURL)) {
|
||||
#ifdef NECKO
|
||||
dlObserver->OnEndDocumentLoad(mDocLoader, channel, aStatus, aWebShell);
|
||||
#else
|
||||
dlObserver->OnEndDocumentLoad(mDocLoader, aURL, aStatus, aWebShell);
|
||||
#endif
|
||||
}
|
||||
|
||||
} //!mProcessedEndDocumentLoad
|
||||
|
@ -2696,10 +2824,21 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
#ifdef NECKO
|
||||
nsIChannel* channel,
|
||||
#else
|
||||
nsIURI* aURL,
|
||||
#endif
|
||||
const char* aContentType,
|
||||
nsIContentViewer* aViewer)
|
||||
{
|
||||
nsresult rv;
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
|
||||
|
||||
// XXX This is a temporary hack for meeting the M4 milestone
|
||||
// for seamonkey. I think Netlib should send a message to all stream listeners
|
||||
|
@ -2718,14 +2857,22 @@ nsWebShell::OnStartURLLoad(nsIDocumentLoader* loader,
|
|||
*/
|
||||
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
|
||||
{
|
||||
#ifdef NECKO
|
||||
mDocLoaderObserver->OnStartURLLoad(mDocLoader, channel, aContentType, aViewer);
|
||||
#else
|
||||
mDocLoaderObserver->OnStartURLLoad(mDocLoader, aURL, aContentType, aViewer);
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
#ifdef NECKO
|
||||
nsIChannel* channel,
|
||||
#else
|
||||
nsIURI* aURL,
|
||||
#endif
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
{
|
||||
|
@ -2734,7 +2881,11 @@ nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
|
|||
*/
|
||||
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
|
||||
{
|
||||
#ifdef NECKO
|
||||
mDocLoaderObserver->OnProgressURLLoad(mDocLoader, channel, aProgress, aProgressMax);
|
||||
#else
|
||||
mDocLoaderObserver->OnProgressURLLoad(mDocLoader, aURL, aProgress, aProgressMax);
|
||||
#endif
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -2742,7 +2893,11 @@ nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
#ifdef NECKO
|
||||
nsIChannel* channel,
|
||||
#else
|
||||
nsIURI* aURL,
|
||||
#endif
|
||||
nsString& aMsg)
|
||||
{
|
||||
/*
|
||||
|
@ -2750,7 +2905,11 @@ nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
|
|||
*/
|
||||
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
|
||||
{
|
||||
#ifdef NECKO
|
||||
mDocLoaderObserver->OnStatusURLLoad(mDocLoader, channel, aMsg);
|
||||
#else
|
||||
mDocLoaderObserver->OnStatusURLLoad(mDocLoader, aURL, aMsg);
|
||||
#endif
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -2758,7 +2917,11 @@ nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::OnEndURLLoad(nsIDocumentLoader* loader,
|
||||
#ifdef NECKO
|
||||
nsIChannel* channel,
|
||||
#else
|
||||
nsIURI* aURL,
|
||||
#endif
|
||||
PRInt32 aStatus)
|
||||
{
|
||||
#if 0
|
||||
|
@ -2771,7 +2934,11 @@ nsWebShell::OnEndURLLoad(nsIDocumentLoader* loader,
|
|||
*/
|
||||
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
|
||||
{
|
||||
#ifdef NECKO
|
||||
mDocLoaderObserver->OnEndURLLoad(mDocLoader, channel, aStatus);
|
||||
#else
|
||||
mDocLoaderObserver->OnEndURLLoad(mDocLoader, aURL, aStatus);
|
||||
#endif
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -2816,7 +2983,11 @@ void refreshData::Notify(nsITimer *aTimer)
|
|||
{
|
||||
NS_PRECONDITION((nsnull != mShell), "Null pointer...");
|
||||
if (nsnull != mShell) {
|
||||
#ifdef NECKO
|
||||
mShell->LoadURL(mUrlSpec.GetUnicode(), nsnull, PR_TRUE, nsIChannel::LOAD_NORMAL);
|
||||
#else
|
||||
mShell->LoadURL(mUrlSpec.GetUnicode(), nsnull, PR_TRUE, nsURLReload);
|
||||
#endif
|
||||
}
|
||||
/*
|
||||
* LoadURL(...) will cancel all refresh timers... This causes the Timer and
|
||||
|
@ -2836,9 +3007,16 @@ nsWebShell::RefreshURL(nsIURI* aURL, PRInt32 millis, PRBool repeat)
|
|||
goto done;
|
||||
}
|
||||
|
||||
#ifdef NECKO
|
||||
char* spec;
|
||||
#else
|
||||
const char* spec;
|
||||
#endif
|
||||
aURL->GetSpec(&spec);
|
||||
rv = RefreshURL(spec, millis, repeat);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(spec);
|
||||
#endif
|
||||
done:
|
||||
return rv;
|
||||
}
|
||||
|
@ -2955,9 +3133,16 @@ nsresult nsWebShell::CheckForTrailingSlash(nsIURI* aURL)
|
|||
nsString * historyURL = (nsString *) new nsString(url);
|
||||
|
||||
/* Get the url that netlib passed us */
|
||||
#ifdef NECKO
|
||||
char* spec;
|
||||
#else
|
||||
const char* spec;
|
||||
#endif
|
||||
aURL->GetSpec(&spec);
|
||||
nsString* newURL = (nsString*) new nsString(spec);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(spec);
|
||||
#endif
|
||||
|
||||
if (newURL && newURL->Last() == '/' && !historyURL->Equals(*newURL)) {
|
||||
// Replace the top most history entry with the new url
|
||||
|
@ -3047,9 +3232,13 @@ nsWebShell::OnStopBinding(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
|
|||
NS_IMETHODIMP_(void)
|
||||
nsWebShell::Alert(const nsString &aText)
|
||||
{
|
||||
#ifdef NECKO
|
||||
NS_ASSERTION(0, "help");
|
||||
#else
|
||||
if (nsnull != mNetSupport) {
|
||||
mNetSupport->Alert(aText);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(PRBool)
|
||||
|
@ -3057,9 +3246,13 @@ nsWebShell::Confirm(const nsString &aText)
|
|||
{
|
||||
PRBool bResult = PR_FALSE;
|
||||
|
||||
#ifdef NECKO
|
||||
NS_ASSERTION(0, "help");
|
||||
#else
|
||||
if (nsnull != mNetSupport) {
|
||||
bResult = mNetSupport->Confirm(aText);
|
||||
}
|
||||
#endif
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
@ -3070,9 +3263,13 @@ nsWebShell::Prompt(const nsString &aText,
|
|||
{
|
||||
PRBool bResult = PR_FALSE;
|
||||
|
||||
#ifdef NECKO
|
||||
NS_ASSERTION(0, "help");
|
||||
#else
|
||||
if (nsnull != mNetSupport) {
|
||||
bResult = mNetSupport->Prompt(aText, aDefault, aResult);
|
||||
}
|
||||
#endif
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
@ -3083,9 +3280,13 @@ nsWebShell::PromptUserAndPassword(const nsString &aText,
|
|||
{
|
||||
PRBool bResult = PR_FALSE;
|
||||
|
||||
#ifdef NECKO
|
||||
NS_ASSERTION(0, "help");
|
||||
#else
|
||||
if (nsnull != mNetSupport) {
|
||||
bResult = mNetSupport->PromptUserAndPassword(aText, aUser, aPassword);
|
||||
}
|
||||
#endif
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
@ -3095,9 +3296,13 @@ nsWebShell::PromptPassword(const nsString &aText,
|
|||
{
|
||||
PRBool bResult = PR_FALSE;
|
||||
|
||||
#ifdef NECKO
|
||||
NS_ASSERTION(0, "help");
|
||||
#else
|
||||
if (nsnull != mNetSupport) {
|
||||
bResult = mNetSupport->PromptPassword(aText, aPassword);
|
||||
}
|
||||
#endif
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,11 @@ MISCDEP = \
|
|||
$(DIST)\lib\jsdomcss_s.lib \
|
||||
$(DIST)\lib\jsurl.lib \
|
||||
$(DIST)\lib\raptorgfxwin.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(DIST)\lib\js32$(VERSION_NUMBER).lib \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\plds3.lib \
|
||||
|
@ -70,7 +74,11 @@ LLIBS= \
|
|||
$(DIST)\lib\jsdomcss_s.lib \
|
||||
$(DIST)\lib\jsurl.lib \
|
||||
$(DIST)\lib\raptorgfxwin.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(DIST)\lib\js32$(VERSION_NUMBER).lib \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\plds3.lib \
|
||||
|
|
|
@ -127,7 +127,10 @@ LLIBS= \
|
|||
$(DIST)\lib\plc3.lib \
|
||||
$(DIST)\lib\raptorhtmlpars.lib \
|
||||
$(DIST)\lib\raptorwidget_s.lib \
|
||||
!ifdef NECKO
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(LIBNSPR)
|
||||
!if "$(MOZ_BITS)"=="32" && defined(MOZ_DEBUG) && defined(GLOWCODE)
|
||||
LLIBS=$(LLIBS) $(GLOWDIR)\glowcode.lib
|
||||
|
@ -136,7 +139,7 @@ LLIBS=$(LLIBS) $(GLOWDIR)\glowcode.lib
|
|||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
libs:: $(DLL)
|
||||
install:: $(DLL)
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin\components
|
||||
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib
|
||||
|
||||
|
|
|
@ -101,7 +101,10 @@ static NS_DEFINE_CID(kCSpellCheckerCID, NS_SPELLCHECKER_CID);
|
|||
static NS_DEFINE_IID(kFileWidgetCID, NS_FILEWIDGET_CID);
|
||||
|
||||
/* Define Interface IDs */
|
||||
#ifdef NECKO
|
||||
#else
|
||||
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
|
||||
#endif
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
#define APP_DEBUG 0
|
||||
|
|
|
@ -27,7 +27,10 @@
|
|||
|
||||
#include "nsIEditorShell.h"
|
||||
#include "nsIDocumentLoaderObserver.h"
|
||||
#ifdef NECKO
|
||||
#else
|
||||
#include "nsINetSupport.h"
|
||||
#endif
|
||||
#include "nsIStreamObserver.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsVoidArray.h"
|
||||
|
|
|
@ -101,7 +101,10 @@ static NS_DEFINE_CID(kCSpellCheckerCID, NS_SPELLCHECKER_CID);
|
|||
static NS_DEFINE_IID(kFileWidgetCID, NS_FILEWIDGET_CID);
|
||||
|
||||
/* Define Interface IDs */
|
||||
#ifdef NECKO
|
||||
#else
|
||||
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
|
||||
#endif
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
|
||||
#define APP_DEBUG 0
|
||||
|
|
|
@ -27,7 +27,10 @@
|
|||
|
||||
#include "nsIEditorShell.h"
|
||||
#include "nsIDocumentLoaderObserver.h"
|
||||
#ifdef NECKO
|
||||
#else
|
||||
#include "nsINetSupport.h"
|
||||
#endif
|
||||
#include "nsIStreamObserver.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
#include "nsVoidArray.h"
|
||||
|
|
|
@ -55,7 +55,11 @@ LINCS = -I$(PUBLIC)/js \
|
|||
-I$(PUBLIC)\xpcom \
|
||||
-I$(PUBLIC)\raptor \
|
||||
-I$(PUBLIC)\pref \
|
||||
-I$(PUBLIC)\netlib \
|
||||
!ifdef NECKO
|
||||
-I$(PUBLIC)\necko \
|
||||
!else
|
||||
-I$(PUBLIC)\netlib \
|
||||
!endif
|
||||
-I$(DEPTH)\include \
|
||||
|
||||
MAKE_OBJ_TYPE = DLL
|
||||
|
@ -73,7 +77,11 @@ LLIBS = \
|
|||
$(DIST)\lib\plc3.lib \
|
||||
$(LIBNSPR) \
|
||||
$(DIST)\lib\js$(MOZ_BITS)$(VERSION_NUMBER).lib \
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\xppref32.lib \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
|
@ -25,10 +25,8 @@
|
|||
#include "nsIPref.h"
|
||||
#include "nsIURL.h"
|
||||
#ifdef NECKO
|
||||
#include "nsIIOService.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIServiceManager.h"
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
#include "nsNeckoUtil.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#endif // NECKO
|
||||
#include "nsIParser.h"
|
||||
#include "nsParserCIID.h"
|
||||
|
@ -146,6 +144,15 @@ public:
|
|||
virtual ~nsPICS(void);
|
||||
|
||||
// nsIDocumentLoaderObserver
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand);
|
||||
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus, nsIDocumentLoaderObserver* aObserver);
|
||||
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, const char* aContentType, nsIContentViewer* aViewer);
|
||||
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg);
|
||||
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus);
|
||||
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader, nsIChannel* channel, const char *aContentType,const char *aCommand );
|
||||
#else
|
||||
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL,
|
||||
const char* aCommand);
|
||||
|
@ -167,6 +174,7 @@ public:
|
|||
nsIURI* aURL,
|
||||
const char *aContentType,
|
||||
const char *aCommand );
|
||||
#endif
|
||||
// NS_IMETHOD OnConnectionsComplete();
|
||||
|
||||
|
||||
|
@ -758,10 +766,17 @@ nsPICS::OnStartDocumentLoad(nsIDocumentLoader* loader,
|
|||
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsPICS::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
PRInt32 aStatus,
|
||||
nsIDocumentLoaderObserver* aObserver)
|
||||
#else
|
||||
nsPICS::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL,
|
||||
PRInt32 aStatus,
|
||||
nsIDocumentLoaderObserver * aObserver)
|
||||
#endif
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
@ -787,13 +802,26 @@ nsPICS::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsPICS::OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
const char* aContentType,
|
||||
nsIContentViewer* aViewer)
|
||||
#else
|
||||
nsPICS::OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL,
|
||||
const char* aContentType,
|
||||
nsIContentViewer* aViewer)
|
||||
#endif
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
|
||||
nsIContentViewerContainer *cont;
|
||||
|
||||
if(!mPICSRatingsEnabled)
|
||||
|
@ -856,10 +884,17 @@ nsPICS::OnStartURLLoad(nsIDocumentLoader* loader,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsPICS::OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
#else
|
||||
nsPICS::OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL,
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
#endif
|
||||
{
|
||||
if(!mPICSRatingsEnabled)
|
||||
return NS_OK;
|
||||
|
@ -867,9 +902,15 @@ nsPICS::OnProgressURLLoad(nsIDocumentLoader* loader,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsPICS::OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
nsString& aMsg)
|
||||
#else
|
||||
nsPICS::OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL,
|
||||
nsString& aMsg)
|
||||
#endif
|
||||
{
|
||||
if(!mPICSRatingsEnabled)
|
||||
return NS_OK;
|
||||
|
@ -877,15 +918,34 @@ nsPICS::OnStatusURLLoad(nsIDocumentLoader* loader,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
PRInt32 aStatus)
|
||||
#else
|
||||
nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL,
|
||||
PRInt32 aStatus)
|
||||
#endif
|
||||
{
|
||||
nsIContentViewerContainer *cont;
|
||||
nsresult rv;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
|
||||
nsIContentViewerContainer *cont;
|
||||
#ifdef NECKO
|
||||
char* uProtocol;
|
||||
char* uHost;
|
||||
char* uFile;
|
||||
#else
|
||||
const char* uProtocol;
|
||||
const char* uHost;
|
||||
const char* uFile;
|
||||
#endif
|
||||
nsIURI* rootURL;
|
||||
nsIWebShellServices *ws;
|
||||
|
||||
|
@ -923,29 +983,49 @@ nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
|
|||
PICS_URLData* urlData = (PICS_URLData*)currentURLList->ElementAt(i);
|
||||
if(urlData == nsnull)
|
||||
continue;
|
||||
#ifdef NECKO
|
||||
char* spec1;
|
||||
char* spec2;
|
||||
#else
|
||||
const char* spec1;
|
||||
const char* spec2;
|
||||
#endif
|
||||
|
||||
if(aURL == nsnull)
|
||||
continue;
|
||||
aURL->GetSpec(&spec1);
|
||||
if(urlData->url == nsnull)
|
||||
continue;
|
||||
(urlData->url)->GetSpec(&spec2);
|
||||
|
||||
if(spec1 == nsnull)
|
||||
continue;
|
||||
|
||||
if(spec2 == nsnull)
|
||||
if(urlData->url == nsnull) {
|
||||
#ifdef NECKO
|
||||
nsCRT::free(spec1);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
(urlData->url)->GetSpec(&spec2);
|
||||
|
||||
if(spec2 == nsnull) {
|
||||
#ifdef NECKO
|
||||
nsCRT::free(spec1);
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
if(0 == PL_strcmp(spec1, spec2)) {
|
||||
if(!urlData->notified) {
|
||||
currentURLList->RemoveElementAt(i);
|
||||
if (nsnull != aURL) {
|
||||
#ifdef NECKO
|
||||
aURL->GetScheme(&uProtocol);
|
||||
aURL->GetHost(&uHost);
|
||||
aURL->GetPath(&uFile);
|
||||
#else
|
||||
aURL->GetProtocol(&uProtocol);
|
||||
aURL->GetHost(&uHost);
|
||||
aURL->GetFile(&uFile);
|
||||
#endif
|
||||
if ((0 != PL_strcmp("/", uFile)) && (0 != PL_strcmp("/index.html", uFile))) {
|
||||
if (0 != PL_strcmp("file", uProtocol)) {
|
||||
nsAutoString protocolStr(uProtocol);
|
||||
|
@ -957,24 +1037,23 @@ nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
|
|||
#ifndef NECKO
|
||||
rv = NS_NewURL(&rootURL, rootStr);
|
||||
#else
|
||||
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsIURI *uri = nsnull;
|
||||
const char *uriStr = rootStr.GetBuffer();
|
||||
rv = service->NewURI(uriStr, nsnull, &uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&rootURL);
|
||||
NS_RELEASE(uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = NS_NewURI(&rootURL, rootStr);
|
||||
#endif // NECKO
|
||||
// rv = GetRootURL(rootURL);
|
||||
}
|
||||
}
|
||||
#ifdef NECKO
|
||||
nsCRT::free(uProtocol);
|
||||
nsCRT::free(uHost);
|
||||
nsCRT::free(uFile);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef NECKO
|
||||
nsCRT::free(spec1);
|
||||
nsCRT::free(spec2);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -984,10 +1063,18 @@ nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsPICS::HandleUnknownContentType(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
const char *aContentType,
|
||||
const char *aCommand )
|
||||
#else
|
||||
nsPICS::HandleUnknownContentType(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL,
|
||||
const char *aContentType,
|
||||
const char *aCommand ) {
|
||||
const char *aCommand )
|
||||
#endif
|
||||
{
|
||||
// If we have a doc loader observer, let it respond to this.
|
||||
// return mDocLoaderObserver ? mDocLoaderObserver->HandleUnknownContentType( mDocLoader, aURL, aContentType, aCommand )
|
||||
//: NS_ERROR_FAILURE;
|
||||
|
@ -1460,10 +1547,7 @@ nsPICS::GetRootURL(nsIURI* aURL)
|
|||
return rv;
|
||||
mParser->Parse(aURL);
|
||||
#ifdef NECKO
|
||||
NS_WITH_SERVICE(nsIIOService, serv, kIOServiceCID, &rv);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = serv->NewChannelFromURI("load", aURL, getter);
|
||||
}
|
||||
rv = NS_OpenURI(lsnr, aURL);
|
||||
#else
|
||||
rv = NS_OpenURL(aURL, lsnr);
|
||||
#endif
|
||||
|
|
|
@ -194,7 +194,7 @@ NS_IMETHODIMP nsPICSElementObserver::Notify(PRUint32 aDocumentID,
|
|||
if(ws) {
|
||||
char * text = PR_GetEnv("NGLAYOUT_HOME");
|
||||
nsString mtemplateURL = text ? text : "resource:/res/samples/picstest1.html";
|
||||
// ws->LoadURL(mtemplateURL, nsnull, nsnull);
|
||||
// ws->LoadURL(mtemplateURL, nsnull, nsnull);
|
||||
nsCharsetSource s;
|
||||
ws->SetRendering(PR_TRUE);
|
||||
ws->StopDocumentLoad();
|
||||
|
|
|
@ -20,7 +20,11 @@
|
|||
#include "nsIAllocator.h"
|
||||
#include "plstr.h"
|
||||
#include "stdio.h"
|
||||
#ifdef NECKO
|
||||
#include "nsIIOService.h"
|
||||
#else
|
||||
#include "nsINetService.h"
|
||||
#endif
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
@ -29,8 +33,12 @@
|
|||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsICookieViewer.h"
|
||||
|
||||
#ifdef NECKO
|
||||
static NS_DEFINE_IID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
#else
|
||||
static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
|
||||
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
|
||||
#endif
|
||||
|
||||
class CookieViewerImpl : public nsICookieViewer
|
||||
{
|
||||
|
@ -85,8 +93,14 @@ CookieViewerImpl::GetCookieValue(char** aValue)
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
nsINetService *netservice;
|
||||
nsresult res;
|
||||
#ifdef NECKO
|
||||
NS_WITH_SERVICE(nsIIOService, ioServ, kIOServiceCID, &res);
|
||||
if (NS_FAILED(res)) return res;
|
||||
|
||||
NS_ASSERTION(0, "implement GetCookieListForViewer");
|
||||
#else
|
||||
nsINetService *netservice;
|
||||
res = nsServiceManager::GetService(kNetServiceCID,
|
||||
kINetServiceIID,
|
||||
(nsISupports **)&netservice);
|
||||
|
@ -97,6 +111,7 @@ CookieViewerImpl::GetCookieValue(char** aValue)
|
|||
*aValue = cookieList.ToNewCString();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -108,8 +123,14 @@ CookieViewerImpl::GetPermissionValue(char** aValue)
|
|||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
|
||||
nsINetService *netservice;
|
||||
nsresult res;
|
||||
#ifdef NECKO
|
||||
NS_WITH_SERVICE(nsIIOService, ioServ, kIOServiceCID, &res);
|
||||
if (NS_FAILED(res)) return res;
|
||||
|
||||
NS_ASSERTION(0, "implement GetPermissionListForViewer");
|
||||
#else
|
||||
nsINetService *netservice;
|
||||
res = nsServiceManager::GetService(kNetServiceCID,
|
||||
kINetServiceIID,
|
||||
(nsISupports **)&netservice);
|
||||
|
@ -120,6 +141,7 @@ CookieViewerImpl::GetPermissionValue(char** aValue)
|
|||
*aValue = PermissionList.ToNewCString();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
||||
|
@ -169,8 +191,14 @@ CookieViewerImpl::SetValue(const char* aValue, nsIDOMWindow* win)
|
|||
if (! aValue) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
nsINetService *netservice;
|
||||
nsresult res;
|
||||
#ifdef NECKO
|
||||
NS_WITH_SERVICE(nsIIOService, ioServ, kIOServiceCID, &res);
|
||||
if (NS_FAILED(res)) return res;
|
||||
|
||||
NS_ASSERTION(0, "implement CookieViewerReturn");
|
||||
#else
|
||||
nsINetService *netservice;
|
||||
res = nsServiceManager::GetService(kNetServiceCID,
|
||||
kINetServiceIID,
|
||||
(nsISupports **)&netservice);
|
||||
|
@ -178,5 +206,6 @@ CookieViewerImpl::SetValue(const char* aValue, nsIDOMWindow* win)
|
|||
nsAutoString netList = aValue;
|
||||
res = netservice->Cookie_CookieViewerReturn(netList);
|
||||
}
|
||||
#endif
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -44,7 +44,9 @@ LLIBS=$(LLIBS) $(LIBNSPR) \
|
|||
$(DIST)\lib\xppref32.lib \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\xplib.lib \
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!ifndef NECKO
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(NULL)
|
||||
|
||||
LINCS= \
|
||||
|
@ -52,7 +54,6 @@ LINCS= \
|
|||
-I$(PUBLIC)\xpcom \
|
||||
-I$(PUBLIC)\dom \
|
||||
-I$(PUBLIC)\js \
|
||||
-I$(PUBLIC)\netlib \
|
||||
-I$(PUBLIC)\security\
|
||||
-I$(PUBLIC)\pref \
|
||||
-I$(PUBLIC)\wallet \
|
||||
|
|
|
@ -1593,12 +1593,27 @@ wallet_InitializeCurrentURL(nsIDocument * doc) {
|
|||
}
|
||||
|
||||
/* get host+file */
|
||||
#ifdef NECKO
|
||||
char* host;
|
||||
#else
|
||||
const char* host;
|
||||
#endif
|
||||
url->GetHost(&host);
|
||||
nsAutoString urlName = nsAutoString(host);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(host);
|
||||
#endif
|
||||
#ifdef NECKO
|
||||
char* file;
|
||||
url->GetPath(&file);
|
||||
#else
|
||||
const char* file;
|
||||
url->GetFile(&file);
|
||||
#endif
|
||||
urlName = urlName + file;
|
||||
#ifdef NECKO
|
||||
nsCRT::free(file);
|
||||
#endif
|
||||
NS_RELEASE(url);
|
||||
|
||||
/* get field/schema mapping specific to current url */
|
||||
|
|
|
@ -61,11 +61,7 @@ public:
|
|||
* Initialize an image group with a device context. All images
|
||||
* in this group will be decoded for the specified device context.
|
||||
*/
|
||||
#ifdef NECKO
|
||||
virtual nsresult Init(nsIDeviceContext *aDeviceContext) = 0;
|
||||
#else
|
||||
virtual nsresult Init(nsIDeviceContext *aDeviceContext, nsILoadGroup* aLoadGroup) = 0;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Add an observers to be informed of image group notifications.
|
||||
|
|
|
@ -853,7 +853,11 @@ char *str;
|
|||
if (gImageGroup == NULL)
|
||||
{
|
||||
nsIDeviceContext *deviceCtx = gWindow->GetDeviceContext();
|
||||
#ifdef NECKO
|
||||
if (NS_NewImageGroup(&gImageGroup) != NS_OK || gImageGroup->Init(deviceCtx) != NS_OK)
|
||||
#else
|
||||
if (NS_NewImageGroup(&gImageGroup) != NS_OK || gImageGroup->Init(deviceCtx, nsnull) != NS_OK)
|
||||
#endif
|
||||
{
|
||||
::MessageBox(NULL, "Couldn't create image group",class1Name, MB_OK);
|
||||
NS_RELEASE(deviceCtx);
|
||||
|
|
|
@ -68,7 +68,12 @@ LCFLAGS = \
|
|||
|
||||
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\dom \
|
||||
-I$(PUBLIC)\js -I..\..\style\src -I..\html\base\src -I..\base\src \
|
||||
-I$(PUBLIC)\netlib -I$(PUBLIC)\rdf
|
||||
!ifdef NECKO
|
||||
-I$(PUBLIC)\necko \
|
||||
!else
|
||||
-I$(PUBLIC)\netlib \
|
||||
!endif
|
||||
-I$(PUBLIC)\rdf
|
||||
|
||||
# These are the libraries we need to link with to create the dll
|
||||
LLIBS= \
|
||||
|
@ -88,7 +93,11 @@ LLIBS= \
|
|||
$(DIST)\lib\raptorgfxwin.lib \
|
||||
$(DIST)\lib\raptorhtmlpars.lib \
|
||||
$(DIST)\lib\jsdom.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(DIST)\lib\plc3.lib \
|
||||
$(DIST)\lib\js32$(VERSION_NUMBER).lib \
|
||||
!if defined(MOZ_DEBUG) && defined(GLOWCODE) && "$(MOZ_BITS)"=="32"
|
||||
|
|
|
@ -36,7 +36,11 @@ LINCS= \
|
|||
-I$(PUBLIC)\raptor \
|
||||
-I$(PUBLIC)\dom \
|
||||
-I$(PUBLIC)\js \
|
||||
!ifdef NECKO
|
||||
-I$(PUBLIC)\necko \
|
||||
!else
|
||||
-I$(PUBLIC)\netlib \
|
||||
!endif
|
||||
-I..\base\src \
|
||||
-I..\style\src \
|
||||
-I..\..\css\layout\src \
|
||||
|
@ -57,7 +61,11 @@ LLIBS= \
|
|||
$(DIST)\lib\util.lib \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\jsdom.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(LIBNSPR) \
|
||||
$(DIST)\lib\plc3.lib \
|
||||
$(DIST)\lib\js32$(VERSION_NUMBER).lib
|
||||
|
|
|
@ -61,9 +61,6 @@ DIRS = \
|
|||
lib\libpwcac \
|
||||
!if !defined(NECKO)
|
||||
network \
|
||||
!endif
|
||||
!if defined(NECKO)
|
||||
netwerk \
|
||||
!endif
|
||||
profile \
|
||||
!endif
|
||||
|
@ -72,6 +69,9 @@ DIRS = \
|
|||
expat \
|
||||
htmlparser \
|
||||
gfx \
|
||||
!if defined(NECKO)
|
||||
netwerk \
|
||||
!endif
|
||||
widget \
|
||||
dom \
|
||||
view \
|
||||
|
|
|
@ -47,7 +47,11 @@ LINCS = \
|
|||
-I$(PUBLIC)\xpcom \
|
||||
-I$(PUBLIC)\plugin \
|
||||
-I$(PUBLIC)\java \
|
||||
!ifdef NECKO
|
||||
-I$(PUBLIC)\necko \
|
||||
!else
|
||||
-I$(PUBLIC)\netlib \
|
||||
!endif
|
||||
-I$(PUBLIC)\oji \
|
||||
-I$(PUBLIC)\cache \
|
||||
-I$(PUBLIC)\pref \
|
||||
|
@ -69,8 +73,12 @@ CACHELIBNAME=netcache.lib
|
|||
OURLIBS = \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\plc3.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
$(DIST)\lib\$(CACHELIBNAME) \
|
||||
!endif
|
||||
$(DIST)\lib\xppref32.lib \
|
||||
$(DIST)\lib\dbm32.lib \
|
||||
$(LIBNSPR)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
|
@ -37,6 +37,7 @@
|
|||
#include "nsIURL.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsNeckoUtil.h"
|
||||
#endif // NECKO
|
||||
|
||||
#include "nsIServiceManager.h"
|
||||
|
@ -101,7 +102,7 @@ nsPluginTag::nsPluginTag()
|
|||
mLibrary = nsnull;
|
||||
mEntryPoint = nsnull;
|
||||
mFlags = NS_PLUGIN_FLAG_ENABLED;
|
||||
mFileName = nsnull;
|
||||
mFileName = nsnull;
|
||||
}
|
||||
|
||||
inline char* new_str(char* str)
|
||||
|
@ -134,7 +135,7 @@ nsPluginTag::nsPluginTag(nsPluginTag* aPluginTag)
|
|||
mLibrary = nsnull;
|
||||
mEntryPoint = nsnull;
|
||||
mFlags = NS_PLUGIN_FLAG_ENABLED;
|
||||
mFileName = new_str(aPluginTag->mFileName);
|
||||
mFileName = new_str(aPluginTag->mFileName);
|
||||
}
|
||||
|
||||
nsPluginTag::~nsPluginTag()
|
||||
|
@ -393,8 +394,8 @@ public:
|
|||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartBinding(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt) { return NS_OK; }
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg) { return NS_OK; }
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
|
||||
|
@ -477,13 +478,14 @@ public:
|
|||
NS_IMETHOD OnProgress(nsISupports* context, PRUint32 progress,
|
||||
PRUint32 maxProgress);
|
||||
NS_IMETHOD OnStatus(nsISupports* context, const PRUnichar* aMsg);
|
||||
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartBinding(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt) { return NS_OK; }
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg);
|
||||
const PRUnichar *errorMsg) { return NS_OK; }
|
||||
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr,
|
||||
|
@ -783,7 +785,11 @@ nsPluginStreamListenerPeer::~nsPluginStreamListenerPeer()
|
|||
#ifdef NS_DEBUG
|
||||
if(mURL != nsnull)
|
||||
{
|
||||
#ifdef NECKO
|
||||
char* spec;
|
||||
#else
|
||||
const char* spec;
|
||||
#endif
|
||||
(void)mURL->GetSpec(&spec);
|
||||
printf("killing stream for %s\n", mURL ? spec : "(unknown URL)");
|
||||
#ifdef NECKO
|
||||
|
@ -840,9 +846,16 @@ nsresult nsPluginStreamListenerPeer::Initialize(nsIURI *aURL, nsIPluginInstance
|
|||
nsIPluginStreamListener* aListener)
|
||||
{
|
||||
#ifdef NS_DEBUG
|
||||
#ifdef NECKO
|
||||
char* spec;
|
||||
#else
|
||||
const char* spec;
|
||||
#endif
|
||||
(void)aURL->GetSpec(&spec);
|
||||
printf("created stream for %s\n", spec);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(spec);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
mURL = aURL;
|
||||
|
@ -870,9 +883,16 @@ nsresult nsPluginStreamListenerPeer::InitializeEmbeded(nsIURI *aURL, nsIPluginIn
|
|||
nsIPluginHost *aHost)
|
||||
{
|
||||
#ifdef NS_DEBUG
|
||||
#ifdef NECKO
|
||||
char* spec;
|
||||
#else
|
||||
const char* spec;
|
||||
#endif
|
||||
(void)aURL->GetSpec(&spec);
|
||||
printf("created stream for %s\n", spec);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(spec);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
mURL = aURL;
|
||||
|
@ -924,14 +944,14 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartBinding(nsIURI* aURL, const cha
|
|||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aContext));
|
||||
if (channel)
|
||||
{
|
||||
char* aContentType = nsnull;
|
||||
rv = channel->GetContentType(&aContentType);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
|
||||
char* aContentType = nsnull;
|
||||
rv = channel->GetContentType(&aContentType);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
|
||||
if (nsnull != aContentType)
|
||||
|
@ -975,8 +995,7 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartBinding(nsIURI* aURL, const cha
|
|||
|
||||
mOnStartBinding = PR_TRUE;
|
||||
#ifdef NECKO
|
||||
nsCRT::free(aContentType);
|
||||
}
|
||||
nsCRT::free(aContentType);
|
||||
#endif //NECKO
|
||||
return rv;
|
||||
}
|
||||
|
@ -1044,21 +1063,31 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInput
|
|||
{
|
||||
nsresult rv = NS_OK;
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel (do_QueryInterface(aContext));
|
||||
if (channel)
|
||||
{
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
nsCOMPtr<nsIChannel> channel (do_QueryInterface(aContext));
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
char* url;
|
||||
#else
|
||||
const char* url;
|
||||
#endif
|
||||
|
||||
if(!mPStreamListener)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
#ifdef NECKO
|
||||
char* urlString;
|
||||
#else
|
||||
const char* urlString;
|
||||
#endif
|
||||
aURL->GetSpec(&urlString);
|
||||
mPluginStreamInfo->SetURL(urlString);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(urlString);
|
||||
#endif
|
||||
|
||||
// if the plugin has requested an AsFileOnly stream, then don't call OnDataAvailable
|
||||
if(mStreamType != nsPluginStreamType_AsFileOnly)
|
||||
|
@ -1074,10 +1103,6 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInput
|
|||
rv = aIStream->Read(buffer, aLength, &amountRead);
|
||||
delete [] buffer;
|
||||
}
|
||||
#ifdef NECKO
|
||||
nsCRT::free(urlString);
|
||||
}
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -1103,12 +1128,16 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopBinding(nsIURI* aURL, nsresult a
|
|||
|
||||
if(nsnull != mPStreamListener)
|
||||
{
|
||||
const char* url;
|
||||
aURL->GetSpec(&url);
|
||||
|
||||
#ifdef NECKO
|
||||
char* urlString;
|
||||
#else
|
||||
const char* urlString;
|
||||
#endif
|
||||
aURL->GetSpec(&urlString);
|
||||
mPluginStreamInfo->SetURL(urlString);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(urlString);
|
||||
#endif
|
||||
|
||||
// tell the plugin that the stream has ended only if the cache is done
|
||||
if(mCacheDone)
|
||||
|
@ -1131,7 +1160,11 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopBinding(nsIURI* aURL, nsresult a
|
|||
nsresult nsPluginStreamListenerPeer::SetUpCache(nsIURI* aURL)
|
||||
{
|
||||
nsPluginCacheListener* cacheListener = new nsPluginCacheListener(this);
|
||||
#ifdef NECKO
|
||||
return NS_OpenURI(cacheListener, aURL);
|
||||
#else
|
||||
return NS_OpenURL(aURL, cacheListener);
|
||||
#endif
|
||||
}
|
||||
|
||||
nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIURI* aURL)
|
||||
|
@ -1155,9 +1188,16 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIURI* aURL)
|
|||
mPluginStreamInfo->SetSeekable(PR_FALSE);
|
||||
//mPluginStreamInfo->SetModified(??);
|
||||
|
||||
#ifdef NECKO
|
||||
char* urlString;
|
||||
aURL->GetSpec(&urlString);
|
||||
mPluginStreamInfo->SetURL(urlString);
|
||||
nsCRT::free(urlString);
|
||||
#else
|
||||
const char* urlString;
|
||||
aURL->GetSpec(&urlString);
|
||||
mPluginStreamInfo->SetURL(urlString);
|
||||
#endif
|
||||
|
||||
rv = mPStreamListener->OnStartBinding((nsIPluginStreamInfo*)mPluginStreamInfo);
|
||||
|
||||
|
@ -1624,17 +1664,7 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
|
|||
#ifndef NECKO
|
||||
rv = NS_NewURL(&url, aURLSpec);
|
||||
#else
|
||||
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsIURI *uri = nsnull;
|
||||
const char *uriStr = aURLSpec.GetBuffer();
|
||||
rv = service->NewURI(uriStr, nsnull, &uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
|
||||
NS_RELEASE(uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = NS_NewURI(&url, aURLSpec);
|
||||
#endif // NECKO
|
||||
|
||||
if (rv != NS_OK)
|
||||
|
@ -1681,7 +1711,11 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
|
|||
nsresult nsPluginHostImpl::FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstanceOwner *aOwner)
|
||||
{
|
||||
PRUint32 i;
|
||||
#ifdef NECKO
|
||||
char* url;
|
||||
#else
|
||||
const char* url;
|
||||
#endif
|
||||
if(!aURL)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
|
@ -1706,16 +1740,25 @@ nsresult nsPluginHostImpl::FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstan
|
|||
instance->SetWindow(window);
|
||||
|
||||
mActivePluginList[i].mStopped = PR_FALSE;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCRT::free(url);
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
#ifdef NECKO
|
||||
nsCRT::free(url);
|
||||
#endif
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
void nsPluginHostImpl::AddInstanceToActiveList(nsIPluginInstance* aInstance, nsIURI* aURL)
|
||||
{
|
||||
#ifdef NECKO
|
||||
char* url;
|
||||
#else
|
||||
const char* url;
|
||||
#endif
|
||||
if(!aURL)
|
||||
return;
|
||||
|
||||
|
@ -1750,8 +1793,10 @@ void nsPluginHostImpl::AddInstanceToActiveList(nsIPluginInstance* aInstance, nsI
|
|||
++mOldestActivePlugin;
|
||||
if(mOldestActivePlugin == MAX_ACTIVE_PLUGINS)
|
||||
mOldestActivePlugin = 0;
|
||||
|
||||
}
|
||||
#ifdef NECKO
|
||||
nsCRT::free(url);
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType,
|
||||
|
@ -1769,12 +1814,13 @@ NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType,
|
|||
// if don't have a mimetype, check by file extension
|
||||
if(!aMimeType)
|
||||
{
|
||||
const char* filename;
|
||||
char* extension;
|
||||
|
||||
#ifdef NECKO
|
||||
char* filename;
|
||||
aURL->GetPath(&filename);
|
||||
#else
|
||||
const char* filename;
|
||||
aURL->GetFile(&filename);
|
||||
#endif
|
||||
extension = PL_strrchr(filename, '.');
|
||||
|
@ -1786,7 +1832,7 @@ NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType,
|
|||
if(IsPluginEnabledForExtension(extension, mimetype) != NS_OK)
|
||||
return NS_ERROR_FAILURE;
|
||||
#ifdef NECKO
|
||||
nsCRT::free(filename);
|
||||
nsCRT::free(filename);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
@ -2174,7 +2220,7 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
|
|||
nsIPluginInstance *aInstance,
|
||||
nsIPluginStreamListener* aListener)
|
||||
{
|
||||
nsIURI *url;
|
||||
nsIURI *url;
|
||||
nsPluginStreamListenerPeer *listenerPeer = (nsPluginStreamListenerPeer *)new nsPluginStreamListenerPeer();
|
||||
if (listenerPeer == NULL)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -2186,17 +2232,7 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
|
|||
#ifndef NECKO
|
||||
rv = NS_NewURL(&url, aURL);
|
||||
#else
|
||||
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsIURI *uri = nsnull;
|
||||
const char *uriStr = aURL.GetBuffer();
|
||||
rv = service->NewURI(uriStr, nsnull, &uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
|
||||
NS_RELEASE(uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = NS_NewURI(&url, aURL);
|
||||
#endif // NECKO
|
||||
|
||||
if (NS_OK == rv)
|
||||
|
@ -2204,7 +2240,11 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
|
|||
rv = listenerPeer->Initialize(url, aInstance, aListener);
|
||||
|
||||
if (NS_OK == rv) {
|
||||
#ifdef NECKO
|
||||
rv = NS_OpenURI(listenerPeer, url);
|
||||
#else
|
||||
rv = NS_OpenURL(url, listenerPeer);
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_RELEASE(url);
|
||||
|
@ -2254,7 +2294,11 @@ nsresult nsPluginHostImpl::NewEmbededPluginStream(nsIURI* aURL,
|
|||
rv = NS_ERROR_ILLEGAL_VALUE;
|
||||
|
||||
if (NS_OK == rv) {
|
||||
#ifdef NECKO
|
||||
rv = NS_OpenURI(listener, aURL);
|
||||
#else
|
||||
rv = NS_OpenURL(aURL, listener);
|
||||
#endif
|
||||
}
|
||||
|
||||
//NS_RELEASE(aURL);
|
||||
|
|
|
@ -47,7 +47,11 @@ LINCS = \
|
|||
-I$(PUBLIC)\xpcom \
|
||||
-I$(PUBLIC)\plugin \
|
||||
-I$(PUBLIC)\java \
|
||||
!ifdef NECKO
|
||||
-I$(PUBLIC)\necko \
|
||||
!else
|
||||
-I$(PUBLIC)\netlib \
|
||||
!endif
|
||||
-I$(PUBLIC)\oji \
|
||||
-I$(PUBLIC)\cache \
|
||||
-I$(PUBLIC)\pref \
|
||||
|
@ -69,8 +73,12 @@ CACHELIBNAME=netcache.lib
|
|||
OURLIBS = \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\plc3.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
$(DIST)\lib\$(CACHELIBNAME) \
|
||||
!endif
|
||||
$(DIST)\lib\xppref32.lib \
|
||||
$(DIST)\lib\dbm32.lib \
|
||||
$(LIBNSPR)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
|
@ -37,6 +37,7 @@
|
|||
#include "nsIURL.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsNeckoUtil.h"
|
||||
#endif // NECKO
|
||||
|
||||
#include "nsIServiceManager.h"
|
||||
|
@ -101,7 +102,7 @@ nsPluginTag::nsPluginTag()
|
|||
mLibrary = nsnull;
|
||||
mEntryPoint = nsnull;
|
||||
mFlags = NS_PLUGIN_FLAG_ENABLED;
|
||||
mFileName = nsnull;
|
||||
mFileName = nsnull;
|
||||
}
|
||||
|
||||
inline char* new_str(char* str)
|
||||
|
@ -134,7 +135,7 @@ nsPluginTag::nsPluginTag(nsPluginTag* aPluginTag)
|
|||
mLibrary = nsnull;
|
||||
mEntryPoint = nsnull;
|
||||
mFlags = NS_PLUGIN_FLAG_ENABLED;
|
||||
mFileName = new_str(aPluginTag->mFileName);
|
||||
mFileName = new_str(aPluginTag->mFileName);
|
||||
}
|
||||
|
||||
nsPluginTag::~nsPluginTag()
|
||||
|
@ -393,8 +394,8 @@ public:
|
|||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartBinding(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt) { return NS_OK; }
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg) { return NS_OK; }
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
|
||||
|
@ -477,13 +478,14 @@ public:
|
|||
NS_IMETHOD OnProgress(nsISupports* context, PRUint32 progress,
|
||||
PRUint32 maxProgress);
|
||||
NS_IMETHOD OnStatus(nsISupports* context, const PRUnichar* aMsg);
|
||||
|
||||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartBinding(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt) { return NS_OK; }
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg);
|
||||
const PRUnichar *errorMsg) { return NS_OK; }
|
||||
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr,
|
||||
|
@ -783,7 +785,11 @@ nsPluginStreamListenerPeer::~nsPluginStreamListenerPeer()
|
|||
#ifdef NS_DEBUG
|
||||
if(mURL != nsnull)
|
||||
{
|
||||
#ifdef NECKO
|
||||
char* spec;
|
||||
#else
|
||||
const char* spec;
|
||||
#endif
|
||||
(void)mURL->GetSpec(&spec);
|
||||
printf("killing stream for %s\n", mURL ? spec : "(unknown URL)");
|
||||
#ifdef NECKO
|
||||
|
@ -840,9 +846,16 @@ nsresult nsPluginStreamListenerPeer::Initialize(nsIURI *aURL, nsIPluginInstance
|
|||
nsIPluginStreamListener* aListener)
|
||||
{
|
||||
#ifdef NS_DEBUG
|
||||
#ifdef NECKO
|
||||
char* spec;
|
||||
#else
|
||||
const char* spec;
|
||||
#endif
|
||||
(void)aURL->GetSpec(&spec);
|
||||
printf("created stream for %s\n", spec);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(spec);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
mURL = aURL;
|
||||
|
@ -870,9 +883,16 @@ nsresult nsPluginStreamListenerPeer::InitializeEmbeded(nsIURI *aURL, nsIPluginIn
|
|||
nsIPluginHost *aHost)
|
||||
{
|
||||
#ifdef NS_DEBUG
|
||||
#ifdef NECKO
|
||||
char* spec;
|
||||
#else
|
||||
const char* spec;
|
||||
#endif
|
||||
(void)aURL->GetSpec(&spec);
|
||||
printf("created stream for %s\n", spec);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(spec);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
mURL = aURL;
|
||||
|
@ -924,14 +944,14 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartBinding(nsIURI* aURL, const cha
|
|||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aContext));
|
||||
if (channel)
|
||||
{
|
||||
char* aContentType = nsnull;
|
||||
rv = channel->GetContentType(&aContentType);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
|
||||
char* aContentType = nsnull;
|
||||
rv = channel->GetContentType(&aContentType);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
|
||||
if (nsnull != aContentType)
|
||||
|
@ -975,8 +995,7 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartBinding(nsIURI* aURL, const cha
|
|||
|
||||
mOnStartBinding = PR_TRUE;
|
||||
#ifdef NECKO
|
||||
nsCRT::free(aContentType);
|
||||
}
|
||||
nsCRT::free(aContentType);
|
||||
#endif //NECKO
|
||||
return rv;
|
||||
}
|
||||
|
@ -1044,21 +1063,31 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInput
|
|||
{
|
||||
nsresult rv = NS_OK;
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel (do_QueryInterface(aContext));
|
||||
if (channel)
|
||||
{
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
nsCOMPtr<nsIChannel> channel (do_QueryInterface(aContext));
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
char* url;
|
||||
#else
|
||||
const char* url;
|
||||
#endif
|
||||
|
||||
if(!mPStreamListener)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
#ifdef NECKO
|
||||
char* urlString;
|
||||
#else
|
||||
const char* urlString;
|
||||
#endif
|
||||
aURL->GetSpec(&urlString);
|
||||
mPluginStreamInfo->SetURL(urlString);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(urlString);
|
||||
#endif
|
||||
|
||||
// if the plugin has requested an AsFileOnly stream, then don't call OnDataAvailable
|
||||
if(mStreamType != nsPluginStreamType_AsFileOnly)
|
||||
|
@ -1074,10 +1103,6 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInput
|
|||
rv = aIStream->Read(buffer, aLength, &amountRead);
|
||||
delete [] buffer;
|
||||
}
|
||||
#ifdef NECKO
|
||||
nsCRT::free(urlString);
|
||||
}
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -1103,12 +1128,16 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopBinding(nsIURI* aURL, nsresult a
|
|||
|
||||
if(nsnull != mPStreamListener)
|
||||
{
|
||||
const char* url;
|
||||
aURL->GetSpec(&url);
|
||||
|
||||
#ifdef NECKO
|
||||
char* urlString;
|
||||
#else
|
||||
const char* urlString;
|
||||
#endif
|
||||
aURL->GetSpec(&urlString);
|
||||
mPluginStreamInfo->SetURL(urlString);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(urlString);
|
||||
#endif
|
||||
|
||||
// tell the plugin that the stream has ended only if the cache is done
|
||||
if(mCacheDone)
|
||||
|
@ -1131,7 +1160,11 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopBinding(nsIURI* aURL, nsresult a
|
|||
nsresult nsPluginStreamListenerPeer::SetUpCache(nsIURI* aURL)
|
||||
{
|
||||
nsPluginCacheListener* cacheListener = new nsPluginCacheListener(this);
|
||||
#ifdef NECKO
|
||||
return NS_OpenURI(cacheListener, aURL);
|
||||
#else
|
||||
return NS_OpenURL(aURL, cacheListener);
|
||||
#endif
|
||||
}
|
||||
|
||||
nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIURI* aURL)
|
||||
|
@ -1155,9 +1188,16 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIURI* aURL)
|
|||
mPluginStreamInfo->SetSeekable(PR_FALSE);
|
||||
//mPluginStreamInfo->SetModified(??);
|
||||
|
||||
#ifdef NECKO
|
||||
char* urlString;
|
||||
aURL->GetSpec(&urlString);
|
||||
mPluginStreamInfo->SetURL(urlString);
|
||||
nsCRT::free(urlString);
|
||||
#else
|
||||
const char* urlString;
|
||||
aURL->GetSpec(&urlString);
|
||||
mPluginStreamInfo->SetURL(urlString);
|
||||
#endif
|
||||
|
||||
rv = mPStreamListener->OnStartBinding((nsIPluginStreamInfo*)mPluginStreamInfo);
|
||||
|
||||
|
@ -1624,17 +1664,7 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
|
|||
#ifndef NECKO
|
||||
rv = NS_NewURL(&url, aURLSpec);
|
||||
#else
|
||||
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsIURI *uri = nsnull;
|
||||
const char *uriStr = aURLSpec.GetBuffer();
|
||||
rv = service->NewURI(uriStr, nsnull, &uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
|
||||
NS_RELEASE(uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = NS_NewURI(&url, aURLSpec);
|
||||
#endif // NECKO
|
||||
|
||||
if (rv != NS_OK)
|
||||
|
@ -1681,7 +1711,11 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
|
|||
nsresult nsPluginHostImpl::FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstanceOwner *aOwner)
|
||||
{
|
||||
PRUint32 i;
|
||||
#ifdef NECKO
|
||||
char* url;
|
||||
#else
|
||||
const char* url;
|
||||
#endif
|
||||
if(!aURL)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
|
@ -1706,16 +1740,25 @@ nsresult nsPluginHostImpl::FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstan
|
|||
instance->SetWindow(window);
|
||||
|
||||
mActivePluginList[i].mStopped = PR_FALSE;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCRT::free(url);
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
#ifdef NECKO
|
||||
nsCRT::free(url);
|
||||
#endif
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
void nsPluginHostImpl::AddInstanceToActiveList(nsIPluginInstance* aInstance, nsIURI* aURL)
|
||||
{
|
||||
#ifdef NECKO
|
||||
char* url;
|
||||
#else
|
||||
const char* url;
|
||||
#endif
|
||||
if(!aURL)
|
||||
return;
|
||||
|
||||
|
@ -1750,8 +1793,10 @@ void nsPluginHostImpl::AddInstanceToActiveList(nsIPluginInstance* aInstance, nsI
|
|||
++mOldestActivePlugin;
|
||||
if(mOldestActivePlugin == MAX_ACTIVE_PLUGINS)
|
||||
mOldestActivePlugin = 0;
|
||||
|
||||
}
|
||||
#ifdef NECKO
|
||||
nsCRT::free(url);
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType,
|
||||
|
@ -1769,12 +1814,13 @@ NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType,
|
|||
// if don't have a mimetype, check by file extension
|
||||
if(!aMimeType)
|
||||
{
|
||||
const char* filename;
|
||||
char* extension;
|
||||
|
||||
#ifdef NECKO
|
||||
char* filename;
|
||||
aURL->GetPath(&filename);
|
||||
#else
|
||||
const char* filename;
|
||||
aURL->GetFile(&filename);
|
||||
#endif
|
||||
extension = PL_strrchr(filename, '.');
|
||||
|
@ -1786,7 +1832,7 @@ NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType,
|
|||
if(IsPluginEnabledForExtension(extension, mimetype) != NS_OK)
|
||||
return NS_ERROR_FAILURE;
|
||||
#ifdef NECKO
|
||||
nsCRT::free(filename);
|
||||
nsCRT::free(filename);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
|
@ -2174,7 +2220,7 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
|
|||
nsIPluginInstance *aInstance,
|
||||
nsIPluginStreamListener* aListener)
|
||||
{
|
||||
nsIURI *url;
|
||||
nsIURI *url;
|
||||
nsPluginStreamListenerPeer *listenerPeer = (nsPluginStreamListenerPeer *)new nsPluginStreamListenerPeer();
|
||||
if (listenerPeer == NULL)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
|
@ -2186,17 +2232,7 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
|
|||
#ifndef NECKO
|
||||
rv = NS_NewURL(&url, aURL);
|
||||
#else
|
||||
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsIURI *uri = nsnull;
|
||||
const char *uriStr = aURL.GetBuffer();
|
||||
rv = service->NewURI(uriStr, nsnull, &uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
|
||||
NS_RELEASE(uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
rv = NS_NewURI(&url, aURL);
|
||||
#endif // NECKO
|
||||
|
||||
if (NS_OK == rv)
|
||||
|
@ -2204,7 +2240,11 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
|
|||
rv = listenerPeer->Initialize(url, aInstance, aListener);
|
||||
|
||||
if (NS_OK == rv) {
|
||||
#ifdef NECKO
|
||||
rv = NS_OpenURI(listenerPeer, url);
|
||||
#else
|
||||
rv = NS_OpenURL(url, listenerPeer);
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_RELEASE(url);
|
||||
|
@ -2254,7 +2294,11 @@ nsresult nsPluginHostImpl::NewEmbededPluginStream(nsIURI* aURL,
|
|||
rv = NS_ERROR_ILLEGAL_VALUE;
|
||||
|
||||
if (NS_OK == rv) {
|
||||
#ifdef NECKO
|
||||
rv = NS_OpenURI(listener, aURL);
|
||||
#else
|
||||
rv = NS_OpenURL(aURL, listener);
|
||||
#endif
|
||||
}
|
||||
|
||||
//NS_RELEASE(aURL);
|
||||
|
|
|
@ -38,7 +38,11 @@ LLIBS=\
|
|||
$(DIST)\lib\rdfdatasource_s.lib \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\raptorgfxwin.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(DIST)\lib\plc3.lib \
|
||||
$(DIST)\lib\jsdom.lib \
|
||||
$(DIST)\lib\js3250.lib \
|
||||
|
|
|
@ -32,7 +32,11 @@ OBJS= .\$(OBJDIR)\rdfcat.obj
|
|||
LLIBS= \
|
||||
$(DIST)\lib\rdf.lib \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(DIST)\lib\plc3.lib \
|
||||
$(LIBNSPR)
|
||||
|
||||
|
|
|
@ -31,12 +31,12 @@
|
|||
#include "nsIInputStream.h"
|
||||
#ifndef NECKO
|
||||
#include "nsINetService.h"
|
||||
#include "nsIPostToServer.h"
|
||||
#else
|
||||
#include "nsIIOService.h"
|
||||
#endif // NECKO
|
||||
#include "nsIOutputStream.h"
|
||||
#include "nsIGenericFactory.h"
|
||||
#include "nsIPostToServer.h"
|
||||
#include "nsIRDFCompositeDataSource.h"
|
||||
#include "nsIRDFRemoteDataSource.h"
|
||||
#include "nsIRDFDocument.h"
|
||||
|
|
|
@ -32,7 +32,11 @@ OBJS= .\$(OBJDIR)\rdfpoll.obj
|
|||
LLIBS= \
|
||||
$(DIST)\lib\rdf.lib \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(DIST)\lib\plc3.lib \
|
||||
$(LIBNSPR)
|
||||
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -68,6 +68,15 @@ public:
|
|||
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg);
|
||||
|
||||
// nsIDocumentLoaderObserver
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand);
|
||||
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus, nsIDocumentLoaderObserver* aObserver);
|
||||
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, const char* aContentType, nsIContentViewer* aViewer);
|
||||
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg);
|
||||
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus);
|
||||
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader, nsIChannel* channel, const char *aContentType,const char *aCommand );
|
||||
#else
|
||||
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand);
|
||||
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus, nsIDocumentLoaderObserver* aObserver);
|
||||
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aContentType, nsIContentViewer* aViewer);
|
||||
|
@ -75,6 +84,7 @@ public:
|
|||
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, nsString& aMsg);
|
||||
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus);
|
||||
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader, nsIURI *aURL,const char *aContentType,const char *aCommand );
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -26,6 +26,9 @@
|
|||
class nsIContentViewer;
|
||||
class nsIURI;
|
||||
class nsIDocumentLoader;
|
||||
#ifdef NECKO
|
||||
class nsIChannel;
|
||||
#endif
|
||||
|
||||
#define NS_ICONTENT_VIEWER_CONTAINER_IID \
|
||||
{ 0xa6cf9055, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
|
||||
|
@ -48,7 +51,11 @@ public:
|
|||
NS_IMETHOD GetContentViewer(nsIContentViewer** aResult) = 0;
|
||||
|
||||
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* aLoader,
|
||||
#ifdef NECKO
|
||||
nsIChannel* channel,
|
||||
#else
|
||||
nsIURI* aURL,
|
||||
#endif
|
||||
const char *aContentType,
|
||||
const char *aCommand ) = 0;
|
||||
};
|
||||
|
|
|
@ -22,7 +22,9 @@
|
|||
#include "nsweb.h"
|
||||
#include "prtypes.h"
|
||||
#include "nsISupports.h"
|
||||
#ifndef NECKO
|
||||
#ifdef NECKO
|
||||
#include "nsIChannel.h"
|
||||
#else
|
||||
#include "nsILoadAttribs.h"
|
||||
#endif // NECKO
|
||||
|
||||
|
@ -100,20 +102,18 @@ public:
|
|||
nsISupports* aExtraInfo = nsnull,
|
||||
nsIStreamObserver* anObserver = nsnull,
|
||||
#ifdef NECKO
|
||||
PRBool bypassCache = PR_FALSE,
|
||||
PRBool bypassProxy = PR_FALSE,
|
||||
PRUint32 aType = nsIChannel::LOAD_NORMAL,
|
||||
#else
|
||||
nsURLReloadType type = nsURLReload,
|
||||
nsURLReloadType aType = nsURLReload,
|
||||
#endif
|
||||
const PRUint32 aLocalIP = 0) = 0;
|
||||
|
||||
NS_IMETHOD LoadSubDocument(const nsString& aURLSpec,
|
||||
nsISupports* aExtraInfo = nsnull,
|
||||
#ifdef NECKO
|
||||
PRBool bypassCache = PR_FALSE,
|
||||
PRBool bypassProxy = PR_FALSE,
|
||||
PRUint32 aType = nsIChannel::LOAD_NORMAL,
|
||||
#else
|
||||
nsURLReloadType type = nsURLReload,
|
||||
nsURLReloadType aType = nsURLReload,
|
||||
#endif
|
||||
const PRUint32 aLocalIP = 0) = 0;
|
||||
|
||||
|
|
|
@ -25,7 +25,9 @@
|
|||
class nsIURI;
|
||||
class nsIContentViewer;
|
||||
class nsIDocumentLoader;
|
||||
|
||||
#ifdef NECKO
|
||||
class nsIChannel;
|
||||
#endif
|
||||
|
||||
/* f6b4f550-317c-11d2-bd8c-00805f8ae3f4 */
|
||||
#define NS_IDOCUMENT_LOADER_OBSERVER_IID \
|
||||
|
@ -52,8 +54,13 @@ public:
|
|||
/**
|
||||
* Notify the observer that a document has been completely loaded.
|
||||
*/
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus,
|
||||
nsIDocumentLoaderObserver * aObserver) = 0;
|
||||
#else
|
||||
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus,
|
||||
nsIDocumentLoaderObserver * aObserver) = 0;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Notify the observer that the specified nsIURI has just started to load.
|
||||
|
@ -61,36 +68,62 @@ public:
|
|||
* This notification occurs after DNS resolution, and a connection to the
|
||||
* server has been established.
|
||||
*/
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, const char* aContentType,
|
||||
nsIContentViewer* aViewer) = 0;
|
||||
#else
|
||||
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aContentType,
|
||||
nsIContentViewer* aViewer) = 0;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Notify the observer that progress has occurred in the loading of the
|
||||
* specified URL...
|
||||
*/
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, PRUint32 aProgress,
|
||||
PRUint32 aProgressMax) = 0;
|
||||
#else
|
||||
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL, PRUint32 aProgress,
|
||||
PRUint32 aProgressMax) = 0;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Notify the observer that status text is available regarding the URL
|
||||
* being loaded...
|
||||
*/
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg) = 0;
|
||||
#else
|
||||
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, nsString& aMsg) = 0;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Notify the observer that the specified nsIURI has finished loading.
|
||||
*/
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus) = 0;
|
||||
#else
|
||||
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus) = 0;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Notify the observer that some content of unknown type has been
|
||||
* encountered...
|
||||
*/
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD HandleUnknownContentType( nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
const char *aContentType,
|
||||
const char *aCommand ) = 0;
|
||||
#else
|
||||
NS_IMETHOD HandleUnknownContentType( nsIDocumentLoader* loader,
|
||||
nsIURI *aURL,
|
||||
const char *aContentType,
|
||||
const char *aCommand ) = 0;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -23,7 +23,9 @@
|
|||
#include "nsIWidget.h"
|
||||
#include "nsIScrollableView.h"
|
||||
#include "nsIContentViewerContainer.h"
|
||||
#ifndef NECKO
|
||||
#ifdef NECKO
|
||||
#include "nsIChannel.h"
|
||||
#else
|
||||
#include "nsILoadAttribs.h"
|
||||
#endif // NECKO
|
||||
#include "nsIScrollableView.h"
|
||||
|
@ -336,8 +338,7 @@ public:
|
|||
nsIPostData* aPostData=nsnull,
|
||||
PRBool aModifyHistory=PR_TRUE,
|
||||
#ifdef NECKO
|
||||
PRBool bypassCache = PR_FALSE,
|
||||
PRBool bypassProxy = PR_FALSE,
|
||||
PRUint32 aType = nsIChannel::LOAD_NORMAL,
|
||||
#else
|
||||
nsURLReloadType aType=nsURLReload,
|
||||
#endif
|
||||
|
@ -351,8 +352,7 @@ public:
|
|||
nsIPostData* aPostData=nsnull,
|
||||
PRBool aModifyHistory=PR_TRUE,
|
||||
#ifdef NECKO
|
||||
PRBool bypassCache = PR_FALSE,
|
||||
PRBool bypassProxy = PR_FALSE,
|
||||
PRUint32 aType = nsIChannel::LOAD_NORMAL,
|
||||
#else
|
||||
nsURLReloadType aType=nsURLReload,
|
||||
#endif
|
||||
|
@ -368,7 +368,7 @@ public:
|
|||
* Reload the current document.
|
||||
*/
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD Reload(PRBool bypassCache, PRBool bypassProxy) = 0;
|
||||
NS_IMETHOD Reload(PRUint32 aType) = 0;
|
||||
#else
|
||||
NS_IMETHOD Reload(nsURLReloadType aType) = 0;
|
||||
#endif
|
||||
|
|
|
@ -38,7 +38,12 @@ CPP_OBJS= \
|
|||
$(NULL)
|
||||
|
||||
LINCS=-I..\public -I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor \
|
||||
-I$(PUBLIC)\dom -I$(PUBLIC)\js -I$(PUBLIC)\netlib \
|
||||
-I$(PUBLIC)\dom -I$(PUBLIC)\js \
|
||||
!ifdef NECKO
|
||||
-I$(PUBLIC)\necko \
|
||||
!else
|
||||
-I$(PUBLIC)\netlib \
|
||||
!endif
|
||||
-I$(PUBLIC)\plugin -I$(PUBLIC)\java -I$(PUBLIC)\pref -I$(PUBLIC)\profile \
|
||||
-I$(PUBLIC)\js -I$(DEPTH)\include -I$(PUBLIC)\jsurl \
|
||||
-I$(PUBLIC)\editor -I$(PUBLIC)\rdf \
|
||||
|
@ -72,7 +77,11 @@ LLIBS= \
|
|||
$(DIST)\lib\util.lib \
|
||||
$(DIST)\lib\plc3.lib \
|
||||
$(DIST)\lib\jsdom.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(LIBNSPR) \
|
||||
OLE32.LIB
|
||||
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -24,7 +24,10 @@
|
|||
#include "nsIDeviceContext.h"
|
||||
#include "nsILinkHandler.h"
|
||||
#include "nsIStreamListener.h"
|
||||
#ifndef NECKO
|
||||
#include "nsINetSupport.h"
|
||||
#include "nsIRefreshUrl.h"
|
||||
#endif
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
#include "nsIScriptContextOwner.h"
|
||||
#include "nsIDocumentLoaderObserver.h"
|
||||
|
@ -45,7 +48,6 @@
|
|||
//#include "nsPluginsCID.h"
|
||||
#include "nsIPluginManager.h"
|
||||
#include "nsIPref.h"
|
||||
#include "nsIRefreshUrl.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsITimerCallback.h"
|
||||
#include "jsurl.h"
|
||||
|
@ -57,6 +59,7 @@
|
|||
#include "nsIStreamObserver.h"
|
||||
#include "nsIWebShellServices.h"
|
||||
#include "nsIGlobalHistory.h"
|
||||
#include "prmem.h"
|
||||
|
||||
#ifdef XP_PC
|
||||
#include <windows.h>
|
||||
|
@ -130,8 +133,10 @@ class nsWebShell : public nsIWebShell,
|
|||
public nsILinkHandler,
|
||||
public nsIScriptContextOwner,
|
||||
public nsIDocumentLoaderObserver,
|
||||
#ifndef NECKO
|
||||
public nsIRefreshUrl,
|
||||
public nsINetSupport,
|
||||
#endif
|
||||
// public nsIStreamObserver,
|
||||
public nsIClipboardCommands
|
||||
{
|
||||
|
@ -210,17 +215,29 @@ public:
|
|||
NS_IMETHOD LoadURL(const PRUnichar *aURLSpec,
|
||||
nsIPostData* aPostData=nsnull,
|
||||
PRBool aModifyHistory=PR_TRUE,
|
||||
#ifdef NECKO
|
||||
PRUint32 aType = nsIChannel::LOAD_NORMAL,
|
||||
#else
|
||||
nsURLReloadType aType = nsURLReload,
|
||||
#endif
|
||||
const PRUint32 localIP = 0);
|
||||
NS_IMETHOD LoadURL(const PRUnichar *aURLSpec,
|
||||
const char* aCommand,
|
||||
nsIPostData* aPostData=nsnull,
|
||||
PRBool aModifyHistory=PR_TRUE,
|
||||
#ifdef NECKO
|
||||
PRUint32 aType = nsIChannel::LOAD_NORMAL,
|
||||
#else
|
||||
nsURLReloadType aType = nsURLReload,
|
||||
#endif
|
||||
const PRUint32 localIP = 0);
|
||||
|
||||
NS_IMETHOD Stop(void);
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD Reload(PRUint32 aType);
|
||||
#else
|
||||
NS_IMETHOD Reload(nsURLReloadType aType);
|
||||
#endif
|
||||
|
||||
// History api's
|
||||
NS_IMETHOD Back(void);
|
||||
|
@ -278,6 +295,30 @@ public:
|
|||
NS_IMETHOD GetScriptGlobalObject(nsIScriptGlobalObject **aGlobal);
|
||||
NS_IMETHOD ReleaseScriptContext(nsIScriptContext *aContext);
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIDocumentLoaderObserver
|
||||
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL,
|
||||
const char* aCommand);
|
||||
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
PRInt32 aStatus,
|
||||
nsIDocumentLoaderObserver * );
|
||||
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, const char* aContentType,
|
||||
nsIContentViewer* aViewer);
|
||||
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, PRUint32 aProgress,
|
||||
PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, nsString& aMsg);
|
||||
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, PRInt32 aStatus);
|
||||
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
const char *aContentType,
|
||||
const char *aCommand );
|
||||
#else
|
||||
// nsIDocumentLoaderObserver
|
||||
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL,
|
||||
|
@ -300,6 +341,7 @@ public:
|
|||
nsIURI* aURL,
|
||||
const char *aContentType,
|
||||
const char *aCommand );
|
||||
#endif
|
||||
// NS_IMETHOD OnConnectionsComplete();
|
||||
|
||||
// nsIRefreshURL interface methods...
|
||||
|
@ -395,7 +437,9 @@ protected:
|
|||
nsIWidget* mWindow;
|
||||
nsIDocumentLoader* mDocLoader;
|
||||
nsIDocumentLoaderObserver* mDocLoaderObserver;
|
||||
#ifndef NECKO
|
||||
nsINetSupport* mNetSupport;
|
||||
#endif
|
||||
|
||||
nsIWebShell* mParent;
|
||||
nsVoidArray mChildren;
|
||||
|
@ -430,7 +474,11 @@ protected:
|
|||
nsresult DoLoadURL(const nsString& aUrlSpec,
|
||||
const char* aCommand,
|
||||
nsIPostData* aPostData,
|
||||
#ifdef NECKO
|
||||
PRUint32 aType,
|
||||
#else
|
||||
nsURLReloadType aType,
|
||||
#endif
|
||||
const PRUint32 aLocalIP);
|
||||
|
||||
float mZoom;
|
||||
|
@ -467,7 +515,10 @@ static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID);
|
|||
static NS_DEFINE_IID(kIScriptContextOwnerIID, NS_ISCRIPTCONTEXTOWNER_IID);
|
||||
static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID);
|
||||
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
||||
#ifndef NECKO
|
||||
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
|
||||
static NS_DEFINE_IID(kRefreshURLIID, NS_IREFRESHURL_IID);
|
||||
#endif
|
||||
static NS_DEFINE_IID(kIWebShellIID, NS_IWEB_SHELL_IID);
|
||||
static NS_DEFINE_IID(kIWebShellServicesIID, NS_IWEB_SHELL_SERVICES_IID);
|
||||
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);
|
||||
|
@ -476,7 +527,6 @@ static NS_DEFINE_IID(kIPluginHostIID, NS_IPLUGINHOST_IID);
|
|||
//static NS_DEFINE_IID(kCPluginHostCID, NS_PLUGIN_HOST_CID);
|
||||
static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
|
||||
static NS_DEFINE_IID(kIDocumentViewerIID, NS_IDOCUMENT_VIEWER_IID);
|
||||
static NS_DEFINE_IID(kRefreshURLIID, NS_IREFRESHURL_IID);
|
||||
static NS_DEFINE_IID(kITimerCallbackIID, NS_ITIMERCALLBACK_IID);
|
||||
static NS_DEFINE_IID(kIWebShellContainerIID, NS_IWEB_SHELL_CONTAINER_IID);
|
||||
static NS_DEFINE_IID(kIBrowserWindowIID, NS_IBROWSER_WINDOW_IID);
|
||||
|
@ -596,7 +646,9 @@ nsWebShell::~nsWebShell()
|
|||
NS_IF_RELEASE(mPrefs);
|
||||
NS_IF_RELEASE(mContainer);
|
||||
NS_IF_RELEASE(mObserver);
|
||||
#ifndef NECKO
|
||||
NS_IF_RELEASE(mNetSupport);
|
||||
#endif
|
||||
|
||||
if (nsnull != mScriptGlobal) {
|
||||
mScriptGlobal->SetWebShell(nsnull);
|
||||
|
@ -729,6 +781,7 @@ nsWebShell::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
#ifndef NECKO
|
||||
if (aIID.Equals(kRefreshURLIID)) {
|
||||
*aInstancePtr = (void*)(nsIRefreshUrl*)this;
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -739,6 +792,7 @@ nsWebShell::QueryInterface(REFNSIID aIID, void** aInstancePtr)
|
|||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
if (aIID.Equals(kIClipboardCommandsIID)) {
|
||||
*aInstancePtr = (void*) ((nsIClipboardCommands*)this);
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -840,11 +894,19 @@ nsWebShell::GetContentViewer(nsIContentViewer** aResult)
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::HandleUnknownContentType(nsIDocumentLoader* loader,
|
||||
#ifdef NECKO
|
||||
nsIChannel* channel,
|
||||
#else
|
||||
nsIURI* aURL,
|
||||
#endif
|
||||
const char *aContentType,
|
||||
const char *aCommand ) {
|
||||
// If we have a doc loader observer, let it respond to this.
|
||||
#ifdef NECKO
|
||||
return mDocLoaderObserver ? mDocLoaderObserver->HandleUnknownContentType( mDocLoader, channel, aContentType, aCommand )
|
||||
#else
|
||||
return mDocLoaderObserver ? mDocLoaderObserver->HandleUnknownContentType( mDocLoader, aURL, aContentType, aCommand )
|
||||
#endif
|
||||
: NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -1181,11 +1243,15 @@ NS_IMETHODIMP
|
|||
nsWebShell::SetObserver(nsIStreamObserver* anObserver)
|
||||
{
|
||||
NS_IF_RELEASE(mObserver);
|
||||
#ifndef NECKO
|
||||
NS_IF_RELEASE(mNetSupport);
|
||||
#endif
|
||||
|
||||
mObserver = anObserver;
|
||||
if (nsnull != mObserver) {
|
||||
#ifndef NECKO
|
||||
mObserver->QueryInterface(kINetSupportIID, (void **) &mNetSupport);
|
||||
#endif
|
||||
NS_ADDREF(mObserver);
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -1633,7 +1699,11 @@ NS_IMETHODIMP
|
|||
nsWebShell::LoadURL(const PRUnichar *aURLSpec,
|
||||
nsIPostData* aPostData,
|
||||
PRBool aModifyHistory,
|
||||
#ifdef NECKO
|
||||
PRUint32 aType,
|
||||
#else
|
||||
nsURLReloadType aType,
|
||||
#endif
|
||||
const PRUint32 aLocalIP)
|
||||
{
|
||||
// Initialize margnwidth, marginheight. Put scrolling back the way it was
|
||||
|
@ -1647,7 +1717,11 @@ nsresult
|
|||
nsWebShell::DoLoadURL(const nsString& aUrlSpec,
|
||||
const char* aCommand,
|
||||
nsIPostData* aPostData,
|
||||
#ifdef NECKO
|
||||
PRUint32 aType,
|
||||
#else
|
||||
nsURLReloadType aType,
|
||||
#endif
|
||||
const PRUint32 aLocalIP)
|
||||
|
||||
|
||||
|
@ -1655,7 +1729,12 @@ nsWebShell::DoLoadURL(const nsString& aUrlSpec,
|
|||
|
||||
// If it's a normal reload that uses the cache, look at the destination anchor
|
||||
// and see if it's an element within the current document
|
||||
if ((aType == nsURLReload) && (nsnull != mContentViewer)) {
|
||||
#ifdef NECKO
|
||||
if ((aType == nsIChannel::LOAD_NORMAL) && (nsnull != mContentViewer))
|
||||
#else
|
||||
if ((aType == nsURLReload) && (nsnull != mContentViewer))
|
||||
#endif
|
||||
{
|
||||
nsCOMPtr<nsIDocumentViewer> docViewer;
|
||||
if (NS_SUCCEEDED(mContentViewer->QueryInterface(kIDocumentViewerIID,
|
||||
getter_AddRefs(docViewer)))) {
|
||||
|
@ -1685,10 +1764,25 @@ nsWebShell::DoLoadURL(const nsString& aUrlSpec,
|
|||
if (NS_FAILED(rv)) return rv;
|
||||
#endif // NECKO
|
||||
|
||||
if ((PRBool)docURL->Equals(url)) {
|
||||
#ifdef NECKO
|
||||
PRBool eq;
|
||||
rv = docURL->Equals(url, &eq);
|
||||
if (NS_SUCCEEDED(rv) && eq)
|
||||
#else
|
||||
if ((PRBool)docURL->Equals(url))
|
||||
#endif
|
||||
{
|
||||
// See if there's a destination anchor
|
||||
#ifdef NECKO
|
||||
char* ref = nsnull;
|
||||
nsCOMPtr<nsIURL> url2 = do_QueryInterface(url);
|
||||
if (url2) {
|
||||
rv = url2->GetRef(&ref);
|
||||
}
|
||||
#else
|
||||
const char* ref;
|
||||
url->GetRef(&ref);
|
||||
#endif
|
||||
|
||||
if (nsnull != ref) {
|
||||
// Get the pres shell object
|
||||
|
@ -1737,7 +1831,11 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec,
|
|||
const char* aCommand,
|
||||
nsIPostData* aPostData,
|
||||
PRBool aModifyHistory,
|
||||
#ifdef NECKO
|
||||
PRUint32 aType,
|
||||
#else
|
||||
nsURLReloadType aType,
|
||||
#endif
|
||||
const PRUint32 aLocalIP)
|
||||
{
|
||||
|
||||
|
@ -1866,7 +1964,11 @@ NS_IMETHODIMP nsWebShell::Stop(void)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsWebShell::Reload(PRUint32 aType)
|
||||
#else
|
||||
NS_IMETHODIMP nsWebShell::Reload(nsURLReloadType aType)
|
||||
#endif
|
||||
{
|
||||
nsString* s = (nsString*) mHistory.ElementAt(mHistoryIndex);
|
||||
if (nsnull != s) {
|
||||
|
@ -1928,7 +2030,11 @@ nsWebShell::GoTo(PRInt32 aHistoryIndex)
|
|||
rv = DoLoadURL(urlSpec, // URL string
|
||||
"view", // Command
|
||||
nsnull, // Post Data
|
||||
#ifdef NECKO
|
||||
nsIChannel::LOAD_NORMAL, // the reload type
|
||||
#else
|
||||
nsURLReload, // the reload type
|
||||
#endif
|
||||
0); // load attributes
|
||||
}
|
||||
return rv;
|
||||
|
@ -2613,16 +2719,27 @@ nsWebShell::OnStartDocumentLoad(nsIDocumentLoader* loader,
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
#ifdef NECKO
|
||||
nsIChannel* channel,
|
||||
#else
|
||||
nsIURI* aURL,
|
||||
#endif
|
||||
PRInt32 aStatus,
|
||||
nsIDocumentLoaderObserver * aWebShell)
|
||||
{
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
|
||||
#if DEBUG_nisheeth
|
||||
const char* spec;
|
||||
aURL->GetSpec(&spec);
|
||||
printf("nsWebShell::OnEndDocumentLoad:%p: loader=%p url=%s status=%d\n", this, loader, spec, aStatus);
|
||||
#endif
|
||||
nsresult rv = NS_ERROR_FAILURE;
|
||||
|
||||
if (!mProcessedEndDocumentLoad) {
|
||||
mProcessedEndDocumentLoad = PR_TRUE;
|
||||
|
@ -2648,13 +2765,20 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
|||
// Fire the EndLoadURL of the web shell container
|
||||
if (nsnull != aURL) {
|
||||
nsAutoString urlString;
|
||||
#ifdef NECKO
|
||||
char* spec;
|
||||
#else
|
||||
const char* spec;
|
||||
#endif
|
||||
rv = aURL->GetSpec(&spec);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
urlString = spec;
|
||||
if (nsnull != mContainer) {
|
||||
rv = mContainer->EndLoadURL(this, urlString.GetUnicode(), 0);
|
||||
}
|
||||
#ifdef NECKO
|
||||
nsCRT::free(spec);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2683,7 +2807,11 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
|||
* Fire the OnEndDocumentLoad of the DocLoaderobserver
|
||||
*/
|
||||
if (dlObserver && (nsnull != aURL)) {
|
||||
#ifdef NECKO
|
||||
dlObserver->OnEndDocumentLoad(mDocLoader, channel, aStatus, aWebShell);
|
||||
#else
|
||||
dlObserver->OnEndDocumentLoad(mDocLoader, aURL, aStatus, aWebShell);
|
||||
#endif
|
||||
}
|
||||
|
||||
} //!mProcessedEndDocumentLoad
|
||||
|
@ -2696,10 +2824,21 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
#ifdef NECKO
|
||||
nsIChannel* channel,
|
||||
#else
|
||||
nsIURI* aURL,
|
||||
#endif
|
||||
const char* aContentType,
|
||||
nsIContentViewer* aViewer)
|
||||
{
|
||||
nsresult rv;
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
|
||||
|
||||
// XXX This is a temporary hack for meeting the M4 milestone
|
||||
// for seamonkey. I think Netlib should send a message to all stream listeners
|
||||
|
@ -2718,14 +2857,22 @@ nsWebShell::OnStartURLLoad(nsIDocumentLoader* loader,
|
|||
*/
|
||||
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
|
||||
{
|
||||
#ifdef NECKO
|
||||
mDocLoaderObserver->OnStartURLLoad(mDocLoader, channel, aContentType, aViewer);
|
||||
#else
|
||||
mDocLoaderObserver->OnStartURLLoad(mDocLoader, aURL, aContentType, aViewer);
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
#ifdef NECKO
|
||||
nsIChannel* channel,
|
||||
#else
|
||||
nsIURI* aURL,
|
||||
#endif
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
{
|
||||
|
@ -2734,7 +2881,11 @@ nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
|
|||
*/
|
||||
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
|
||||
{
|
||||
#ifdef NECKO
|
||||
mDocLoaderObserver->OnProgressURLLoad(mDocLoader, channel, aProgress, aProgressMax);
|
||||
#else
|
||||
mDocLoaderObserver->OnProgressURLLoad(mDocLoader, aURL, aProgress, aProgressMax);
|
||||
#endif
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -2742,7 +2893,11 @@ nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
#ifdef NECKO
|
||||
nsIChannel* channel,
|
||||
#else
|
||||
nsIURI* aURL,
|
||||
#endif
|
||||
nsString& aMsg)
|
||||
{
|
||||
/*
|
||||
|
@ -2750,7 +2905,11 @@ nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
|
|||
*/
|
||||
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
|
||||
{
|
||||
#ifdef NECKO
|
||||
mDocLoaderObserver->OnStatusURLLoad(mDocLoader, channel, aMsg);
|
||||
#else
|
||||
mDocLoaderObserver->OnStatusURLLoad(mDocLoader, aURL, aMsg);
|
||||
#endif
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -2758,7 +2917,11 @@ nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsWebShell::OnEndURLLoad(nsIDocumentLoader* loader,
|
||||
#ifdef NECKO
|
||||
nsIChannel* channel,
|
||||
#else
|
||||
nsIURI* aURL,
|
||||
#endif
|
||||
PRInt32 aStatus)
|
||||
{
|
||||
#if 0
|
||||
|
@ -2771,7 +2934,11 @@ nsWebShell::OnEndURLLoad(nsIDocumentLoader* loader,
|
|||
*/
|
||||
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
|
||||
{
|
||||
#ifdef NECKO
|
||||
mDocLoaderObserver->OnEndURLLoad(mDocLoader, channel, aStatus);
|
||||
#else
|
||||
mDocLoaderObserver->OnEndURLLoad(mDocLoader, aURL, aStatus);
|
||||
#endif
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -2816,7 +2983,11 @@ void refreshData::Notify(nsITimer *aTimer)
|
|||
{
|
||||
NS_PRECONDITION((nsnull != mShell), "Null pointer...");
|
||||
if (nsnull != mShell) {
|
||||
#ifdef NECKO
|
||||
mShell->LoadURL(mUrlSpec.GetUnicode(), nsnull, PR_TRUE, nsIChannel::LOAD_NORMAL);
|
||||
#else
|
||||
mShell->LoadURL(mUrlSpec.GetUnicode(), nsnull, PR_TRUE, nsURLReload);
|
||||
#endif
|
||||
}
|
||||
/*
|
||||
* LoadURL(...) will cancel all refresh timers... This causes the Timer and
|
||||
|
@ -2836,9 +3007,16 @@ nsWebShell::RefreshURL(nsIURI* aURL, PRInt32 millis, PRBool repeat)
|
|||
goto done;
|
||||
}
|
||||
|
||||
#ifdef NECKO
|
||||
char* spec;
|
||||
#else
|
||||
const char* spec;
|
||||
#endif
|
||||
aURL->GetSpec(&spec);
|
||||
rv = RefreshURL(spec, millis, repeat);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(spec);
|
||||
#endif
|
||||
done:
|
||||
return rv;
|
||||
}
|
||||
|
@ -2955,9 +3133,16 @@ nsresult nsWebShell::CheckForTrailingSlash(nsIURI* aURL)
|
|||
nsString * historyURL = (nsString *) new nsString(url);
|
||||
|
||||
/* Get the url that netlib passed us */
|
||||
#ifdef NECKO
|
||||
char* spec;
|
||||
#else
|
||||
const char* spec;
|
||||
#endif
|
||||
aURL->GetSpec(&spec);
|
||||
nsString* newURL = (nsString*) new nsString(spec);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(spec);
|
||||
#endif
|
||||
|
||||
if (newURL && newURL->Last() == '/' && !historyURL->Equals(*newURL)) {
|
||||
// Replace the top most history entry with the new url
|
||||
|
@ -3047,9 +3232,13 @@ nsWebShell::OnStopBinding(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
|
|||
NS_IMETHODIMP_(void)
|
||||
nsWebShell::Alert(const nsString &aText)
|
||||
{
|
||||
#ifdef NECKO
|
||||
NS_ASSERTION(0, "help");
|
||||
#else
|
||||
if (nsnull != mNetSupport) {
|
||||
mNetSupport->Alert(aText);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
NS_IMETHODIMP_(PRBool)
|
||||
|
@ -3057,9 +3246,13 @@ nsWebShell::Confirm(const nsString &aText)
|
|||
{
|
||||
PRBool bResult = PR_FALSE;
|
||||
|
||||
#ifdef NECKO
|
||||
NS_ASSERTION(0, "help");
|
||||
#else
|
||||
if (nsnull != mNetSupport) {
|
||||
bResult = mNetSupport->Confirm(aText);
|
||||
}
|
||||
#endif
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
@ -3070,9 +3263,13 @@ nsWebShell::Prompt(const nsString &aText,
|
|||
{
|
||||
PRBool bResult = PR_FALSE;
|
||||
|
||||
#ifdef NECKO
|
||||
NS_ASSERTION(0, "help");
|
||||
#else
|
||||
if (nsnull != mNetSupport) {
|
||||
bResult = mNetSupport->Prompt(aText, aDefault, aResult);
|
||||
}
|
||||
#endif
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
@ -3083,9 +3280,13 @@ nsWebShell::PromptUserAndPassword(const nsString &aText,
|
|||
{
|
||||
PRBool bResult = PR_FALSE;
|
||||
|
||||
#ifdef NECKO
|
||||
NS_ASSERTION(0, "help");
|
||||
#else
|
||||
if (nsnull != mNetSupport) {
|
||||
bResult = mNetSupport->PromptUserAndPassword(aText, aUser, aPassword);
|
||||
}
|
||||
#endif
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
@ -3095,9 +3296,13 @@ nsWebShell::PromptPassword(const nsString &aText,
|
|||
{
|
||||
PRBool bResult = PR_FALSE;
|
||||
|
||||
#ifdef NECKO
|
||||
NS_ASSERTION(0, "help");
|
||||
#else
|
||||
if (nsnull != mNetSupport) {
|
||||
bResult = mNetSupport->PromptPassword(aText, aPassword);
|
||||
}
|
||||
#endif
|
||||
return bResult;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,11 @@ LINCS= \
|
|||
-I$(PUBLIC)\xpcom \
|
||||
-I$(PUBLIC)\dom \
|
||||
-I$(PUBLIC)\js \
|
||||
!ifdef NECKO
|
||||
-I$(PUBLIC)\necko \
|
||||
!else
|
||||
-I$(PUBLIC)\netlib \
|
||||
!endif
|
||||
-I$(PUBLIC)\java \
|
||||
-I$(PUBLIC)\plugin \
|
||||
-I$(PUBLIC)\pref \
|
||||
|
@ -91,7 +95,11 @@ MYLIBS= \
|
|||
$(DIST)\lib\js32$(VERSION_NUMBER).lib \
|
||||
$(LIBNSPR) \
|
||||
$(DIST)\lib\plc3.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(DIST)\lib\jsdom.lib \
|
||||
comdlg32.lib \
|
||||
!if defined(NGPREFS)
|
||||
|
|
|
@ -175,7 +175,10 @@ static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID);
|
|||
static NS_DEFINE_IID(kICheckButtonIID, NS_ICHECKBUTTON_IID);
|
||||
static NS_DEFINE_IID(kIRadioButtonIID, NS_IRADIOBUTTON_IID);
|
||||
static NS_DEFINE_IID(kILabelIID, NS_ILABEL_IID);
|
||||
#ifdef NECKO
|
||||
#else
|
||||
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
|
||||
#endif
|
||||
static NS_DEFINE_IID(kIDocumentViewerIID, NS_IDOCUMENT_VIEWER_IID);
|
||||
static NS_DEFINE_IID(kXPBaseWindowCID, NS_XPBASE_WINDOW_CID);
|
||||
static NS_DEFINE_IID(kIStringBundleServiceIID, NS_ISTRINGBUNDLESERVICE_IID);
|
||||
|
@ -1088,11 +1091,19 @@ nsBrowserWindow::QueryInterface(const nsIID& aIID,
|
|||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
#ifdef NECKO
|
||||
if (aIID.Equals(nsIProgressEventSink::GetIID())) {
|
||||
*aInstancePtrResult = (void*) ((nsIProgressEventSink*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
#else
|
||||
if (aIID.Equals(kINetSupportIID)) {
|
||||
*aInstancePtrResult = (void*) ((nsINetSupport*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
if (aIID.Equals(kISupportsIID)) {
|
||||
*aInstancePtrResult = (void*) ((nsISupports*)((nsIBrowserWindow*)this));
|
||||
NS_ADDREF_THIS();
|
||||
|
@ -1845,17 +1856,40 @@ nsBrowserWindow::FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTak
|
|||
// Stream observer implementation
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsBrowserWindow::OnProgress(nsISupports *ctxt, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
#else
|
||||
nsBrowserWindow::OnProgress(nsIURI* aURL,
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
#endif
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
|
||||
if (mStatus) {
|
||||
nsAutoString url;
|
||||
if (nsnull != aURL) {
|
||||
#ifdef NECKO
|
||||
char* str;
|
||||
aURL->GetSpec(&str);
|
||||
#else
|
||||
PRUnichar* str;
|
||||
aURL->ToString(&str);
|
||||
#endif
|
||||
url = str;
|
||||
#ifdef NECKO
|
||||
nsCRT::free(str);
|
||||
#else
|
||||
delete[] str;
|
||||
#endif
|
||||
}
|
||||
url.Append(": progress ");
|
||||
url.Append(aProgress, 10);
|
||||
|
@ -1871,7 +1905,11 @@ nsBrowserWindow::OnProgress(nsIURI* aURL,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsBrowserWindow::OnStatus(nsISupports *ctxt, const PRUnichar *aMsg)
|
||||
#else
|
||||
nsBrowserWindow::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
||||
#endif
|
||||
{
|
||||
if (mStatus) {
|
||||
PRUint32 size;
|
||||
|
@ -1881,15 +1919,38 @@ nsBrowserWindow::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsBrowserWindow::OnStartBinding(nsISupports *ctxt)
|
||||
#else
|
||||
nsBrowserWindow::OnStartBinding(nsIURI* aURL, const char *aContentType)
|
||||
#endif
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
|
||||
if (mStatus) {
|
||||
nsAutoString url;
|
||||
if (nsnull != aURL) {
|
||||
#ifdef NECKO
|
||||
char* str;
|
||||
aURL->GetSpec(&str);
|
||||
#else
|
||||
PRUnichar* str;
|
||||
aURL->ToString(&str);
|
||||
#endif
|
||||
url = str;
|
||||
#ifdef NECKO
|
||||
nsCRT::free(str);
|
||||
#else
|
||||
delete[] str;
|
||||
#endif
|
||||
}
|
||||
url.Append(": start");
|
||||
PRUint32 size;
|
||||
|
@ -1899,17 +1960,40 @@ nsBrowserWindow::OnStartBinding(nsIURI* aURL, const char *aContentType)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsBrowserWindow::OnStopBinding(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg)
|
||||
#else
|
||||
nsBrowserWindow::OnStopBinding(nsIURI* aURL,
|
||||
nsresult status,
|
||||
const PRUnichar* aMsg)
|
||||
#endif
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIChannel> channel = do_QueryInterface(ctxt);
|
||||
if (channel == nsnull) return NS_ERROR_FAILURE;
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
|
||||
if (mStatus) {
|
||||
nsAutoString url;
|
||||
if (nsnull != aURL) {
|
||||
#ifdef NECKO
|
||||
char* str;
|
||||
aURL->GetSpec(&str);
|
||||
#else
|
||||
PRUnichar* str;
|
||||
aURL->ToString(&str);
|
||||
#endif
|
||||
url = str;
|
||||
#ifdef NECKO
|
||||
nsCRT::free(str);
|
||||
#else
|
||||
delete[] str;
|
||||
#endif
|
||||
}
|
||||
url.Append(": stop");
|
||||
PRUint32 size;
|
||||
|
|
|
@ -21,7 +21,11 @@
|
|||
|
||||
#include "nsIBrowserWindow.h"
|
||||
#include "nsIStreamListener.h"
|
||||
#ifdef NECKO
|
||||
#include "nsIProgressEventSink.h"
|
||||
#else
|
||||
#include "nsINetSupport.h"
|
||||
#endif
|
||||
#include "nsIWebShell.h"
|
||||
#include "nsIScriptContextOwner.h"
|
||||
#include "nsIDocumentLoaderObserver.h"
|
||||
|
@ -58,7 +62,11 @@ class nsWebCrawler;
|
|||
*/
|
||||
class nsBrowserWindow : public nsIBrowserWindow,
|
||||
public nsIStreamObserver,
|
||||
#ifdef NECKO
|
||||
public nsIProgressEventSink,
|
||||
#else
|
||||
public nsINetSupport,
|
||||
#endif
|
||||
public nsIWebShellContainer
|
||||
{
|
||||
public:
|
||||
|
@ -97,11 +105,24 @@ public:
|
|||
NS_IMETHOD GetWebShell(nsIWebShell*& aResult);
|
||||
NS_IMETHOD GetContentWebShell(nsIWebShell **aResult);
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartBinding(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt) { return NS_OK; }
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg) { return NS_OK; }
|
||||
|
||||
// nsIProgressEventSink
|
||||
NS_IMETHOD OnProgress(nsISupports *ctxt, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatus(nsISupports *ctxt, const PRUnichar *aMsg);
|
||||
|
||||
#else
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartBinding(nsIURI* aURL, const char *aContentType);
|
||||
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
|
||||
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg);
|
||||
#endif
|
||||
|
||||
// nsIWebShellContainer
|
||||
NS_IMETHOD WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason);
|
||||
|
|
|
@ -993,7 +993,11 @@ nsViewerApp::CreateRobot(nsBrowserWindow* aWindow)
|
|||
nsCOMPtr<nsIDocument> doc;
|
||||
shell->GetDocument(getter_AddRefs(doc));
|
||||
if (doc) {
|
||||
#ifdef NECKO
|
||||
char * str;
|
||||
#else
|
||||
const char * str;
|
||||
#endif
|
||||
nsresult rv = doc->GetDocumentURL()->GetSpec(&str);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
|
@ -1007,6 +1011,9 @@ nsViewerApp::CreateRobot(nsBrowserWindow* aWindow)
|
|||
gDebugRobotLoads,
|
||||
PL_strdup(gVerifyDir),
|
||||
yieldProc);
|
||||
#endif
|
||||
#ifdef NECKO
|
||||
nsCRT::free(str);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
|
|
@ -212,19 +212,41 @@ nsWebCrawler::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsWebCrawler::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
PRInt32 aStatus,
|
||||
nsIDocumentLoaderObserver* aObserver)
|
||||
#else
|
||||
nsWebCrawler::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL,
|
||||
PRInt32 aStatus,
|
||||
nsIDocumentLoaderObserver * aObserver)
|
||||
#endif
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
#endif
|
||||
|
||||
if (nsnull == aURL) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
if (mVerbose) {
|
||||
#ifdef NECKO
|
||||
char* spec;
|
||||
#else
|
||||
const char* spec;
|
||||
#endif
|
||||
aURL->GetSpec(&spec);
|
||||
printf("Crawler: done loading %s\n", spec);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(spec);
|
||||
#endif
|
||||
}
|
||||
|
||||
// Make sure the document bits make it to the screen at least once
|
||||
|
@ -262,9 +284,17 @@ nsWebCrawler::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
|||
}
|
||||
}
|
||||
else {
|
||||
#ifdef NECKO
|
||||
char* file;
|
||||
(void)aURL->GetPath(&file);
|
||||
#else
|
||||
const char* file;
|
||||
(void)aURL->GetFile(&file);
|
||||
#endif
|
||||
printf("could not open output file for %s\n", file);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(file);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -302,40 +332,72 @@ nsWebCrawler::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsWebCrawler::OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
const char* aContentType,
|
||||
nsIContentViewer* aViewer)
|
||||
#else
|
||||
nsWebCrawler::OnStartURLLoad(nsIDocumentLoader* loader, nsIURI* aURL,
|
||||
const char* aContentType,
|
||||
nsIContentViewer* aViewer)
|
||||
#endif
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsWebCrawler::OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
#else
|
||||
nsWebCrawler::OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL, PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
#endif
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsWebCrawler::OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
nsString& aMsg)
|
||||
#else
|
||||
nsWebCrawler::OnStatusURLLoad(nsIDocumentLoader* loader, nsIURI* aURL,
|
||||
nsString& aMsg)
|
||||
#endif
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsWebCrawler::OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel,
|
||||
PRInt32 aStatus)
|
||||
#else
|
||||
nsWebCrawler::OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL,
|
||||
PRInt32 aStatus)
|
||||
#endif
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsWebCrawler::HandleUnknownContentType(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
const char *aContentType,
|
||||
const char *aCommand)
|
||||
#else
|
||||
nsWebCrawler::HandleUnknownContentType(nsIDocumentLoader* loader,
|
||||
nsIURI *aURL,
|
||||
const char *aContentType,
|
||||
const char *aCommand)
|
||||
#endif
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -348,9 +410,17 @@ nsWebCrawler::GetOutputFile(nsIURI *aURL, nsString& aOutputName)
|
|||
if (nsnull!=aURL)
|
||||
{
|
||||
char *inputFileName;
|
||||
#ifdef NECKO
|
||||
char* file;
|
||||
(void)aURL->GetPath(&file);
|
||||
#else
|
||||
const char* file;
|
||||
(void)aURL->GetFile(&file);
|
||||
#endif
|
||||
nsAutoString inputFileFullPath(file);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(file);
|
||||
#endif
|
||||
PRInt32 fileNameOffset = inputFileFullPath.RFind('/');
|
||||
if (-1==fileNameOffset)
|
||||
{
|
||||
|
@ -538,7 +608,11 @@ nsWebCrawler::OkToLoad(const nsString& aURLSpec)
|
|||
#endif // NECKO
|
||||
|
||||
if (NS_OK == rv) {
|
||||
#ifdef NECKO
|
||||
char* host;
|
||||
#else
|
||||
const char* host;
|
||||
#endif
|
||||
rv = url->GetHost(&host);
|
||||
if (rv == NS_OK) {
|
||||
PRInt32 hostlen = PL_strlen(host);
|
||||
|
@ -569,6 +643,9 @@ nsWebCrawler::OkToLoad(const nsString& aURLSpec)
|
|||
}
|
||||
}
|
||||
ok = PR_FALSE;
|
||||
#ifdef NECKO
|
||||
nsCRT::free(host);
|
||||
#endif
|
||||
}
|
||||
NS_RELEASE(url);
|
||||
}
|
||||
|
|
|
@ -43,6 +43,15 @@ public:
|
|||
NS_DECL_ISUPPORTS
|
||||
|
||||
// nsIDocumentLoaderObserver
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand);
|
||||
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus, nsIDocumentLoaderObserver* aObserver);
|
||||
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, const char* aContentType, nsIContentViewer* aViewer);
|
||||
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg);
|
||||
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus);
|
||||
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader, nsIChannel* channel, const char *aContentType,const char *aCommand );
|
||||
#else
|
||||
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL,
|
||||
const char* aCommand);
|
||||
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aURL,
|
||||
|
@ -62,6 +71,7 @@ public:
|
|||
nsIURI *aURL,
|
||||
const char *aContentType,
|
||||
const char *aCommand);
|
||||
#endif
|
||||
|
||||
// Add a url to load
|
||||
void AddURL(const nsString& aURL);
|
||||
|
|
|
@ -28,7 +28,10 @@
|
|||
#include "nsXPBaseWindow.h"
|
||||
#endif
|
||||
|
||||
#ifdef NECKO
|
||||
#else
|
||||
#include "nsINetSupport.h"
|
||||
#endif
|
||||
#include "nsIAppShell.h"
|
||||
#include "nsIWidget.h"
|
||||
#include "nsIDOMDocument.h"
|
||||
|
@ -86,7 +89,10 @@ static NS_DEFINE_IID(kIDOMEventReceiverIID, NS_IDOMEVENTRECEIVER_IID);
|
|||
static NS_DEFINE_IID(kIDOMElementIID, NS_IDOMELEMENT_IID);
|
||||
static NS_DEFINE_IID(kIDOMHTMLDocumentIID, NS_IDOMHTMLDOCUMENT_IID);
|
||||
|
||||
#ifdef NECKO
|
||||
#else
|
||||
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
nsXPBaseWindow::nsXPBaseWindow() :
|
||||
|
@ -136,11 +142,14 @@ nsresult nsXPBaseWindow::QueryInterface(const nsIID& aIID,
|
|||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
#ifdef NECKO
|
||||
#else
|
||||
if (aIID.Equals(kINetSupportIID)) {
|
||||
*aInstancePtrResult = (void*) ((nsINetSupport*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
if (aIID.Equals(kIDOMMouseListenerIID)) {
|
||||
NS_ADDREF_THIS(); // Increase reference count for caller
|
||||
*aInstancePtrResult = (void *)((nsIDOMMouseListener*)this);
|
||||
|
@ -574,7 +583,7 @@ nsXPBaseWindow::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupConten
|
|||
//----------------------------------------
|
||||
|
||||
// Stream observer implementation
|
||||
|
||||
#ifndef NECKO
|
||||
NS_IMETHODIMP
|
||||
nsXPBaseWindow::OnProgress(nsIURI* aURL,
|
||||
PRUint32 aProgress,
|
||||
|
@ -588,15 +597,25 @@ NS_IMETHODIMP nsXPBaseWindow::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
|||
{
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
//----------------------------------------
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsXPBaseWindow::OnStartBinding(nsISupports *ctxt)
|
||||
#else
|
||||
NS_IMETHODIMP nsXPBaseWindow::OnStartBinding(nsIURI* aURL, const char *aContentType)
|
||||
#endif
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
//----------------------------------------
|
||||
#ifdef NECKO
|
||||
NS_IMETHODIMP nsXPBaseWindow::OnStopBinding(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg)
|
||||
#else
|
||||
NS_IMETHODIMP nsXPBaseWindow::OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
|
||||
#endif
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,10 @@
|
|||
|
||||
#include "nsIXPBaseWindow.h"
|
||||
#include "nsIStreamListener.h"
|
||||
#ifdef NECKO
|
||||
#else
|
||||
#include "nsINetSupport.h"
|
||||
#endif
|
||||
#include "nsIWebShell.h"
|
||||
#include "nsIScriptContextOwner.h"
|
||||
#include "nsString.h"
|
||||
|
@ -43,7 +46,10 @@ class nsIPref;
|
|||
*/
|
||||
class nsXPBaseWindow : public nsIXPBaseWindow,
|
||||
public nsIStreamObserver,
|
||||
#ifdef NECKO
|
||||
#else
|
||||
public nsINetSupport,
|
||||
#endif
|
||||
public nsIWebShellContainer,
|
||||
public nsIDOMMouseListener
|
||||
{
|
||||
|
@ -83,11 +89,21 @@ public:
|
|||
|
||||
NS_IMETHOD LoadURL(const nsString &aURL);
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartBinding(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt) { return NS_OK; }
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg) { return NS_OK; }
|
||||
#else
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartBinding(nsIURI* aURL, const char *aContentType);
|
||||
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
|
||||
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg);
|
||||
#endif
|
||||
|
||||
// nsIWebShellContainer
|
||||
NS_IMETHOD WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason);
|
||||
|
|
|
@ -860,7 +860,11 @@ char *str;
|
|||
if (gImageGroup == NULL)
|
||||
{
|
||||
nsIDeviceContext *deviceCtx = scribbleData.mContext;
|
||||
#ifdef NECKO
|
||||
if (NS_NewImageGroup(&gImageGroup) != NS_OK || gImageGroup->Init(deviceCtx) != NS_OK)
|
||||
#else
|
||||
if (NS_NewImageGroup(&gImageGroup) != NS_OK || gImageGroup->Init(deviceCtx, nsnull) != NS_OK)
|
||||
#endif
|
||||
{
|
||||
NS_RELEASE(deviceCtx);
|
||||
return;
|
||||
|
|
|
@ -35,7 +35,10 @@ MYLIBS= \
|
|||
$(LIBNSPR) \
|
||||
$(DIST)\lib\raptorgfxwin.lib \
|
||||
$(DIST)\lib\raptorwidget.lib \
|
||||
!ifdef NECKO
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib\
|
||||
!endif
|
||||
$(NULL)
|
||||
|
||||
LLIBS= $(MYLIBS) \
|
||||
|
|
|
@ -62,15 +62,23 @@ REQUIRES=libreg
|
|||
|
||||
LINCS= \
|
||||
-Iservices \
|
||||
!ifdef NECKO
|
||||
-I$(PUBLIC)\necko \
|
||||
!else
|
||||
!ifdef MODULAR_NETLIB
|
||||
-I$(PUBLIC)\netlib \
|
||||
!endif
|
||||
!endif
|
||||
-I$(PUBLIC)\xpcom
|
||||
|
||||
LLIBS= \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
!ifdef MODULAR_NETLIB
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
!endif
|
||||
$(LIBNSPR) \
|
||||
$(DIST)\lib\plc3.lib
|
||||
|
|
|
@ -36,7 +36,11 @@ LINCS= \
|
|||
-I$(XPDIST)\public\browser \
|
||||
-I$(XPDIST)\public\txtsvc \
|
||||
-I$(XPDIST)\public\js \
|
||||
!ifdef NECKO
|
||||
-I$(XPDIST)\public\necko \
|
||||
!else
|
||||
-I$(XPDIST)\public\netlib \
|
||||
!endif
|
||||
-I$(XPDIST)\public\network \
|
||||
-I$(XPDIST)\public\dom \
|
||||
-I$(XPDIST)\public\xpcom \
|
||||
|
@ -52,7 +56,11 @@ LINCS= \
|
|||
$(NULL)
|
||||
|
||||
LLIBS = \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\xppref32.lib \
|
||||
$(DIST)\lib\xplib.lib \
|
||||
|
|
|
@ -37,12 +37,12 @@
|
|||
#include "pratom.h"
|
||||
#include "prmem.h"
|
||||
#include "prio.h"
|
||||
#include "mkutils.h"
|
||||
#include "prefapi.h"
|
||||
|
||||
#include "nsIURL.h"
|
||||
#include "nsINetlibURL.h"
|
||||
#ifndef NECKO
|
||||
#include "mkutils.h"
|
||||
#include "nsINetlibURL.h"
|
||||
#include "nsINetService.h"
|
||||
#endif // NECKO
|
||||
#include "nsIInputStream.h"
|
||||
|
@ -77,9 +77,9 @@ static NS_DEFINE_IID(kIScriptExternalNameSetIID, NS_ISCRIPTEXTERNALNAMESET_IID);
|
|||
#ifndef NECKO
|
||||
static NS_DEFINE_IID(kInetServiceIID, NS_INETSERVICE_IID);
|
||||
static NS_DEFINE_IID(kInetServiceCID, NS_NETSERVICE_CID);
|
||||
static NS_DEFINE_IID(kInetLibURLIID, NS_INETLIBURL_IID);
|
||||
#endif // NECKO
|
||||
|
||||
static NS_DEFINE_IID(kInetLibURLIID, NS_INETLIBURL_IID);
|
||||
static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID);
|
||||
|
||||
static NS_DEFINE_IID(kBrowserWindowCID, NS_BROWSER_WINDOW_CID);
|
||||
|
|
|
@ -112,7 +112,10 @@ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
|
|||
static NS_DEFINE_IID(kIBrowserAppCoreIID, NS_IDOMBROWSERAPPCORE_IID);
|
||||
static NS_DEFINE_IID(kIDOMDocumentIID, nsIDOMDocument::GetIID());
|
||||
static NS_DEFINE_IID(kIDocumentIID, nsIDocument::GetIID());
|
||||
#ifdef NECKO
|
||||
#else
|
||||
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
|
||||
#endif
|
||||
static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID);
|
||||
static NS_DEFINE_IID(kIWebShellWindowIID, NS_IWEBSHELL_WINDOW_IID);
|
||||
static NS_DEFINE_IID(kIGlobalHistoryIID, NS_IGLOBALHISTORY_IID);
|
||||
|
@ -195,11 +198,14 @@ nsBrowserAppCore::QueryInterface(REFNSIID aIID,void** aInstancePtr)
|
|||
AddRef();
|
||||
return NS_OK;
|
||||
}
|
||||
#ifdef NECKO
|
||||
#else
|
||||
if (aIID.Equals(kINetSupportIID)) {
|
||||
*aInstancePtr = (void*) ((nsINetSupport*)this);
|
||||
NS_ADDREF_THIS();
|
||||
return NS_OK;
|
||||
}
|
||||
#endif
|
||||
/* This isn't supported any more
|
||||
if (aIID.Equals(kIStreamObserverIID)) {
|
||||
*aInstancePtr = (void*) ((nsIStreamObserver*)this);
|
||||
|
@ -1045,11 +1051,18 @@ nsBrowserAppCore::OnStartDocumentLoad(nsIDocumentLoader* aLoader, nsIURI* aURL,
|
|||
NS_WITH_SERVICE(nsIObserverService, observer, NS_OBSERVERSERVICE_PROGID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
#ifdef NECKO
|
||||
char* url;
|
||||
#else
|
||||
const char* url;
|
||||
#endif
|
||||
rv = aURL->GetSpec(&url);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsAutoString urlStr(url);
|
||||
#ifdef NECKO
|
||||
nsCRT::free(url);
|
||||
#endif
|
||||
|
||||
nsAutoString kStartDocumentLoad("StartDocumentLoad");
|
||||
rv = observer->Notify(mContentWindow,
|
||||
|
@ -1073,21 +1086,27 @@ nsBrowserAppCore::OnStartDocumentLoad(nsIDocumentLoader* aLoader, nsIURI* aURL,
|
|||
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsBrowserAppCore::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIChannel* channel, PRInt32 aStatus,
|
||||
nsIDocumentLoaderObserver * aObserver)
|
||||
#else
|
||||
nsBrowserAppCore::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIURI *aUrl, PRInt32 aStatus,
|
||||
nsIDocumentLoaderObserver * aObserver)
|
||||
#endif
|
||||
{
|
||||
NS_PRECONDITION(aLoader != nsnull, "null ptr");
|
||||
if (! aLoader)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
#ifdef NECKO
|
||||
NS_PRECONDITION(channel != nsnull, "null ptr");
|
||||
if (! channel)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
#else
|
||||
NS_PRECONDITION(aUrl != nsnull, "null ptr");
|
||||
if (! aUrl)
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
|
||||
const char* spec =nsnull;
|
||||
|
||||
aUrl->GetSpec(&spec);
|
||||
|
||||
#endif
|
||||
|
||||
nsresult rv;
|
||||
|
||||
|
@ -1098,7 +1117,14 @@ nsBrowserAppCore::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIURI *aUrl, PR
|
|||
NS_WITH_SERVICE(nsIObserverService, observer, NS_OBSERVERSERVICE_PROGID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIURI> aUrl;
|
||||
rv = channel->GetURI(getter_AddRefs(aUrl));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
char* url;
|
||||
#else
|
||||
const char* url;
|
||||
#endif
|
||||
rv = aUrl->GetSpec(&url);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
|
@ -1155,39 +1181,50 @@ done:
|
|||
|
||||
/* To satisfy a request from the QA group */
|
||||
if (aStatus == NS_OK) {
|
||||
fprintf(stdout, "Document %s loaded successfully\n", spec);
|
||||
fprintf(stdout, "Document %s loaded successfully\n", url);
|
||||
fflush(stdout);
|
||||
}
|
||||
else {
|
||||
fprintf(stdout, "Error loading URL %s \n", spec);
|
||||
fprintf(stdout, "Error loading URL %s \n", url);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
end:
|
||||
|
||||
setAttribute( mWebShell, "Browser:Throbber", "busy", "false" );
|
||||
PRBool result=PR_TRUE;
|
||||
// Check with sessionHistory if you can go forward
|
||||
canForward(result);
|
||||
setAttribute(mWebShell, "canGoForward", "disabled", (result == PR_TRUE) ? "" : "true");
|
||||
setAttribute( mWebShell, "Browser:Throbber", "busy", "false" );
|
||||
PRBool result=PR_TRUE;
|
||||
// Check with sessionHistory if you can go forward
|
||||
canForward(result);
|
||||
setAttribute(mWebShell, "canGoForward", "disabled", (result == PR_TRUE) ? "" : "true");
|
||||
|
||||
// Check with sessionHistory if you can go back
|
||||
canBack(result);
|
||||
setAttribute(mWebShell, "canGoBack", "disabled", (result == PR_TRUE) ? "" : "true");
|
||||
canBack(result);
|
||||
setAttribute(mWebShell, "canGoBack", "disabled", (result == PR_TRUE) ? "" : "true");
|
||||
|
||||
//Disable the Stop button
|
||||
setAttribute( mWebShell, "canStop", "disabled", "true" );
|
||||
//Disable the Stop button
|
||||
setAttribute( mWebShell, "canStop", "disabled", "true" );
|
||||
|
||||
//Enable the reload button
|
||||
setAttribute(mWebShell, "canReload", "disabled", "");
|
||||
return NS_OK;
|
||||
#ifdef NECKO
|
||||
nsCRT::free(url);
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsBrowserAppCore::HandleUnknownContentType(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
const char *aContentType,
|
||||
const char *aCommand )
|
||||
#else
|
||||
nsBrowserAppCore::HandleUnknownContentType(nsIDocumentLoader* loader,
|
||||
nsIURI *aURL,
|
||||
const char *aContentType,
|
||||
const char *aCommand ) {
|
||||
const char *aCommand )
|
||||
#endif
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
// Turn off the indicators in the chrome.
|
||||
|
@ -1201,7 +1238,11 @@ nsBrowserAppCore::HandleUnknownContentType(nsIDocumentLoader* loader,
|
|||
|
||||
if ( NS_SUCCEEDED( rv ) ) {
|
||||
/* Have handler take care of this. */
|
||||
#ifdef NECKO
|
||||
rv = handler->HandleUnknownContentType( channel, aContentType, loader );
|
||||
#else
|
||||
rv = handler->HandleUnknownContentType( aURL, aContentType, loader );
|
||||
#endif
|
||||
|
||||
// Release the unknown content type handler service object.
|
||||
nsServiceManager::ReleaseService( NS_IUNKNOWNCONTENTTYPEHANDLER_PROGID, handler );
|
||||
|
@ -1216,30 +1257,57 @@ nsBrowserAppCore::HandleUnknownContentType(nsIDocumentLoader* loader,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsBrowserAppCore::OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, const char* aContentType,
|
||||
nsIContentViewer* aViewer)
|
||||
#else
|
||||
nsBrowserAppCore::OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL, const char* aContentType,
|
||||
nsIContentViewer* aViewer)
|
||||
#endif
|
||||
{
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsBrowserAppCore::OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
#else
|
||||
nsBrowserAppCore::OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL, PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
#endif
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
PRUint32 progress = aProgressMax ? ( aProgress * 100 ) / aProgressMax : 0;
|
||||
#ifdef NECKO
|
||||
nsCOMPtr<nsIURI> aURL;
|
||||
rv = channel->GetURI(getter_AddRefs(aURL));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
char *urlString = 0;
|
||||
#else
|
||||
const char *urlString = 0;
|
||||
#endif
|
||||
aURL->GetSpec( &urlString );
|
||||
#ifdef NECKO
|
||||
nsCRT::free(urlString);
|
||||
#endif
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsBrowserAppCore::OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, nsString& aMsg)
|
||||
#else
|
||||
nsBrowserAppCore::OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL, nsString& aMsg)
|
||||
#endif
|
||||
{
|
||||
nsresult rv = setAttribute( mWebShell, "Browser:Status", "value", aMsg );
|
||||
return rv;
|
||||
|
@ -1247,8 +1315,13 @@ nsBrowserAppCore::OnStatusURLLoad(nsIDocumentLoader* loader,
|
|||
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsBrowserAppCore::OnEndURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, PRInt32 aStatus)
|
||||
#else
|
||||
nsBrowserAppCore::OnEndURLLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL, PRInt32 aStatus)
|
||||
#endif
|
||||
{
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
|
@ -26,7 +26,10 @@
|
|||
|
||||
#include "nsIDOMBrowserAppCore.h"
|
||||
#include "nsBaseAppCore.h"
|
||||
#ifdef NECKO
|
||||
#else
|
||||
#include "nsINetSupport.h"
|
||||
#endif
|
||||
#include "nsIStreamObserver.h"
|
||||
#include "nsIDocumentLoaderObserver.h"
|
||||
#include "nsIObserver.h"
|
||||
|
@ -48,7 +51,10 @@ class nsIFindComponent;
|
|||
|
||||
class nsBrowserAppCore : public nsBaseAppCore,
|
||||
public nsIDOMBrowserAppCore,
|
||||
#ifdef NECKO
|
||||
#else
|
||||
public nsINetSupport,
|
||||
#endif
|
||||
// public nsIStreamObserver,
|
||||
public nsIDocumentLoaderObserver,
|
||||
public nsIObserver,
|
||||
|
@ -95,6 +101,15 @@ class nsBrowserAppCore : public nsBaseAppCore,
|
|||
NS_IMETHOD LoadInitialPage();
|
||||
|
||||
// nsIDocumentLoaderObserver
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand);
|
||||
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus, nsIDocumentLoaderObserver* aObserver);
|
||||
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, const char* aContentType, nsIContentViewer* aViewer);
|
||||
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg);
|
||||
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus);
|
||||
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader, nsIChannel* channel, const char *aContentType,const char *aCommand );
|
||||
#else
|
||||
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand);
|
||||
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus,
|
||||
nsIDocumentLoaderObserver * aObserver);
|
||||
|
@ -109,7 +124,7 @@ class nsBrowserAppCore : public nsBaseAppCore,
|
|||
nsIURI *aURL,
|
||||
const char *aContentType,
|
||||
const char *aCommand );
|
||||
|
||||
#endif
|
||||
|
||||
// nsINetSupport
|
||||
NS_IMETHOD_(void) Alert(const nsString &aText);
|
||||
|
@ -136,7 +151,9 @@ class nsBrowserAppCore : public nsBaseAppCore,
|
|||
NS_IMETHOD GoForward(nsIWebShell * aPrev);
|
||||
|
||||
NS_IMETHOD GoBack(nsIWebShell * aPrev);
|
||||
#ifndef NECKO
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD Reload(nsIWebShell * aPrev, PRUint32 aType);
|
||||
#else
|
||||
NS_IMETHOD Reload(nsIWebShell * aPrev, nsURLReloadType aType);
|
||||
#endif /* NECKO */
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
* Reload the current history entry
|
||||
*/
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD Reload(PRBool bypassCache, PRBool bypassProxy) = 0;
|
||||
NS_IMETHOD Reload(nsIWebShell * aPrev, PRUint32 aReloadFlags) = 0;
|
||||
#else
|
||||
NS_IMETHOD Reload(nsIWebShell * aPrev, nsURLReloadType aReloadType) = 0;
|
||||
#endif
|
||||
|
|
|
@ -62,7 +62,11 @@ LINCS=-I$(PUBLIC)\raptor \
|
|||
-I$(PUBLIC)\pref \
|
||||
-I$(PUBLIC)\profile \
|
||||
-I$(PUBLIC)\appcores \
|
||||
!ifdef NECKO
|
||||
-I$(PUBLIC)\necko \
|
||||
!else
|
||||
-I$(PUBLIC)\netlib \
|
||||
!endif
|
||||
-I$(PUBLIC)\rdf \
|
||||
-I$(PUBLIC)\pics \
|
||||
-I$(PUBLIC)\xpfe\components \
|
||||
|
@ -82,10 +86,14 @@ LLIBS= \
|
|||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\raptorgfxwin.lib \
|
||||
$(DIST)\lib\plc3.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
$(DIST)\lib\js3250.lib \
|
||||
$(DIST)\lib\jsdombase_s.lib \
|
||||
$(DIST)\lib\jsdomevents_s.lib \
|
||||
!endif
|
||||
$(DIST)\lib\js3250.lib \
|
||||
$(DIST)\lib\jsdombase_s.lib \
|
||||
$(DIST)\lib\jsdomevents_s.lib \
|
||||
$(LIBNSPR) \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -568,7 +568,11 @@ public:
|
|||
/**
|
||||
* Reload the current history entry
|
||||
*/
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD Reload(nsIWebShell * aPrev, PRUint32 aReloadFlags);
|
||||
#else
|
||||
NS_IMETHOD Reload(nsIWebShell * aPrev, nsURLReloadType aReloadType);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* whether you can go forward in History
|
||||
|
@ -961,7 +965,11 @@ nsSessionHistory::Goto(PRInt32 aGotoIndex, nsIWebShell * prev, PRBool aIsReload)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsSessionHistory::Reload(nsIWebShell * aPrev, PRUint32 aReloadFlags)
|
||||
#else
|
||||
nsSessionHistory::Reload(nsIWebShell * aPrev, nsURLReloadType aReloadType)
|
||||
#endif
|
||||
{
|
||||
|
||||
// Call goto with the Reload flag set to true
|
||||
|
|
|
@ -375,11 +375,18 @@ nsresult nsWebShellWindow::Initialize(nsIWebShellWindow* aParent,
|
|||
NS_IF_ADDREF(mCallbacks);
|
||||
|
||||
if (nsnull != aUrl) {
|
||||
#ifdef NECKO
|
||||
char *tmpStr = NULL;
|
||||
#else
|
||||
const char *tmpStr = NULL;
|
||||
#endif
|
||||
nsString urlString;
|
||||
|
||||
aUrl->GetSpec(&tmpStr);
|
||||
urlString = tmpStr;
|
||||
#ifdef NECKO
|
||||
nsCRT::free(tmpStr);
|
||||
#endif
|
||||
mWebShell->LoadURL(urlString.GetUnicode());
|
||||
}
|
||||
|
||||
|
@ -1596,9 +1603,15 @@ nsWebShellWindow::OnStartDocumentLoad(nsIDocumentLoader* loader,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsWebShellWindow::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, PRInt32 aStatus,
|
||||
nsIDocumentLoaderObserver * aDocObserver)
|
||||
#else
|
||||
nsWebShellWindow::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL, PRInt32 aStatus,
|
||||
nsIDocumentLoaderObserver * aDocObserver)
|
||||
nsIDocumentLoaderObserver * aDocObserver)
|
||||
#endif
|
||||
{
|
||||
#ifdef DEBUG_MENUSDEL
|
||||
printf("OnEndDocumentLoad\n");
|
||||
|
@ -1706,42 +1719,73 @@ nsWebShellWindow::OnEndDocumentLoad(nsIDocumentLoader* loader,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsWebShellWindow::OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
const char* aContentType,
|
||||
nsIContentViewer* aViewer)
|
||||
#else
|
||||
nsWebShellWindow::OnStartURLLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL,
|
||||
const char* aContentType,
|
||||
nsIContentViewer* aViewer)
|
||||
#endif
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsWebShellWindow::OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
#else
|
||||
nsWebShellWindow::OnProgressURLLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL,
|
||||
PRUint32 aProgress,
|
||||
PRUint32 aProgressMax)
|
||||
#endif
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsWebShellWindow::OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, nsString& aMsg)
|
||||
#else
|
||||
nsWebShellWindow::OnStatusURLLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL, nsString& aMsg)
|
||||
#endif
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsWebShellWindow::OnEndURLLoad(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel, PRInt32 aStatus)
|
||||
#else
|
||||
nsWebShellWindow::OnEndURLLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL, PRInt32 aStatus)
|
||||
#endif
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsWebShellWindow::HandleUnknownContentType(nsIDocumentLoader* loader,
|
||||
nsIChannel* channel,
|
||||
const char *aContentType,
|
||||
const char *aCommand )
|
||||
#else
|
||||
nsWebShellWindow::HandleUnknownContentType(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL,
|
||||
const char *aContentType,
|
||||
const char *aCommand )
|
||||
#endif
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -2181,9 +2225,19 @@ void nsWebShellWindow::LoadContentAreas() {
|
|||
docViewer->GetDocument(*getter_AddRefs(doc));
|
||||
nsCOMPtr<nsIURI> mainURL = getter_AddRefs(doc->GetDocumentURL());
|
||||
if (mainURL) {
|
||||
#ifdef NECKO
|
||||
char *search = nsnull;
|
||||
nsCOMPtr<nsIURL> url = do_QueryInterface(mainURL);
|
||||
if (url)
|
||||
url->GetQuery(&search);
|
||||
#else
|
||||
const char *search;
|
||||
mainURL->GetSearch(&search);
|
||||
#endif
|
||||
searchSpec = search;
|
||||
#ifdef NECKO
|
||||
nsCRT::free(search);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -134,6 +134,15 @@ public:
|
|||
const nsString& aAnchorAlignment);
|
||||
|
||||
// nsIDocumentLoaderObserver
|
||||
#ifdef NECKO
|
||||
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand);
|
||||
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus, nsIDocumentLoaderObserver* aObserver);
|
||||
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, const char* aContentType, nsIContentViewer* aViewer);
|
||||
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, nsString& aMsg);
|
||||
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel, PRInt32 aStatus);
|
||||
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader, nsIChannel* channel, const char *aContentType,const char *aCommand );
|
||||
#else
|
||||
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
|
||||
nsIURI* aURL, const char* aCommand);
|
||||
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader,
|
||||
|
@ -153,7 +162,7 @@ public:
|
|||
nsIURI* aURL,
|
||||
const char *aContentType,
|
||||
const char *aCommand );
|
||||
|
||||
#endif
|
||||
|
||||
// nsIDocumentObserver
|
||||
NS_IMETHOD BeginUpdate(nsIDocument *aDocument);
|
||||
|
|
|
@ -34,7 +34,11 @@ CPP_OBJS= \
|
|||
LINCS=-I$(PUBLIC)\raptor \
|
||||
-I$(PUBLIC)\xpcom \
|
||||
-I$(PUBLIC)\base \
|
||||
!ifdef NECKO
|
||||
-I$(PUBLIC)\necko \
|
||||
!else
|
||||
-I$(PUBLIC)\netlib \
|
||||
!endif
|
||||
-I$(PUBLIC)\pref \
|
||||
-I$(PUBLIC)\js \
|
||||
-I$(PUBLIC)\dom \
|
||||
|
@ -67,10 +71,14 @@ LCFLAGS = \
|
|||
|
||||
# These are the libraries we need to link with to create the exe
|
||||
LLIBS= \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\raptorgfxwin.lib \
|
||||
$(DIST)\lib\plc3.lib \
|
||||
$(DIST)\lib\plc3.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(LIBNSPR) \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -20,9 +20,7 @@
|
|||
#include "nsIComponentManager.h"
|
||||
#include "nsIURL.h"
|
||||
#ifdef NECKO
|
||||
#include "nsIIOService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
#include "nsNeckoUtil.h"
|
||||
#endif // NECKO
|
||||
#include "nsIWidget.h"
|
||||
#include "nsIWebShellWindow.h"
|
||||
|
@ -160,10 +158,6 @@ int main(int argc, char* argv[])
|
|||
nsIDOMAppCoresManager *appCoresManager = nsnull;
|
||||
nsIURI* url = nsnull;
|
||||
nsIPref *prefs = nsnull;
|
||||
#ifdef NECKO
|
||||
nsIIOService* service = nsnull;
|
||||
nsIURI *uri = nsnull;
|
||||
#endif // NECKO
|
||||
|
||||
// initialization for Full Circle
|
||||
#ifdef MOZ_FULLCIRCLE
|
||||
|
@ -536,16 +530,7 @@ int main(int argc, char* argv[])
|
|||
#ifndef NECKO
|
||||
rv = NS_NewURL(&url, urlstr);
|
||||
#else
|
||||
rv = nsServiceManager::GetService(kIOServiceCID,
|
||||
nsIIOService::GetIID(),
|
||||
(nsISupports **)&service);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = service->NewURI(urlstr, nsnull, &uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
|
||||
NS_RELEASE(uri);
|
||||
rv = NS_NewURI(&url, urlstr);
|
||||
#endif // NECKO
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
|
@ -620,7 +605,11 @@ int main(int argc, char* argv[])
|
|||
|
||||
if (profstr)
|
||||
{
|
||||
#ifdef NECKO
|
||||
rv = NS_NewURI(&profURL, profstr);
|
||||
#else
|
||||
rv = NS_NewURL(&profURL, profstr);
|
||||
#endif
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
goto done;
|
||||
|
@ -734,9 +723,5 @@ done:
|
|||
* Translate the nsresult into an appropriate platform-specific return code.
|
||||
*/
|
||||
|
||||
#ifdef NECKO
|
||||
nsServiceManager::ReleaseService(kIOServiceCID, service);
|
||||
#endif // NECKO
|
||||
|
||||
return TranslateReturnValue(rv);
|
||||
}
|
||||
|
|
|
@ -43,7 +43,6 @@ LINCS = \
|
|||
-I$(PUBLIC)/txtsvc \
|
||||
-I$(PUBLIC)/xpfe/components \
|
||||
-I$(PUBLIC)/raptor \
|
||||
-I$(PUBLIC)/netlib \
|
||||
-I$(PUBLIC)/rdf \
|
||||
-I$(PUBLIC)/dom \
|
||||
$(NULL)
|
||||
|
@ -51,7 +50,9 @@ LINCS = \
|
|||
LLIBS = \
|
||||
$(LIBNSPR) \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
!ifndef NECKO
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(NULL)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
|
|
|
@ -47,7 +47,9 @@ LINCS = \
|
|||
LLIBS = \
|
||||
$(LIBNSPR) \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
!ifndef NECKO
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(NULL)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
|
|
|
@ -34,7 +34,11 @@ LCFLAGS = \
|
|||
# These are the libraries we need to link with to create the DLL
|
||||
LLIBS= \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(DIST)\lib\plc3.lib \
|
||||
$(LIBNSPR) \
|
||||
$(NULL)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-file-style: "stroustrup" -*-
|
||||
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4; c-file-style: "stroustrup" -*-
|
||||
*
|
||||
* The contents of this file are subject to the Netscape Public License
|
||||
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||
|
@ -36,9 +36,8 @@
|
|||
#include "nsIStreamListener.h"
|
||||
#include "nsIURL.h"
|
||||
#ifdef NECKO
|
||||
#include "nsIIOService.h"
|
||||
#include "nsIURL.h"
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
#include "nsNeckoUtil.h"
|
||||
#include "nsIBufferInputStream.h"
|
||||
#endif // NECKO
|
||||
#include "nsRDFCID.h"
|
||||
#include "nsString.h"
|
||||
|
@ -99,17 +98,32 @@ public:
|
|||
NS_METHOD Init();
|
||||
NS_METHOD CreateAnonymousResource(const nsString& aPrefixURI, nsCOMPtr<nsIRDFResource>* aResult);
|
||||
|
||||
// stream observer
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartBinding(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt) { return NS_OK; }
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg) { return NS_OK; }
|
||||
|
||||
NS_IMETHOD OnStartBinding(nsIURI *aURL, const char *aContentType);
|
||||
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
|
||||
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg);
|
||||
// nsIStreamListener
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
|
||||
#else
|
||||
// stream observer
|
||||
|
||||
NS_IMETHOD OnStartBinding(nsIURI *aURL, const char *aContentType);
|
||||
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
|
||||
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
|
||||
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg);
|
||||
|
||||
// stream listener
|
||||
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
|
||||
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream,
|
||||
PRUint32 aLength);
|
||||
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
|
||||
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream,
|
||||
PRUint32 aLength);
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
PRInt32 RelatedLinksStreamListener::gRefCnt;
|
||||
|
@ -230,7 +244,11 @@ NS_IMPL_ISUPPORTS(RelatedLinksStreamListener, nsIStreamListener::GetIID());
|
|||
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
RelatedLinksStreamListener::OnStartBinding(nsISupports *ctxt)
|
||||
#else
|
||||
RelatedLinksStreamListener::OnStartBinding(nsIURI *aURL, const char *aContentType)
|
||||
#endif
|
||||
{
|
||||
nsAutoString trueStr("true");
|
||||
nsIRDFLiteral *literal = nsnull;
|
||||
|
@ -244,7 +262,7 @@ RelatedLinksStreamListener::OnStartBinding(nsIURI *aURL, const char *aContentTyp
|
|||
}
|
||||
|
||||
|
||||
|
||||
#ifndef NECKO
|
||||
NS_IMETHODIMP
|
||||
RelatedLinksStreamListener::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
|
||||
{
|
||||
|
@ -258,11 +276,16 @@ RelatedLinksStreamListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
|
|||
{
|
||||
return(NS_OK);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
RelatedLinksStreamListener::OnStopBinding(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg)
|
||||
#else
|
||||
RelatedLinksStreamListener::OnStopBinding(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
|
||||
#endif
|
||||
{
|
||||
nsAutoString trueStr("true");
|
||||
nsIRDFLiteral *literal = nsnull;
|
||||
|
@ -280,17 +303,24 @@ RelatedLinksStreamListener::OnStopBinding(nsIURI* aURL, nsresult aStatus, const
|
|||
// stream listener methods
|
||||
|
||||
|
||||
|
||||
#ifndef NECKO
|
||||
NS_IMETHODIMP
|
||||
RelatedLinksStreamListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
|
||||
{
|
||||
return(NS_OK);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
RelatedLinksStreamListener::OnDataAvailable(nsISupports *ctxt,
|
||||
nsIBufferInputStream *aIStream,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 aLength)
|
||||
#else
|
||||
RelatedLinksStreamListener::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength)
|
||||
#endif
|
||||
{
|
||||
nsresult rv = NS_OK;
|
||||
|
||||
|
@ -814,15 +844,7 @@ RelatedLinksHandlerImpl::SetURL(char* aURL)
|
|||
#ifndef NECKO
|
||||
rv = NS_NewURL(getter_AddRefs(url), queryURL);
|
||||
#else
|
||||
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsIURI *uri = nsnull;
|
||||
rv = service->NewURI(queryURL, nsnull, &uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
|
||||
NS_RELEASE(uri);
|
||||
rv = NS_NewURI(getter_AddRefs(url), queryURL);
|
||||
#endif // NECKO
|
||||
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
@ -832,7 +854,11 @@ RelatedLinksHandlerImpl::SetURL(char* aURL)
|
|||
rv = NS_NewRelatedLinksStreamListener(mInner, getter_AddRefs(listener));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
#ifdef NECKO
|
||||
rv = NS_OpenURI(listener, url);
|
||||
#else
|
||||
rv = NS_OpenURL(url, listener);
|
||||
#endif
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -18,14 +18,17 @@
|
|||
|
||||
#include "nsIAppShellComponent.idl"
|
||||
|
||||
[ptr] native nsIURI( nsIURI );
|
||||
[ptr] native nsIDocumentLoader( nsIDocumentLoader );
|
||||
interface nsIURI;
|
||||
interface nsIDocumentLoader;
|
||||
interface nsIChannel;
|
||||
|
||||
%{C++
|
||||
class nsIURI;
|
||||
class nsIDocumentLoader;
|
||||
#ifndef NECKO // gross hack since we can't put ifdefs in idl:
|
||||
#define nsIChannel nsIURI
|
||||
#endif
|
||||
%}
|
||||
|
||||
|
||||
/*----------------------- nsIUnknownContentTypeHandler -------------------------
|
||||
| This file describes the interface for Mozilla's "unknown content-type |
|
||||
| handler" component. This component is notified whenever the browser |
|
||||
|
@ -45,7 +48,7 @@ class nsIDocumentLoader;
|
|||
[scriptable, uuid(a6cf90ef-15b3-11d2-932e-00805f8add32)]
|
||||
interface nsIUnknownContentTypeHandler : nsIAppShellComponent {
|
||||
|
||||
void HandleUnknownContentType( in nsIURI aURL,
|
||||
void HandleUnknownContentType( in nsIChannel aURL,
|
||||
in string aContentType,
|
||||
in nsIDocumentLoader aDocLoader );
|
||||
};
|
||||
|
|
|
@ -42,7 +42,6 @@ LINCS = \
|
|||
-I$(PUBLIC)/xpcom \
|
||||
-I$(PUBLIC)/xpfe/components \
|
||||
-I$(PUBLIC)/raptor \
|
||||
-I$(PUBLIC)/netlib \
|
||||
-I$(PUBLIC)/rdf \
|
||||
-I$(PUBLIC)/dom \
|
||||
$(NULL)
|
||||
|
@ -50,7 +49,9 @@ LINCS = \
|
|||
LLIBS = \
|
||||
$(LIBNSPR) \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
!ifndef NECKO
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(NULL)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
|
|
|
@ -42,7 +42,11 @@ LINCS = \
|
|||
-I$(PUBLIC)/xpcom \
|
||||
-I$(PUBLIC)/xpfe/components \
|
||||
-I$(PUBLIC)/raptor \
|
||||
-I$(PUBLIC)/netlib \
|
||||
!ifdef NECKO
|
||||
-I$(PUBLIC)\necko \
|
||||
!else
|
||||
-I$(PUBLIC)\netlib \
|
||||
!endif
|
||||
-I$(PUBLIC)/rdf \
|
||||
-I$(PUBLIC)/dom \
|
||||
$(NULL)
|
||||
|
@ -50,7 +54,11 @@ LINCS = \
|
|||
LLIBS = \
|
||||
$(LIBNSPR) \
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(NULL)
|
||||
|
||||
#//------------------------------------------------------------------------
|
||||
|
|
|
@ -29,15 +29,13 @@
|
|||
#include "nsINetService.h"
|
||||
static NS_DEFINE_IID( kNetServiceCID, NS_NETSERVICE_CID );
|
||||
#else
|
||||
#include "nsIIOService.h"
|
||||
#include "nsNeckoUtil.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsIEventQueueService.h"
|
||||
#include "nsIProgressEventSink.h"
|
||||
#include "nsIBufferInputStream.h"
|
||||
static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
|
||||
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
|
||||
#endif // NECKO
|
||||
|
||||
static NS_DEFINE_IID( kAppShellServiceCID, NS_APPSHELL_SERVICE_CID );
|
||||
|
@ -75,32 +73,8 @@ nsDownloadProgressDialog::OnStart() {
|
|||
__FILE__, (int)__LINE__, (int)rv );
|
||||
}
|
||||
#else
|
||||
nsresult rv;
|
||||
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return;
|
||||
|
||||
nsIURI *uri = nsnull;
|
||||
rv = mUrl->QueryInterface(nsIURI::GetIID(), (void**)&uri);
|
||||
if (NS_FAILED(rv)) return;
|
||||
|
||||
nsIChannel *channel = nsnull;
|
||||
// XXX NECKO verb? getter?
|
||||
rv = service->NewChannelFromURI("load", uri, nsnull, &channel);
|
||||
NS_RELEASE(uri);
|
||||
if (NS_FAILED(rv)) return;
|
||||
|
||||
// Create the Event Queue for this thread...
|
||||
NS_WITH_SERVICE(nsIEventQueueService, eventQService, kEventQueueServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return;
|
||||
|
||||
nsIEventQueue *eventQ = nsnull;
|
||||
rv = eventQService->GetThreadEventQueue(PR_CurrentThread(), &eventQ);
|
||||
if (NS_FAILED(rv)) return;
|
||||
|
||||
rv = channel->AsyncRead(0, -1, nsnull, eventQ, this);
|
||||
NS_RELEASE(eventQ);
|
||||
NS_RELEASE(channel);
|
||||
if (NS_FAILED(rv)) return;
|
||||
nsresult rv = NS_OpenURI(this, mUrl);
|
||||
NS_ASSERTION(NS_SUCCEEDED(rv), "OnStart doesn't return rv!");
|
||||
#endif // NECKO
|
||||
}
|
||||
|
||||
|
@ -152,15 +126,7 @@ nsDownloadProgressDialog::Show() {
|
|||
#ifndef NECKO
|
||||
rv = NS_NewURL( &url, urlStr );
|
||||
#else
|
||||
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsIURI *uri = nsnull;
|
||||
rv = service->NewURI(urlStr, nsnull, &uri);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = uri->QueryInterface(nsIURI::GetIID(), (void**)&url);
|
||||
NS_RELEASE(uri);
|
||||
rv = NS_NewURI( &url, urlStr );
|
||||
#endif // NECKO
|
||||
|
||||
if ( NS_SUCCEEDED(rv) ) {
|
||||
|
|
|
@ -52,8 +52,8 @@ public:
|
|||
// nsIStreamObserver methods:
|
||||
NS_IMETHOD OnStartBinding(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt) { return NS_OK; }
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg) { return NS_OK; }
|
||||
// nsIStreamListener methods:
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
|
||||
#else
|
||||
|
|
|
@ -42,7 +42,11 @@ LINCS= \
|
|||
-I$(PUBLIC)\xpinstall \
|
||||
-I$(PUBLIC)\jar \
|
||||
-I$(PUBLIC)\libreg \
|
||||
-I$(PUBLIC)\netlib \
|
||||
!ifdef NECKO
|
||||
-I$(PUBLIC)\necko \
|
||||
!else
|
||||
-I$(PUBLIC)\netlib \
|
||||
!endif
|
||||
-I$(PUBLIC)\xpcom \
|
||||
-I$(PUBLIC)\pref \
|
||||
-I$(PUBLIC)\rdf \
|
||||
|
@ -59,7 +63,11 @@ LINCS= \
|
|||
LLIBS = \
|
||||
$(DIST)\lib\jar50.lib \
|
||||
$(DIST)\lib\libreg32.lib \
|
||||
!ifdef NECKO
|
||||
$(DIST)\lib\neckoutil_s.lib \
|
||||
!else
|
||||
$(DIST)\lib\netlib.lib \
|
||||
!endif
|
||||
$(DIST)\lib\xpcom.lib \
|
||||
$(DIST)\lib\js3250.lib \
|
||||
$(DIST)\lib\jsdombase_s.lib \
|
||||
|
|
|
@ -53,6 +53,9 @@
|
|||
#include "nsInstallExecute.h"
|
||||
#include "nsInstallPatch.h"
|
||||
#include "nsInstallUninstall.h"
|
||||
#ifdef NECKO
|
||||
#include "nsNeckoUtil.h"
|
||||
#endif
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include "nsWinReg.h"
|
||||
|
@ -74,6 +77,16 @@
|
|||
#define FILESEP "/"
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
|
||||
static NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID);
|
||||
#ifdef NECKO
|
||||
#else
|
||||
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
|
||||
static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
|
||||
#endif
|
||||
static NS_DEFINE_IID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
|
||||
static NS_DEFINE_IID(kIStringBundleServiceIID, NS_ISTRINGBUNDLESERVICE_IID);
|
||||
|
||||
|
||||
nsInstallInfo::nsInstallInfo(nsIFileSpec* aFile,
|
||||
const PRUnichar* aArgs,
|
||||
|
@ -834,20 +847,15 @@ nsInstall::GetWinRegistry(JSContext* jscontext, JSClass* WinRegClass, jsval* aRe
|
|||
PRInt32
|
||||
nsInstall::LoadResources(JSContext* cx, const nsString& aBaseName, jsval* aReturn)
|
||||
{
|
||||
static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
|
||||
static NS_DEFINE_IID(kIEventQueueServiceIID, NS_IEVENTQUEUESERVICE_IID);
|
||||
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
|
||||
static NS_DEFINE_IID(kINetServiceIID, NS_INETSERVICE_IID);
|
||||
static NS_DEFINE_IID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
|
||||
static NS_DEFINE_IID(kIStringBundleServiceIID, NS_ISTRINGBUNDLESERVICE_IID);
|
||||
|
||||
nsresult ret;
|
||||
nsFileSpec* resFile;
|
||||
nsFileURL* resFileURL = nsnull;
|
||||
nsIURI *url = nsnull;
|
||||
nsILocale* locale = nsnull;
|
||||
nsIStringBundleService* service = nsnull;
|
||||
#ifndef NECKO
|
||||
nsINetService* pNetService = nsnull;
|
||||
#endif
|
||||
nsIEventQueueService* pEventQueueService = nsnull;
|
||||
nsIStringBundle* bundle = nsnull;
|
||||
nsIBidirectionalEnumerator* propEnum = nsnull;
|
||||
|
@ -878,9 +886,11 @@ nsInstall::LoadResources(JSContext* cx, const nsString& aBaseName, jsval* aRetur
|
|||
kIStringBundleServiceIID, (nsISupports**) &service);
|
||||
if (NS_FAILED(ret))
|
||||
goto handle_err;
|
||||
#ifndef NECKO
|
||||
ret = nsServiceManager::GetService(kNetServiceCID, kINetServiceIID, (nsISupports**) &pNetService);
|
||||
if (NS_FAILED(ret))
|
||||
goto handle_err;
|
||||
#endif
|
||||
ret = nsServiceManager::GetService(kEventQueueServiceCID,
|
||||
kIEventQueueServiceIID, (nsISupports**) &pEventQueueService);
|
||||
if (NS_FAILED(ret))
|
||||
|
@ -891,7 +901,11 @@ nsInstall::LoadResources(JSContext* cx, const nsString& aBaseName, jsval* aRetur
|
|||
|
||||
// construct properties file URL as required by StringBundle interface
|
||||
resFileURL = new nsFileURL( *resFile );
|
||||
#ifdef NECKO
|
||||
ret = NS_NewURI(&url, resFileURL->GetURLString());
|
||||
#else
|
||||
ret = pNetService->CreateURL(&url, nsString( resFileURL->GetURLString()), nsnull, nsnull, nsnull);
|
||||
#endif
|
||||
if (resFileURL)
|
||||
delete resFileURL;
|
||||
if (resFile)
|
||||
|
|
|
@ -49,7 +49,9 @@
|
|||
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsILocale.h"
|
||||
#ifndef NECKO
|
||||
#include "nsINetService.h"
|
||||
#endif
|
||||
#include "nsIEventQueueService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIComponentManager.h"
|
||||
|
|
|
@ -30,8 +30,13 @@
|
|||
#include "nsIServiceManager.h"
|
||||
|
||||
#include "nsIURL.h"
|
||||
#ifdef NECKO
|
||||
#include "nsNeckoUtil.h"
|
||||
#include "nsIBufferInputStream.h"
|
||||
#else
|
||||
#include "nsINetlibURL.h"
|
||||
#include "nsINetService.h"
|
||||
#endif
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsIStreamListener.h"
|
||||
|
||||
|
@ -204,9 +209,18 @@ nsresult nsXPInstallManager::DownloadNext()
|
|||
{
|
||||
// --- start the download
|
||||
nsIURI *pURL;
|
||||
#ifdef NECKO
|
||||
rv = NS_NewURI(&pURL, mItem->mURL);
|
||||
#else
|
||||
rv = NS_NewURL(&pURL, mItem->mURL);
|
||||
if (NS_SUCCEEDED(rv))
|
||||
#endif
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
#ifdef NECKO
|
||||
rv = NS_OpenURI( this, pURL );
|
||||
#else
|
||||
rv = NS_OpenURL( pURL, this );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
if (NS_FAILED(rv))
|
||||
|
@ -248,7 +262,7 @@ nsresult nsXPInstallManager::DownloadNext()
|
|||
|
||||
|
||||
// IStreamListener methods
|
||||
|
||||
#ifndef NECKO
|
||||
NS_IMETHODIMP
|
||||
nsXPInstallManager::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* info)
|
||||
{
|
||||
|
@ -272,19 +286,29 @@ nsXPInstallManager::OnStatus(nsIURI* aURL,
|
|||
else
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
#endif
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsXPInstallManager::OnStartBinding(nsISupports *ctxt)
|
||||
#else
|
||||
nsXPInstallManager::OnStartBinding(nsIURI* aURL,
|
||||
const char *aContentType)
|
||||
#endif
|
||||
{
|
||||
mItem->mFile->openStreamForWriting();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
#ifdef NECKO
|
||||
nsXPInstallManager::OnStopBinding(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg)
|
||||
#else
|
||||
nsXPInstallManager::OnStopBinding(nsIURI* aURL,
|
||||
nsresult status,
|
||||
const PRUnichar* aMsg)
|
||||
#endif
|
||||
{
|
||||
nsresult rv;
|
||||
switch( status )
|
||||
|
@ -314,7 +338,16 @@ nsXPInstallManager::OnStopBinding(nsIURI* aURL,
|
|||
#define BUF_SIZE 1024
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXPInstallManager::OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32 length)
|
||||
#ifdef NECKO
|
||||
nsXPInstallManager::OnDataAvailable(nsISupports *ctxt,
|
||||
nsIBufferInputStream *pIStream,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 length)
|
||||
#else
|
||||
nsXPInstallManager::OnDataAvailable(nsIURI* aURL,
|
||||
nsIInputStream *pIStream,
|
||||
PRUint32 length)
|
||||
#endif
|
||||
{
|
||||
PRUint32 len;
|
||||
PRInt32 result;
|
||||
|
|
|
@ -32,8 +32,10 @@
|
|||
#include "nsString.h"
|
||||
|
||||
#include "nsIURL.h"
|
||||
#ifndef NECKO
|
||||
#include "nsINetlibURL.h"
|
||||
#include "nsINetService.h"
|
||||
#endif
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsIStreamListener.h"
|
||||
#include "nsIXPINotifier.h"
|
||||
|
@ -60,6 +62,20 @@ class nsXPInstallManager : public nsIXPINotifier, public nsIStreamListener
|
|||
|
||||
NS_IMETHOD InitManager( nsXPITriggerInfo* aTrigger );
|
||||
|
||||
#ifdef NECKO
|
||||
// nsIStreamObserver
|
||||
NS_IMETHOD OnStartBinding(nsISupports *ctxt);
|
||||
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg);
|
||||
NS_IMETHOD OnStartRequest(nsISupports *ctxt) { return NS_OK; }
|
||||
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status,
|
||||
const PRUnichar *errorMsg) { return NS_OK; }
|
||||
// nsIStreamListener
|
||||
NS_IMETHOD OnDataAvailable(nsISupports *ctxt,
|
||||
nsIBufferInputStream *inStr,
|
||||
PRUint32 sourceOffset,
|
||||
PRUint32 count);
|
||||
#else
|
||||
// IStreamListener methods
|
||||
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* info);
|
||||
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 Progress, PRUint32 ProgressMax);
|
||||
|
@ -67,6 +83,7 @@ class nsXPInstallManager : public nsIXPINotifier, public nsIStreamListener
|
|||
NS_IMETHOD OnStartBinding(nsIURI* aURL, const char *aContentType);
|
||||
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32 length);
|
||||
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg);
|
||||
#endif
|
||||
|
||||
// IXPINotifier methods
|
||||
NS_IMETHOD BeforeJavascriptEvaluation();
|
||||
|
|
Загрузка…
Ссылка в новой задаче