Last of the necko ifdefs. Now we link with necko.

This commit is contained in:
warren%netscape.com 1999-06-28 10:35:57 +00:00
Родитель 9a161d923f
Коммит f5e1196f42
71 изменённых файлов: 2624 добавлений и 416 удалений

Просмотреть файл

@ -24,7 +24,10 @@
#include "nsIDeviceContext.h" #include "nsIDeviceContext.h"
#include "nsILinkHandler.h" #include "nsILinkHandler.h"
#include "nsIStreamListener.h" #include "nsIStreamListener.h"
#ifndef NECKO
#include "nsINetSupport.h" #include "nsINetSupport.h"
#include "nsIRefreshUrl.h"
#endif
#include "nsIScriptGlobalObject.h" #include "nsIScriptGlobalObject.h"
#include "nsIScriptContextOwner.h" #include "nsIScriptContextOwner.h"
#include "nsIDocumentLoaderObserver.h" #include "nsIDocumentLoaderObserver.h"
@ -45,7 +48,6 @@
//#include "nsPluginsCID.h" //#include "nsPluginsCID.h"
#include "nsIPluginManager.h" #include "nsIPluginManager.h"
#include "nsIPref.h" #include "nsIPref.h"
#include "nsIRefreshUrl.h"
#include "nsITimer.h" #include "nsITimer.h"
#include "nsITimerCallback.h" #include "nsITimerCallback.h"
#include "jsurl.h" #include "jsurl.h"
@ -57,6 +59,7 @@
#include "nsIStreamObserver.h" #include "nsIStreamObserver.h"
#include "nsIWebShellServices.h" #include "nsIWebShellServices.h"
#include "nsIGlobalHistory.h" #include "nsIGlobalHistory.h"
#include "prmem.h"
#ifdef XP_PC #ifdef XP_PC
#include <windows.h> #include <windows.h>
@ -130,8 +133,10 @@ class nsWebShell : public nsIWebShell,
public nsILinkHandler, public nsILinkHandler,
public nsIScriptContextOwner, public nsIScriptContextOwner,
public nsIDocumentLoaderObserver, public nsIDocumentLoaderObserver,
#ifndef NECKO
public nsIRefreshUrl, public nsIRefreshUrl,
public nsINetSupport, public nsINetSupport,
#endif
// public nsIStreamObserver, // public nsIStreamObserver,
public nsIClipboardCommands public nsIClipboardCommands
{ {
@ -210,17 +215,29 @@ public:
NS_IMETHOD LoadURL(const PRUnichar *aURLSpec, NS_IMETHOD LoadURL(const PRUnichar *aURLSpec,
nsIPostData* aPostData=nsnull, nsIPostData* aPostData=nsnull,
PRBool aModifyHistory=PR_TRUE, PRBool aModifyHistory=PR_TRUE,
#ifdef NECKO
PRUint32 aType = nsIChannel::LOAD_NORMAL,
#else
nsURLReloadType aType = nsURLReload, nsURLReloadType aType = nsURLReload,
#endif
const PRUint32 localIP = 0); const PRUint32 localIP = 0);
NS_IMETHOD LoadURL(const PRUnichar *aURLSpec, NS_IMETHOD LoadURL(const PRUnichar *aURLSpec,
const char* aCommand, const char* aCommand,
nsIPostData* aPostData=nsnull, nsIPostData* aPostData=nsnull,
PRBool aModifyHistory=PR_TRUE, PRBool aModifyHistory=PR_TRUE,
#ifdef NECKO
PRUint32 aType = nsIChannel::LOAD_NORMAL,
#else
nsURLReloadType aType = nsURLReload, nsURLReloadType aType = nsURLReload,
#endif
const PRUint32 localIP = 0); const PRUint32 localIP = 0);
NS_IMETHOD Stop(void); NS_IMETHOD Stop(void);
#ifdef NECKO
NS_IMETHOD Reload(PRUint32 aType);
#else
NS_IMETHOD Reload(nsURLReloadType aType); NS_IMETHOD Reload(nsURLReloadType aType);
#endif
// History api's // History api's
NS_IMETHOD Back(void); NS_IMETHOD Back(void);
@ -278,6 +295,30 @@ public:
NS_IMETHOD GetScriptGlobalObject(nsIScriptGlobalObject **aGlobal); NS_IMETHOD GetScriptGlobalObject(nsIScriptGlobalObject **aGlobal);
NS_IMETHOD ReleaseScriptContext(nsIScriptContext *aContext); 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 // nsIDocumentLoaderObserver
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsIURI* aURL,
@ -300,6 +341,7 @@ public:
nsIURI* aURL, nsIURI* aURL,
const char *aContentType, const char *aContentType,
const char *aCommand ); const char *aCommand );
#endif
// NS_IMETHOD OnConnectionsComplete(); // NS_IMETHOD OnConnectionsComplete();
// nsIRefreshURL interface methods... // nsIRefreshURL interface methods...
@ -395,7 +437,9 @@ protected:
nsIWidget* mWindow; nsIWidget* mWindow;
nsIDocumentLoader* mDocLoader; nsIDocumentLoader* mDocLoader;
nsIDocumentLoaderObserver* mDocLoaderObserver; nsIDocumentLoaderObserver* mDocLoaderObserver;
#ifndef NECKO
nsINetSupport* mNetSupport; nsINetSupport* mNetSupport;
#endif
nsIWebShell* mParent; nsIWebShell* mParent;
nsVoidArray mChildren; nsVoidArray mChildren;
@ -430,7 +474,11 @@ protected:
nsresult DoLoadURL(const nsString& aUrlSpec, nsresult DoLoadURL(const nsString& aUrlSpec,
const char* aCommand, const char* aCommand,
nsIPostData* aPostData, nsIPostData* aPostData,
#ifdef NECKO
PRUint32 aType,
#else
nsURLReloadType aType, nsURLReloadType aType,
#endif
const PRUint32 aLocalIP); const PRUint32 aLocalIP);
float mZoom; 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(kIScriptContextOwnerIID, NS_ISCRIPTCONTEXTOWNER_IID);
static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID); static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
#ifndef NECKO
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID); 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(kIWebShellIID, NS_IWEB_SHELL_IID);
static NS_DEFINE_IID(kIWebShellServicesIID, NS_IWEB_SHELL_SERVICES_IID); static NS_DEFINE_IID(kIWebShellServicesIID, NS_IWEB_SHELL_SERVICES_IID);
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_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(kCPluginHostCID, NS_PLUGIN_HOST_CID);
static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID); static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
static NS_DEFINE_IID(kIDocumentViewerIID, NS_IDOCUMENT_VIEWER_IID); 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(kITimerCallbackIID, NS_ITIMERCALLBACK_IID);
static NS_DEFINE_IID(kIWebShellContainerIID, NS_IWEB_SHELL_CONTAINER_IID); static NS_DEFINE_IID(kIWebShellContainerIID, NS_IWEB_SHELL_CONTAINER_IID);
static NS_DEFINE_IID(kIBrowserWindowIID, NS_IBROWSER_WINDOW_IID); static NS_DEFINE_IID(kIBrowserWindowIID, NS_IBROWSER_WINDOW_IID);
@ -596,7 +646,9 @@ nsWebShell::~nsWebShell()
NS_IF_RELEASE(mPrefs); NS_IF_RELEASE(mPrefs);
NS_IF_RELEASE(mContainer); NS_IF_RELEASE(mContainer);
NS_IF_RELEASE(mObserver); NS_IF_RELEASE(mObserver);
#ifndef NECKO
NS_IF_RELEASE(mNetSupport); NS_IF_RELEASE(mNetSupport);
#endif
if (nsnull != mScriptGlobal) { if (nsnull != mScriptGlobal) {
mScriptGlobal->SetWebShell(nsnull); mScriptGlobal->SetWebShell(nsnull);
@ -729,6 +781,7 @@ nsWebShell::QueryInterface(REFNSIID aIID, void** aInstancePtr)
NS_ADDREF_THIS(); NS_ADDREF_THIS();
return NS_OK; return NS_OK;
} }
#ifndef NECKO
if (aIID.Equals(kRefreshURLIID)) { if (aIID.Equals(kRefreshURLIID)) {
*aInstancePtr = (void*)(nsIRefreshUrl*)this; *aInstancePtr = (void*)(nsIRefreshUrl*)this;
NS_ADDREF_THIS(); NS_ADDREF_THIS();
@ -739,6 +792,7 @@ nsWebShell::QueryInterface(REFNSIID aIID, void** aInstancePtr)
NS_ADDREF_THIS(); NS_ADDREF_THIS();
return NS_OK; return NS_OK;
} }
#endif
if (aIID.Equals(kIClipboardCommandsIID)) { if (aIID.Equals(kIClipboardCommandsIID)) {
*aInstancePtr = (void*) ((nsIClipboardCommands*)this); *aInstancePtr = (void*) ((nsIClipboardCommands*)this);
NS_ADDREF_THIS(); NS_ADDREF_THIS();
@ -840,11 +894,19 @@ nsWebShell::GetContentViewer(nsIContentViewer** aResult)
NS_IMETHODIMP NS_IMETHODIMP
nsWebShell::HandleUnknownContentType(nsIDocumentLoader* loader, nsWebShell::HandleUnknownContentType(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL, nsIURI* aURL,
#endif
const char *aContentType, const char *aContentType,
const char *aCommand ) { const char *aCommand ) {
// If we have a doc loader observer, let it respond to this. // 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 ) return mDocLoaderObserver ? mDocLoaderObserver->HandleUnknownContentType( mDocLoader, aURL, aContentType, aCommand )
#endif
: NS_ERROR_FAILURE; : NS_ERROR_FAILURE;
} }
@ -1181,11 +1243,15 @@ NS_IMETHODIMP
nsWebShell::SetObserver(nsIStreamObserver* anObserver) nsWebShell::SetObserver(nsIStreamObserver* anObserver)
{ {
NS_IF_RELEASE(mObserver); NS_IF_RELEASE(mObserver);
#ifndef NECKO
NS_IF_RELEASE(mNetSupport); NS_IF_RELEASE(mNetSupport);
#endif
mObserver = anObserver; mObserver = anObserver;
if (nsnull != mObserver) { if (nsnull != mObserver) {
#ifndef NECKO
mObserver->QueryInterface(kINetSupportIID, (void **) &mNetSupport); mObserver->QueryInterface(kINetSupportIID, (void **) &mNetSupport);
#endif
NS_ADDREF(mObserver); NS_ADDREF(mObserver);
} }
return NS_OK; return NS_OK;
@ -1633,7 +1699,11 @@ NS_IMETHODIMP
nsWebShell::LoadURL(const PRUnichar *aURLSpec, nsWebShell::LoadURL(const PRUnichar *aURLSpec,
nsIPostData* aPostData, nsIPostData* aPostData,
PRBool aModifyHistory, PRBool aModifyHistory,
#ifdef NECKO
PRUint32 aType,
#else
nsURLReloadType aType, nsURLReloadType aType,
#endif
const PRUint32 aLocalIP) const PRUint32 aLocalIP)
{ {
// Initialize margnwidth, marginheight. Put scrolling back the way it was // Initialize margnwidth, marginheight. Put scrolling back the way it was
@ -1647,7 +1717,11 @@ nsresult
nsWebShell::DoLoadURL(const nsString& aUrlSpec, nsWebShell::DoLoadURL(const nsString& aUrlSpec,
const char* aCommand, const char* aCommand,
nsIPostData* aPostData, nsIPostData* aPostData,
#ifdef NECKO
PRUint32 aType,
#else
nsURLReloadType aType, nsURLReloadType aType,
#endif
const PRUint32 aLocalIP) 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 // 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 // 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; nsCOMPtr<nsIDocumentViewer> docViewer;
if (NS_SUCCEEDED(mContentViewer->QueryInterface(kIDocumentViewerIID, if (NS_SUCCEEDED(mContentViewer->QueryInterface(kIDocumentViewerIID,
getter_AddRefs(docViewer)))) { getter_AddRefs(docViewer)))) {
@ -1685,10 +1764,25 @@ nsWebShell::DoLoadURL(const nsString& aUrlSpec,
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
#endif // NECKO #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 // 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; const char* ref;
url->GetRef(&ref); url->GetRef(&ref);
#endif
if (nsnull != ref) { if (nsnull != ref) {
// Get the pres shell object // Get the pres shell object
@ -1737,7 +1831,11 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec,
const char* aCommand, const char* aCommand,
nsIPostData* aPostData, nsIPostData* aPostData,
PRBool aModifyHistory, PRBool aModifyHistory,
#ifdef NECKO
PRUint32 aType,
#else
nsURLReloadType aType, nsURLReloadType aType,
#endif
const PRUint32 aLocalIP) const PRUint32 aLocalIP)
{ {
@ -1866,7 +1964,11 @@ NS_IMETHODIMP nsWebShell::Stop(void)
return NS_OK; return NS_OK;
} }
#ifdef NECKO
NS_IMETHODIMP nsWebShell::Reload(PRUint32 aType)
#else
NS_IMETHODIMP nsWebShell::Reload(nsURLReloadType aType) NS_IMETHODIMP nsWebShell::Reload(nsURLReloadType aType)
#endif
{ {
nsString* s = (nsString*) mHistory.ElementAt(mHistoryIndex); nsString* s = (nsString*) mHistory.ElementAt(mHistoryIndex);
if (nsnull != s) { if (nsnull != s) {
@ -1928,7 +2030,11 @@ nsWebShell::GoTo(PRInt32 aHistoryIndex)
rv = DoLoadURL(urlSpec, // URL string rv = DoLoadURL(urlSpec, // URL string
"view", // Command "view", // Command
nsnull, // Post Data nsnull, // Post Data
#ifdef NECKO
nsIChannel::LOAD_NORMAL, // the reload type
#else
nsURLReload, // the reload type nsURLReload, // the reload type
#endif
0); // load attributes 0); // load attributes
} }
return rv; return rv;
@ -2613,16 +2719,27 @@ nsWebShell::OnStartDocumentLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP NS_IMETHODIMP
nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL, nsIURI* aURL,
#endif
PRInt32 aStatus, PRInt32 aStatus,
nsIDocumentLoaderObserver * aWebShell) 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 #if DEBUG_nisheeth
const char* spec; const char* spec;
aURL->GetSpec(&spec); aURL->GetSpec(&spec);
printf("nsWebShell::OnEndDocumentLoad:%p: loader=%p url=%s status=%d\n", this, loader, spec, aStatus); printf("nsWebShell::OnEndDocumentLoad:%p: loader=%p url=%s status=%d\n", this, loader, spec, aStatus);
#endif #endif
nsresult rv = NS_ERROR_FAILURE;
if (!mProcessedEndDocumentLoad) { if (!mProcessedEndDocumentLoad) {
mProcessedEndDocumentLoad = PR_TRUE; mProcessedEndDocumentLoad = PR_TRUE;
@ -2648,13 +2765,20 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
// Fire the EndLoadURL of the web shell container // Fire the EndLoadURL of the web shell container
if (nsnull != aURL) { if (nsnull != aURL) {
nsAutoString urlString; nsAutoString urlString;
#ifdef NECKO
char* spec;
#else
const char* spec; const char* spec;
#endif
rv = aURL->GetSpec(&spec); rv = aURL->GetSpec(&spec);
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
urlString = spec; urlString = spec;
if (nsnull != mContainer) { if (nsnull != mContainer) {
rv = mContainer->EndLoadURL(this, urlString.GetUnicode(), 0); 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 * Fire the OnEndDocumentLoad of the DocLoaderobserver
*/ */
if (dlObserver && (nsnull != aURL)) { if (dlObserver && (nsnull != aURL)) {
#ifdef NECKO
dlObserver->OnEndDocumentLoad(mDocLoader, channel, aStatus, aWebShell);
#else
dlObserver->OnEndDocumentLoad(mDocLoader, aURL, aStatus, aWebShell); dlObserver->OnEndDocumentLoad(mDocLoader, aURL, aStatus, aWebShell);
#endif
} }
} //!mProcessedEndDocumentLoad } //!mProcessedEndDocumentLoad
@ -2696,10 +2824,21 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP NS_IMETHODIMP
nsWebShell::OnStartURLLoad(nsIDocumentLoader* loader, nsWebShell::OnStartURLLoad(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL, nsIURI* aURL,
#endif
const char* aContentType, const char* aContentType,
nsIContentViewer* aViewer) 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 // XXX This is a temporary hack for meeting the M4 milestone
// for seamonkey. I think Netlib should send a message to all stream listeners // 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)) if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{ {
#ifdef NECKO
mDocLoaderObserver->OnStartURLLoad(mDocLoader, channel, aContentType, aViewer);
#else
mDocLoaderObserver->OnStartURLLoad(mDocLoader, aURL, aContentType, aViewer); mDocLoaderObserver->OnStartURLLoad(mDocLoader, aURL, aContentType, aViewer);
#endif
} }
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader, nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL, nsIURI* aURL,
#endif
PRUint32 aProgress, PRUint32 aProgress,
PRUint32 aProgressMax) PRUint32 aProgressMax)
{ {
@ -2734,7 +2881,11 @@ nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
*/ */
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver)) if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{ {
#ifdef NECKO
mDocLoaderObserver->OnProgressURLLoad(mDocLoader, channel, aProgress, aProgressMax);
#else
mDocLoaderObserver->OnProgressURLLoad(mDocLoader, aURL, aProgress, aProgressMax); mDocLoaderObserver->OnProgressURLLoad(mDocLoader, aURL, aProgress, aProgressMax);
#endif
} }
return NS_OK; return NS_OK;
@ -2742,7 +2893,11 @@ nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP NS_IMETHODIMP
nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader, nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL, nsIURI* aURL,
#endif
nsString& aMsg) nsString& aMsg)
{ {
/* /*
@ -2750,7 +2905,11 @@ nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
*/ */
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver)) if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{ {
#ifdef NECKO
mDocLoaderObserver->OnStatusURLLoad(mDocLoader, channel, aMsg);
#else
mDocLoaderObserver->OnStatusURLLoad(mDocLoader, aURL, aMsg); mDocLoaderObserver->OnStatusURLLoad(mDocLoader, aURL, aMsg);
#endif
} }
return NS_OK; return NS_OK;
@ -2758,7 +2917,11 @@ nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP NS_IMETHODIMP
nsWebShell::OnEndURLLoad(nsIDocumentLoader* loader, nsWebShell::OnEndURLLoad(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL, nsIURI* aURL,
#endif
PRInt32 aStatus) PRInt32 aStatus)
{ {
#if 0 #if 0
@ -2771,7 +2934,11 @@ nsWebShell::OnEndURLLoad(nsIDocumentLoader* loader,
*/ */
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver)) if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{ {
#ifdef NECKO
mDocLoaderObserver->OnEndURLLoad(mDocLoader, channel, aStatus);
#else
mDocLoaderObserver->OnEndURLLoad(mDocLoader, aURL, aStatus); mDocLoaderObserver->OnEndURLLoad(mDocLoader, aURL, aStatus);
#endif
} }
return NS_OK; return NS_OK;
@ -2816,7 +2983,11 @@ void refreshData::Notify(nsITimer *aTimer)
{ {
NS_PRECONDITION((nsnull != mShell), "Null pointer..."); NS_PRECONDITION((nsnull != mShell), "Null pointer...");
if (nsnull != mShell) { if (nsnull != mShell) {
#ifdef NECKO
mShell->LoadURL(mUrlSpec.GetUnicode(), nsnull, PR_TRUE, nsIChannel::LOAD_NORMAL);
#else
mShell->LoadURL(mUrlSpec.GetUnicode(), nsnull, PR_TRUE, nsURLReload); mShell->LoadURL(mUrlSpec.GetUnicode(), nsnull, PR_TRUE, nsURLReload);
#endif
} }
/* /*
* LoadURL(...) will cancel all refresh timers... This causes the Timer and * 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; goto done;
} }
#ifdef NECKO
char* spec;
#else
const char* spec; const char* spec;
#endif
aURL->GetSpec(&spec); aURL->GetSpec(&spec);
rv = RefreshURL(spec, millis, repeat); rv = RefreshURL(spec, millis, repeat);
#ifdef NECKO
nsCRT::free(spec);
#endif
done: done:
return rv; return rv;
} }
@ -2955,9 +3133,16 @@ nsresult nsWebShell::CheckForTrailingSlash(nsIURI* aURL)
nsString * historyURL = (nsString *) new nsString(url); nsString * historyURL = (nsString *) new nsString(url);
/* Get the url that netlib passed us */ /* Get the url that netlib passed us */
#ifdef NECKO
char* spec;
#else
const char* spec; const char* spec;
#endif
aURL->GetSpec(&spec); aURL->GetSpec(&spec);
nsString* newURL = (nsString*) new nsString(spec); nsString* newURL = (nsString*) new nsString(spec);
#ifdef NECKO
nsCRT::free(spec);
#endif
if (newURL && newURL->Last() == '/' && !historyURL->Equals(*newURL)) { if (newURL && newURL->Last() == '/' && !historyURL->Equals(*newURL)) {
// Replace the top most history entry with the new url // 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) NS_IMETHODIMP_(void)
nsWebShell::Alert(const nsString &aText) nsWebShell::Alert(const nsString &aText)
{ {
#ifdef NECKO
NS_ASSERTION(0, "help");
#else
if (nsnull != mNetSupport) { if (nsnull != mNetSupport) {
mNetSupport->Alert(aText); mNetSupport->Alert(aText);
} }
#endif
} }
NS_IMETHODIMP_(PRBool) NS_IMETHODIMP_(PRBool)
@ -3057,9 +3246,13 @@ nsWebShell::Confirm(const nsString &aText)
{ {
PRBool bResult = PR_FALSE; PRBool bResult = PR_FALSE;
#ifdef NECKO
NS_ASSERTION(0, "help");
#else
if (nsnull != mNetSupport) { if (nsnull != mNetSupport) {
bResult = mNetSupport->Confirm(aText); bResult = mNetSupport->Confirm(aText);
} }
#endif
return bResult; return bResult;
} }
@ -3070,9 +3263,13 @@ nsWebShell::Prompt(const nsString &aText,
{ {
PRBool bResult = PR_FALSE; PRBool bResult = PR_FALSE;
#ifdef NECKO
NS_ASSERTION(0, "help");
#else
if (nsnull != mNetSupport) { if (nsnull != mNetSupport) {
bResult = mNetSupport->Prompt(aText, aDefault, aResult); bResult = mNetSupport->Prompt(aText, aDefault, aResult);
} }
#endif
return bResult; return bResult;
} }
@ -3083,9 +3280,13 @@ nsWebShell::PromptUserAndPassword(const nsString &aText,
{ {
PRBool bResult = PR_FALSE; PRBool bResult = PR_FALSE;
#ifdef NECKO
NS_ASSERTION(0, "help");
#else
if (nsnull != mNetSupport) { if (nsnull != mNetSupport) {
bResult = mNetSupport->PromptUserAndPassword(aText, aUser, aPassword); bResult = mNetSupport->PromptUserAndPassword(aText, aUser, aPassword);
} }
#endif
return bResult; return bResult;
} }
@ -3095,9 +3296,13 @@ nsWebShell::PromptPassword(const nsString &aText,
{ {
PRBool bResult = PR_FALSE; PRBool bResult = PR_FALSE;
#ifdef NECKO
NS_ASSERTION(0, "help");
#else
if (nsnull != mNetSupport) { if (nsnull != mNetSupport) {
bResult = mNetSupport->PromptPassword(aText, aPassword); bResult = mNetSupport->PromptPassword(aText, aPassword);
} }
#endif
return bResult; return bResult;
} }

Просмотреть файл

@ -48,7 +48,11 @@ MISCDEP = \
$(DIST)\lib\jsdomcss_s.lib \ $(DIST)\lib\jsdomcss_s.lib \
$(DIST)\lib\jsurl.lib \ $(DIST)\lib\jsurl.lib \
$(DIST)\lib\raptorgfxwin.lib \ $(DIST)\lib\raptorgfxwin.lib \
!ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(DIST)\lib\js32$(VERSION_NUMBER).lib \ $(DIST)\lib\js32$(VERSION_NUMBER).lib \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
$(DIST)\lib\plds3.lib \ $(DIST)\lib\plds3.lib \
@ -70,7 +74,11 @@ LLIBS= \
$(DIST)\lib\jsdomcss_s.lib \ $(DIST)\lib\jsdomcss_s.lib \
$(DIST)\lib\jsurl.lib \ $(DIST)\lib\jsurl.lib \
$(DIST)\lib\raptorgfxwin.lib \ $(DIST)\lib\raptorgfxwin.lib \
!ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(DIST)\lib\js32$(VERSION_NUMBER).lib \ $(DIST)\lib\js32$(VERSION_NUMBER).lib \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
$(DIST)\lib\plds3.lib \ $(DIST)\lib\plds3.lib \

Просмотреть файл

@ -127,7 +127,10 @@ LLIBS= \
$(DIST)\lib\plc3.lib \ $(DIST)\lib\plc3.lib \
$(DIST)\lib\raptorhtmlpars.lib \ $(DIST)\lib\raptorhtmlpars.lib \
$(DIST)\lib\raptorwidget_s.lib \ $(DIST)\lib\raptorwidget_s.lib \
!ifdef NECKO
!else
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(LIBNSPR) $(LIBNSPR)
!if "$(MOZ_BITS)"=="32" && defined(MOZ_DEBUG) && defined(GLOWCODE) !if "$(MOZ_BITS)"=="32" && defined(MOZ_DEBUG) && defined(GLOWCODE)
LLIBS=$(LLIBS) $(GLOWDIR)\glowcode.lib LLIBS=$(LLIBS) $(GLOWDIR)\glowcode.lib
@ -136,7 +139,7 @@ LLIBS=$(LLIBS) $(GLOWDIR)\glowcode.lib
include <$(DEPTH)\config\rules.mak> include <$(DEPTH)\config\rules.mak>
libs:: $(DLL) install:: $(DLL)
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin\components $(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).dll $(DIST)\bin\components
$(MAKE_INSTALL) .\$(OBJDIR)\$(DLLNAME).lib $(DIST)\lib $(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); static NS_DEFINE_IID(kFileWidgetCID, NS_FILEWIDGET_CID);
/* Define Interface IDs */ /* Define Interface IDs */
#ifdef NECKO
#else
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID); static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
#endif
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
#define APP_DEBUG 0 #define APP_DEBUG 0

Просмотреть файл

@ -27,7 +27,10 @@
#include "nsIEditorShell.h" #include "nsIEditorShell.h"
#include "nsIDocumentLoaderObserver.h" #include "nsIDocumentLoaderObserver.h"
#ifdef NECKO
#else
#include "nsINetSupport.h" #include "nsINetSupport.h"
#endif
#include "nsIStreamObserver.h" #include "nsIStreamObserver.h"
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsVoidArray.h" #include "nsVoidArray.h"

Просмотреть файл

@ -101,7 +101,10 @@ static NS_DEFINE_CID(kCSpellCheckerCID, NS_SPELLCHECKER_CID);
static NS_DEFINE_IID(kFileWidgetCID, NS_FILEWIDGET_CID); static NS_DEFINE_IID(kFileWidgetCID, NS_FILEWIDGET_CID);
/* Define Interface IDs */ /* Define Interface IDs */
#ifdef NECKO
#else
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID); static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
#endif
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
#define APP_DEBUG 0 #define APP_DEBUG 0

Просмотреть файл

@ -27,7 +27,10 @@
#include "nsIEditorShell.h" #include "nsIEditorShell.h"
#include "nsIDocumentLoaderObserver.h" #include "nsIDocumentLoaderObserver.h"
#ifdef NECKO
#else
#include "nsINetSupport.h" #include "nsINetSupport.h"
#endif
#include "nsIStreamObserver.h" #include "nsIStreamObserver.h"
#include "nsIDOMDocument.h" #include "nsIDOMDocument.h"
#include "nsVoidArray.h" #include "nsVoidArray.h"

Просмотреть файл

@ -55,7 +55,11 @@ LINCS = -I$(PUBLIC)/js \
-I$(PUBLIC)\xpcom \ -I$(PUBLIC)\xpcom \
-I$(PUBLIC)\raptor \ -I$(PUBLIC)\raptor \
-I$(PUBLIC)\pref \ -I$(PUBLIC)\pref \
-I$(PUBLIC)\netlib \ !ifdef NECKO
-I$(PUBLIC)\necko \
!else
-I$(PUBLIC)\netlib \
!endif
-I$(DEPTH)\include \ -I$(DEPTH)\include \
MAKE_OBJ_TYPE = DLL MAKE_OBJ_TYPE = DLL
@ -73,7 +77,11 @@ LLIBS = \
$(DIST)\lib\plc3.lib \ $(DIST)\lib\plc3.lib \
$(LIBNSPR) \ $(LIBNSPR) \
$(DIST)\lib\js$(MOZ_BITS)$(VERSION_NUMBER).lib \ $(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\xpcom.lib \
$(DIST)\lib\xppref32.lib \ $(DIST)\lib\xppref32.lib \
$(DIST)\lib\xpcom.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 * 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 * Version 1.0 (the "NPL"); you may not use this file except in
@ -25,10 +25,8 @@
#include "nsIPref.h" #include "nsIPref.h"
#include "nsIURL.h" #include "nsIURL.h"
#ifdef NECKO #ifdef NECKO
#include "nsIIOService.h" #include "nsNeckoUtil.h"
#include "nsIURL.h" #include "nsCOMPtr.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO #endif // NECKO
#include "nsIParser.h" #include "nsIParser.h"
#include "nsParserCIID.h" #include "nsParserCIID.h"
@ -146,6 +144,15 @@ public:
virtual ~nsPICS(void); virtual ~nsPICS(void);
// nsIDocumentLoaderObserver // 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, NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsIURI* aURL,
const char* aCommand); const char* aCommand);
@ -167,6 +174,7 @@ public:
nsIURI* aURL, nsIURI* aURL,
const char *aContentType, const char *aContentType,
const char *aCommand ); const char *aCommand );
#endif
// NS_IMETHOD OnConnectionsComplete(); // NS_IMETHOD OnConnectionsComplete();
@ -758,10 +766,17 @@ nsPICS::OnStartDocumentLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsPICS::OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
PRInt32 aStatus,
nsIDocumentLoaderObserver* aObserver)
#else
nsPICS::OnEndDocumentLoad(nsIDocumentLoader* loader, nsPICS::OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsIURI* aURL,
PRInt32 aStatus, PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver) nsIDocumentLoaderObserver * aObserver)
#endif
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
@ -787,13 +802,26 @@ nsPICS::OnEndDocumentLoad(nsIDocumentLoader* loader,
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsPICS::OnStartURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
const char* aContentType,
nsIContentViewer* aViewer)
#else
nsPICS::OnStartURLLoad(nsIDocumentLoader* loader, nsPICS::OnStartURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsIURI* aURL,
const char* aContentType, const char* aContentType,
nsIContentViewer* aViewer) nsIContentViewer* aViewer)
#endif
{ {
nsresult rv; nsresult rv;
#ifdef NECKO
nsCOMPtr<nsIURI> aURL;
rv = channel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(rv)) return rv;
#endif
nsIContentViewerContainer *cont; nsIContentViewerContainer *cont;
if(!mPICSRatingsEnabled) if(!mPICSRatingsEnabled)
@ -856,10 +884,17 @@ nsPICS::OnStartURLLoad(nsIDocumentLoader* loader,
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsPICS::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
PRUint32 aProgress,
PRUint32 aProgressMax)
#else
nsPICS::OnProgressURLLoad(nsIDocumentLoader* loader, nsPICS::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsIURI* aURL,
PRUint32 aProgress, PRUint32 aProgress,
PRUint32 aProgressMax) PRUint32 aProgressMax)
#endif
{ {
if(!mPICSRatingsEnabled) if(!mPICSRatingsEnabled)
return NS_OK; return NS_OK;
@ -867,9 +902,15 @@ nsPICS::OnProgressURLLoad(nsIDocumentLoader* loader,
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsPICS::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
nsString& aMsg)
#else
nsPICS::OnStatusURLLoad(nsIDocumentLoader* loader, nsPICS::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsIURI* aURL,
nsString& aMsg) nsString& aMsg)
#endif
{ {
if(!mPICSRatingsEnabled) if(!mPICSRatingsEnabled)
return NS_OK; return NS_OK;
@ -877,15 +918,34 @@ nsPICS::OnStatusURLLoad(nsIDocumentLoader* loader,
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
PRInt32 aStatus)
#else
nsPICS::OnEndURLLoad(nsIDocumentLoader* loader, nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsIURI* aURL,
PRInt32 aStatus) PRInt32 aStatus)
#endif
{ {
nsIContentViewerContainer *cont;
nsresult rv; 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* uProtocol;
const char* uHost; const char* uHost;
const char* uFile; const char* uFile;
#endif
nsIURI* rootURL; nsIURI* rootURL;
nsIWebShellServices *ws; nsIWebShellServices *ws;
@ -923,29 +983,49 @@ nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
PICS_URLData* urlData = (PICS_URLData*)currentURLList->ElementAt(i); PICS_URLData* urlData = (PICS_URLData*)currentURLList->ElementAt(i);
if(urlData == nsnull) if(urlData == nsnull)
continue; continue;
#ifdef NECKO
char* spec1;
char* spec2;
#else
const char* spec1; const char* spec1;
const char* spec2; const char* spec2;
#endif
if(aURL == nsnull) if(aURL == nsnull)
continue; continue;
aURL->GetSpec(&spec1); aURL->GetSpec(&spec1);
if(urlData->url == nsnull)
continue;
(urlData->url)->GetSpec(&spec2);
if(spec1 == nsnull) if(spec1 == nsnull)
continue; continue;
if(spec2 == nsnull) if(urlData->url == nsnull) {
#ifdef NECKO
nsCRT::free(spec1);
#endif
continue; continue;
}
(urlData->url)->GetSpec(&spec2);
if(spec2 == nsnull) {
#ifdef NECKO
nsCRT::free(spec1);
#endif
continue;
}
if(0 == PL_strcmp(spec1, spec2)) { if(0 == PL_strcmp(spec1, spec2)) {
if(!urlData->notified) { if(!urlData->notified) {
currentURLList->RemoveElementAt(i); currentURLList->RemoveElementAt(i);
if (nsnull != aURL) { if (nsnull != aURL) {
#ifdef NECKO
aURL->GetScheme(&uProtocol);
aURL->GetHost(&uHost);
aURL->GetPath(&uFile);
#else
aURL->GetProtocol(&uProtocol); aURL->GetProtocol(&uProtocol);
aURL->GetHost(&uHost); aURL->GetHost(&uHost);
aURL->GetFile(&uFile); aURL->GetFile(&uFile);
#endif
if ((0 != PL_strcmp("/", uFile)) && (0 != PL_strcmp("/index.html", uFile))) { if ((0 != PL_strcmp("/", uFile)) && (0 != PL_strcmp("/index.html", uFile))) {
if (0 != PL_strcmp("file", uProtocol)) { if (0 != PL_strcmp("file", uProtocol)) {
nsAutoString protocolStr(uProtocol); nsAutoString protocolStr(uProtocol);
@ -957,24 +1037,23 @@ nsPICS::OnEndURLLoad(nsIDocumentLoader* loader,
#ifndef NECKO #ifndef NECKO
rv = NS_NewURL(&rootURL, rootStr); rv = NS_NewURL(&rootURL, rootStr);
#else #else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv); rv = NS_NewURI(&rootURL, rootStr);
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;
#endif // NECKO #endif // NECKO
// rv = GetRootURL(rootURL); // 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 NS_IMETHODIMP
#ifdef NECKO
nsPICS::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIChannel* channel,
const char *aContentType,
const char *aCommand )
#else
nsPICS::HandleUnknownContentType(nsIDocumentLoader* loader, nsPICS::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURI* aURL, nsIURI* aURL,
const char *aContentType, const char *aContentType,
const char *aCommand ) { const char *aCommand )
#endif
{
// If we have a doc loader observer, let it respond to this. // If we have a doc loader observer, let it respond to this.
// return mDocLoaderObserver ? mDocLoaderObserver->HandleUnknownContentType( mDocLoader, aURL, aContentType, aCommand ) // return mDocLoaderObserver ? mDocLoaderObserver->HandleUnknownContentType( mDocLoader, aURL, aContentType, aCommand )
//: NS_ERROR_FAILURE; //: NS_ERROR_FAILURE;
@ -1460,10 +1547,7 @@ nsPICS::GetRootURL(nsIURI* aURL)
return rv; return rv;
mParser->Parse(aURL); mParser->Parse(aURL);
#ifdef NECKO #ifdef NECKO
NS_WITH_SERVICE(nsIIOService, serv, kIOServiceCID, &rv); rv = NS_OpenURI(lsnr, aURL);
if (NS_SUCCEEDED(rv)) {
rv = serv->NewChannelFromURI("load", aURL, getter);
}
#else #else
rv = NS_OpenURL(aURL, lsnr); rv = NS_OpenURL(aURL, lsnr);
#endif #endif

Просмотреть файл

@ -194,7 +194,7 @@ NS_IMETHODIMP nsPICSElementObserver::Notify(PRUint32 aDocumentID,
if(ws) { if(ws) {
char * text = PR_GetEnv("NGLAYOUT_HOME"); char * text = PR_GetEnv("NGLAYOUT_HOME");
nsString mtemplateURL = text ? text : "resource:/res/samples/picstest1.html"; nsString mtemplateURL = text ? text : "resource:/res/samples/picstest1.html";
// ws->LoadURL(mtemplateURL, nsnull, nsnull); // ws->LoadURL(mtemplateURL, nsnull, nsnull);
nsCharsetSource s; nsCharsetSource s;
ws->SetRendering(PR_TRUE); ws->SetRendering(PR_TRUE);
ws->StopDocumentLoad(); ws->StopDocumentLoad();

Просмотреть файл

@ -20,7 +20,11 @@
#include "nsIAllocator.h" #include "nsIAllocator.h"
#include "plstr.h" #include "plstr.h"
#include "stdio.h" #include "stdio.h"
#ifdef NECKO
#include "nsIIOService.h"
#else
#include "nsINetService.h" #include "nsINetService.h"
#endif
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "nsIDOMWindow.h" #include "nsIDOMWindow.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
@ -29,8 +33,12 @@
#include "nsIScriptGlobalObject.h" #include "nsIScriptGlobalObject.h"
#include "nsICookieViewer.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(kINetServiceIID, NS_INETSERVICE_IID);
static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID); static NS_DEFINE_IID(kNetServiceCID, NS_NETSERVICE_CID);
#endif
class CookieViewerImpl : public nsICookieViewer class CookieViewerImpl : public nsICookieViewer
{ {
@ -85,8 +93,14 @@ CookieViewerImpl::GetCookieValue(char** aValue)
return NS_ERROR_NULL_POINTER; return NS_ERROR_NULL_POINTER;
} }
nsINetService *netservice;
nsresult res; 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, res = nsServiceManager::GetService(kNetServiceCID,
kINetServiceIID, kINetServiceIID,
(nsISupports **)&netservice); (nsISupports **)&netservice);
@ -97,6 +111,7 @@ CookieViewerImpl::GetCookieValue(char** aValue)
*aValue = cookieList.ToNewCString(); *aValue = cookieList.ToNewCString();
} }
} }
#endif
return res; return res;
} }
@ -108,8 +123,14 @@ CookieViewerImpl::GetPermissionValue(char** aValue)
return NS_ERROR_NULL_POINTER; return NS_ERROR_NULL_POINTER;
} }
nsINetService *netservice;
nsresult res; 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, res = nsServiceManager::GetService(kNetServiceCID,
kINetServiceIID, kINetServiceIID,
(nsISupports **)&netservice); (nsISupports **)&netservice);
@ -120,6 +141,7 @@ CookieViewerImpl::GetPermissionValue(char** aValue)
*aValue = PermissionList.ToNewCString(); *aValue = PermissionList.ToNewCString();
} }
} }
#endif
return res; return res;
} }
@ -169,8 +191,14 @@ CookieViewerImpl::SetValue(const char* aValue, nsIDOMWindow* win)
if (! aValue) { if (! aValue) {
return NS_ERROR_NULL_POINTER; return NS_ERROR_NULL_POINTER;
} }
nsINetService *netservice;
nsresult res; 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, res = nsServiceManager::GetService(kNetServiceCID,
kINetServiceIID, kINetServiceIID,
(nsISupports **)&netservice); (nsISupports **)&netservice);
@ -178,5 +206,6 @@ CookieViewerImpl::SetValue(const char* aValue, nsIDOMWindow* win)
nsAutoString netList = aValue; nsAutoString netList = aValue;
res = netservice->Cookie_CookieViewerReturn(netList); res = netservice->Cookie_CookieViewerReturn(netList);
} }
#endif
return res; return res;
} }

Просмотреть файл

@ -44,7 +44,9 @@ LLIBS=$(LLIBS) $(LIBNSPR) \
$(DIST)\lib\xppref32.lib \ $(DIST)\lib\xppref32.lib \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
$(DIST)\lib\xplib.lib \ $(DIST)\lib\xplib.lib \
$(DIST)\lib\netlib.lib \ !ifndef NECKO
$(DIST)\lib\netlib.lib \
!endif
$(NULL) $(NULL)
LINCS= \ LINCS= \
@ -52,7 +54,6 @@ LINCS= \
-I$(PUBLIC)\xpcom \ -I$(PUBLIC)\xpcom \
-I$(PUBLIC)\dom \ -I$(PUBLIC)\dom \
-I$(PUBLIC)\js \ -I$(PUBLIC)\js \
-I$(PUBLIC)\netlib \
-I$(PUBLIC)\security\ -I$(PUBLIC)\security\
-I$(PUBLIC)\pref \ -I$(PUBLIC)\pref \
-I$(PUBLIC)\wallet \ -I$(PUBLIC)\wallet \

Просмотреть файл

@ -1593,12 +1593,27 @@ wallet_InitializeCurrentURL(nsIDocument * doc) {
} }
/* get host+file */ /* get host+file */
#ifdef NECKO
char* host;
#else
const char* host; const char* host;
#endif
url->GetHost(&host); url->GetHost(&host);
nsAutoString urlName = nsAutoString(host); nsAutoString urlName = nsAutoString(host);
#ifdef NECKO
nsCRT::free(host);
#endif
#ifdef NECKO
char* file;
url->GetPath(&file);
#else
const char* file; const char* file;
url->GetFile(&file); url->GetFile(&file);
#endif
urlName = urlName + file; urlName = urlName + file;
#ifdef NECKO
nsCRT::free(file);
#endif
NS_RELEASE(url); NS_RELEASE(url);
/* get field/schema mapping specific to current url */ /* get field/schema mapping specific to current url */

Просмотреть файл

@ -61,11 +61,7 @@ public:
* Initialize an image group with a device context. All images * Initialize an image group with a device context. All images
* in this group will be decoded for the specified device context. * 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; virtual nsresult Init(nsIDeviceContext *aDeviceContext, nsILoadGroup* aLoadGroup) = 0;
#endif
/** /**
* Add an observers to be informed of image group notifications. * Add an observers to be informed of image group notifications.

Просмотреть файл

@ -853,7 +853,11 @@ char *str;
if (gImageGroup == NULL) if (gImageGroup == NULL)
{ {
nsIDeviceContext *deviceCtx = gWindow->GetDeviceContext(); 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) if (NS_NewImageGroup(&gImageGroup) != NS_OK || gImageGroup->Init(deviceCtx, nsnull) != NS_OK)
#endif
{ {
::MessageBox(NULL, "Couldn't create image group",class1Name, MB_OK); ::MessageBox(NULL, "Couldn't create image group",class1Name, MB_OK);
NS_RELEASE(deviceCtx); NS_RELEASE(deviceCtx);

Просмотреть файл

@ -68,7 +68,12 @@ LCFLAGS = \
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\dom \ 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)\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 # These are the libraries we need to link with to create the dll
LLIBS= \ LLIBS= \
@ -88,7 +93,11 @@ LLIBS= \
$(DIST)\lib\raptorgfxwin.lib \ $(DIST)\lib\raptorgfxwin.lib \
$(DIST)\lib\raptorhtmlpars.lib \ $(DIST)\lib\raptorhtmlpars.lib \
$(DIST)\lib\jsdom.lib \ $(DIST)\lib\jsdom.lib \
!ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(DIST)\lib\plc3.lib \ $(DIST)\lib\plc3.lib \
$(DIST)\lib\js32$(VERSION_NUMBER).lib \ $(DIST)\lib\js32$(VERSION_NUMBER).lib \
!if defined(MOZ_DEBUG) && defined(GLOWCODE) && "$(MOZ_BITS)"=="32" !if defined(MOZ_DEBUG) && defined(GLOWCODE) && "$(MOZ_BITS)"=="32"

Просмотреть файл

@ -36,7 +36,11 @@ LINCS= \
-I$(PUBLIC)\raptor \ -I$(PUBLIC)\raptor \
-I$(PUBLIC)\dom \ -I$(PUBLIC)\dom \
-I$(PUBLIC)\js \ -I$(PUBLIC)\js \
!ifdef NECKO
-I$(PUBLIC)\necko \
!else
-I$(PUBLIC)\netlib \ -I$(PUBLIC)\netlib \
!endif
-I..\base\src \ -I..\base\src \
-I..\style\src \ -I..\style\src \
-I..\..\css\layout\src \ -I..\..\css\layout\src \
@ -57,7 +61,11 @@ LLIBS= \
$(DIST)\lib\util.lib \ $(DIST)\lib\util.lib \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
$(DIST)\lib\jsdom.lib \ $(DIST)\lib\jsdom.lib \
!ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(LIBNSPR) \ $(LIBNSPR) \
$(DIST)\lib\plc3.lib \ $(DIST)\lib\plc3.lib \
$(DIST)\lib\js32$(VERSION_NUMBER).lib $(DIST)\lib\js32$(VERSION_NUMBER).lib

Просмотреть файл

@ -61,9 +61,6 @@ DIRS = \
lib\libpwcac \ lib\libpwcac \
!if !defined(NECKO) !if !defined(NECKO)
network \ network \
!endif
!if defined(NECKO)
netwerk \
!endif !endif
profile \ profile \
!endif !endif
@ -72,6 +69,9 @@ DIRS = \
expat \ expat \
htmlparser \ htmlparser \
gfx \ gfx \
!if defined(NECKO)
netwerk \
!endif
widget \ widget \
dom \ dom \
view \ view \

Просмотреть файл

@ -47,7 +47,11 @@ LINCS = \
-I$(PUBLIC)\xpcom \ -I$(PUBLIC)\xpcom \
-I$(PUBLIC)\plugin \ -I$(PUBLIC)\plugin \
-I$(PUBLIC)\java \ -I$(PUBLIC)\java \
!ifdef NECKO
-I$(PUBLIC)\necko \
!else
-I$(PUBLIC)\netlib \ -I$(PUBLIC)\netlib \
!endif
-I$(PUBLIC)\oji \ -I$(PUBLIC)\oji \
-I$(PUBLIC)\cache \ -I$(PUBLIC)\cache \
-I$(PUBLIC)\pref \ -I$(PUBLIC)\pref \
@ -69,8 +73,12 @@ CACHELIBNAME=netcache.lib
OURLIBS = \ OURLIBS = \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
$(DIST)\lib\plc3.lib \ $(DIST)\lib\plc3.lib \
!ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
$(DIST)\lib\$(CACHELIBNAME) \ $(DIST)\lib\$(CACHELIBNAME) \
!endif
$(DIST)\lib\xppref32.lib \ $(DIST)\lib\xppref32.lib \
$(DIST)\lib\dbm32.lib \ $(DIST)\lib\dbm32.lib \
$(LIBNSPR) $(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 * 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 * Version 1.0 (the "NPL"); you may not use this file except in
@ -37,6 +37,7 @@
#include "nsIURL.h" #include "nsIURL.h"
#include "nsIChannel.h" #include "nsIChannel.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsNeckoUtil.h"
#endif // NECKO #endif // NECKO
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
@ -101,7 +102,7 @@ nsPluginTag::nsPluginTag()
mLibrary = nsnull; mLibrary = nsnull;
mEntryPoint = nsnull; mEntryPoint = nsnull;
mFlags = NS_PLUGIN_FLAG_ENABLED; mFlags = NS_PLUGIN_FLAG_ENABLED;
mFileName = nsnull; mFileName = nsnull;
} }
inline char* new_str(char* str) inline char* new_str(char* str)
@ -134,7 +135,7 @@ nsPluginTag::nsPluginTag(nsPluginTag* aPluginTag)
mLibrary = nsnull; mLibrary = nsnull;
mEntryPoint = nsnull; mEntryPoint = nsnull;
mFlags = NS_PLUGIN_FLAG_ENABLED; mFlags = NS_PLUGIN_FLAG_ENABLED;
mFileName = new_str(aPluginTag->mFileName); mFileName = new_str(aPluginTag->mFileName);
} }
nsPluginTag::~nsPluginTag() nsPluginTag::~nsPluginTag()
@ -393,8 +394,8 @@ public:
// nsIStreamObserver methods: // nsIStreamObserver methods:
NS_IMETHOD OnStartBinding(nsISupports *ctxt); NS_IMETHOD OnStartBinding(nsISupports *ctxt);
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg); 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); NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg) { return NS_OK; }
// nsIStreamListener methods: // nsIStreamListener methods:
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, PRUint32 sourceOffset, PRUint32 count); NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
@ -477,13 +478,14 @@ public:
NS_IMETHOD OnProgress(nsISupports* context, PRUint32 progress, NS_IMETHOD OnProgress(nsISupports* context, PRUint32 progress,
PRUint32 maxProgress); PRUint32 maxProgress);
NS_IMETHOD OnStatus(nsISupports* context, const PRUnichar* aMsg); NS_IMETHOD OnStatus(nsISupports* context, const PRUnichar* aMsg);
// nsIStreamObserver methods: // nsIStreamObserver methods:
NS_IMETHOD OnStartBinding(nsISupports *ctxt); NS_IMETHOD OnStartBinding(nsISupports *ctxt);
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status, NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status,
const PRUnichar *errorMsg); const PRUnichar *errorMsg);
NS_IMETHOD OnStartRequest(nsISupports *ctxt); NS_IMETHOD OnStartRequest(nsISupports *ctxt) { return NS_OK; }
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status,
const PRUnichar *errorMsg); const PRUnichar *errorMsg) { return NS_OK; }
// nsIStreamListener methods: // nsIStreamListener methods:
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr,
@ -783,7 +785,11 @@ nsPluginStreamListenerPeer::~nsPluginStreamListenerPeer()
#ifdef NS_DEBUG #ifdef NS_DEBUG
if(mURL != nsnull) if(mURL != nsnull)
{ {
#ifdef NECKO
char* spec;
#else
const char* spec; const char* spec;
#endif
(void)mURL->GetSpec(&spec); (void)mURL->GetSpec(&spec);
printf("killing stream for %s\n", mURL ? spec : "(unknown URL)"); printf("killing stream for %s\n", mURL ? spec : "(unknown URL)");
#ifdef NECKO #ifdef NECKO
@ -840,9 +846,16 @@ nsresult nsPluginStreamListenerPeer::Initialize(nsIURI *aURL, nsIPluginInstance
nsIPluginStreamListener* aListener) nsIPluginStreamListener* aListener)
{ {
#ifdef NS_DEBUG #ifdef NS_DEBUG
#ifdef NECKO
char* spec;
#else
const char* spec; const char* spec;
#endif
(void)aURL->GetSpec(&spec); (void)aURL->GetSpec(&spec);
printf("created stream for %s\n", spec); printf("created stream for %s\n", spec);
#ifdef NECKO
nsCRT::free(spec);
#endif
#endif #endif
mURL = aURL; mURL = aURL;
@ -870,9 +883,16 @@ nsresult nsPluginStreamListenerPeer::InitializeEmbeded(nsIURI *aURL, nsIPluginIn
nsIPluginHost *aHost) nsIPluginHost *aHost)
{ {
#ifdef NS_DEBUG #ifdef NS_DEBUG
#ifdef NECKO
char* spec;
#else
const char* spec; const char* spec;
#endif
(void)aURL->GetSpec(&spec); (void)aURL->GetSpec(&spec);
printf("created stream for %s\n", spec); printf("created stream for %s\n", spec);
#ifdef NECKO
nsCRT::free(spec);
#endif
#endif #endif
mURL = aURL; mURL = aURL;
@ -924,14 +944,14 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartBinding(nsIURI* aURL, const cha
#ifdef NECKO #ifdef NECKO
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aContext)); nsCOMPtr<nsIChannel> channel(do_QueryInterface(aContext));
if (channel) if (channel == nsnull) return NS_ERROR_FAILURE;
{
char* aContentType = nsnull; char* aContentType = nsnull;
rv = channel->GetContentType(&aContentType); rv = channel->GetContentType(&aContentType);
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIURI> aURL; nsCOMPtr<nsIURI> aURL;
rv = channel->GetURI(getter_AddRefs(aURL)); rv = channel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
#endif #endif
if (nsnull != aContentType) if (nsnull != aContentType)
@ -975,8 +995,7 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartBinding(nsIURI* aURL, const cha
mOnStartBinding = PR_TRUE; mOnStartBinding = PR_TRUE;
#ifdef NECKO #ifdef NECKO
nsCRT::free(aContentType); nsCRT::free(aContentType);
}
#endif //NECKO #endif //NECKO
return rv; return rv;
} }
@ -1044,21 +1063,31 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInput
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
#ifdef NECKO #ifdef NECKO
nsCOMPtr<nsIChannel> channel (do_QueryInterface(aContext)); nsCOMPtr<nsIChannel> channel (do_QueryInterface(aContext));
if (channel) if (channel == nsnull) return NS_ERROR_FAILURE;
{
nsCOMPtr<nsIURI> aURL; nsCOMPtr<nsIURI> aURL;
rv = channel->GetURI(getter_AddRefs(aURL)); rv = channel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
#endif
char* url;
#else
const char* url; const char* url;
#endif
if(!mPStreamListener) if(!mPStreamListener)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
#ifdef NECKO
char* urlString;
#else
const char* urlString; const char* urlString;
#endif
aURL->GetSpec(&urlString); aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString); mPluginStreamInfo->SetURL(urlString);
#ifdef NECKO
nsCRT::free(urlString);
#endif
// if the plugin has requested an AsFileOnly stream, then don't call OnDataAvailable // if the plugin has requested an AsFileOnly stream, then don't call OnDataAvailable
if(mStreamType != nsPluginStreamType_AsFileOnly) if(mStreamType != nsPluginStreamType_AsFileOnly)
@ -1074,10 +1103,6 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInput
rv = aIStream->Read(buffer, aLength, &amountRead); rv = aIStream->Read(buffer, aLength, &amountRead);
delete [] buffer; delete [] buffer;
} }
#ifdef NECKO
nsCRT::free(urlString);
}
#endif
return rv; return rv;
} }
@ -1103,12 +1128,16 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopBinding(nsIURI* aURL, nsresult a
if(nsnull != mPStreamListener) if(nsnull != mPStreamListener)
{ {
const char* url; #ifdef NECKO
aURL->GetSpec(&url); char* urlString;
#else
const char* urlString; const char* urlString;
#endif
aURL->GetSpec(&urlString); aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString); mPluginStreamInfo->SetURL(urlString);
#ifdef NECKO
nsCRT::free(urlString);
#endif
// tell the plugin that the stream has ended only if the cache is done // tell the plugin that the stream has ended only if the cache is done
if(mCacheDone) if(mCacheDone)
@ -1131,7 +1160,11 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopBinding(nsIURI* aURL, nsresult a
nsresult nsPluginStreamListenerPeer::SetUpCache(nsIURI* aURL) nsresult nsPluginStreamListenerPeer::SetUpCache(nsIURI* aURL)
{ {
nsPluginCacheListener* cacheListener = new nsPluginCacheListener(this); nsPluginCacheListener* cacheListener = new nsPluginCacheListener(this);
#ifdef NECKO
return NS_OpenURI(cacheListener, aURL);
#else
return NS_OpenURL(aURL, cacheListener); return NS_OpenURL(aURL, cacheListener);
#endif
} }
nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIURI* aURL) nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIURI* aURL)
@ -1155,9 +1188,16 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIURI* aURL)
mPluginStreamInfo->SetSeekable(PR_FALSE); mPluginStreamInfo->SetSeekable(PR_FALSE);
//mPluginStreamInfo->SetModified(??); //mPluginStreamInfo->SetModified(??);
#ifdef NECKO
char* urlString;
aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString);
nsCRT::free(urlString);
#else
const char* urlString; const char* urlString;
aURL->GetSpec(&urlString); aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString); mPluginStreamInfo->SetURL(urlString);
#endif
rv = mPStreamListener->OnStartBinding((nsIPluginStreamInfo*)mPluginStreamInfo); rv = mPStreamListener->OnStartBinding((nsIPluginStreamInfo*)mPluginStreamInfo);
@ -1624,17 +1664,7 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
#ifndef NECKO #ifndef NECKO
rv = NS_NewURL(&url, aURLSpec); rv = NS_NewURL(&url, aURLSpec);
#else #else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv); rv = NS_NewURI(&url, aURLSpec);
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;
#endif // NECKO #endif // NECKO
if (rv != NS_OK) if (rv != NS_OK)
@ -1681,7 +1711,11 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
nsresult nsPluginHostImpl::FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstanceOwner *aOwner) nsresult nsPluginHostImpl::FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstanceOwner *aOwner)
{ {
PRUint32 i; PRUint32 i;
#ifdef NECKO
char* url;
#else
const char* url; const char* url;
#endif
if(!aURL) if(!aURL)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@ -1706,16 +1740,25 @@ nsresult nsPluginHostImpl::FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstan
instance->SetWindow(window); instance->SetWindow(window);
mActivePluginList[i].mStopped = PR_FALSE; mActivePluginList[i].mStopped = PR_FALSE;
#ifdef NECKO
nsCRT::free(url);
#endif
return NS_OK; return NS_OK;
} }
} }
#ifdef NECKO
nsCRT::free(url);
#endif
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
void nsPluginHostImpl::AddInstanceToActiveList(nsIPluginInstance* aInstance, nsIURI* aURL) void nsPluginHostImpl::AddInstanceToActiveList(nsIPluginInstance* aInstance, nsIURI* aURL)
{ {
#ifdef NECKO
char* url;
#else
const char* url; const char* url;
#endif
if(!aURL) if(!aURL)
return; return;
@ -1750,8 +1793,10 @@ void nsPluginHostImpl::AddInstanceToActiveList(nsIPluginInstance* aInstance, nsI
++mOldestActivePlugin; ++mOldestActivePlugin;
if(mOldestActivePlugin == MAX_ACTIVE_PLUGINS) if(mOldestActivePlugin == MAX_ACTIVE_PLUGINS)
mOldestActivePlugin = 0; mOldestActivePlugin = 0;
} }
#ifdef NECKO
nsCRT::free(url);
#endif
} }
NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType, 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 don't have a mimetype, check by file extension
if(!aMimeType) if(!aMimeType)
{ {
const char* filename;
char* extension; char* extension;
#ifdef NECKO #ifdef NECKO
char* filename;
aURL->GetPath(&filename); aURL->GetPath(&filename);
#else #else
const char* filename;
aURL->GetFile(&filename); aURL->GetFile(&filename);
#endif #endif
extension = PL_strrchr(filename, '.'); extension = PL_strrchr(filename, '.');
@ -1786,7 +1832,7 @@ NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType,
if(IsPluginEnabledForExtension(extension, mimetype) != NS_OK) if(IsPluginEnabledForExtension(extension, mimetype) != NS_OK)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
#ifdef NECKO #ifdef NECKO
nsCRT::free(filename); nsCRT::free(filename);
#endif #endif
} }
else else
@ -2174,7 +2220,7 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
nsIPluginInstance *aInstance, nsIPluginInstance *aInstance,
nsIPluginStreamListener* aListener) nsIPluginStreamListener* aListener)
{ {
nsIURI *url; nsIURI *url;
nsPluginStreamListenerPeer *listenerPeer = (nsPluginStreamListenerPeer *)new nsPluginStreamListenerPeer(); nsPluginStreamListenerPeer *listenerPeer = (nsPluginStreamListenerPeer *)new nsPluginStreamListenerPeer();
if (listenerPeer == NULL) if (listenerPeer == NULL)
return NS_ERROR_OUT_OF_MEMORY; return NS_ERROR_OUT_OF_MEMORY;
@ -2186,17 +2232,7 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
#ifndef NECKO #ifndef NECKO
rv = NS_NewURL(&url, aURL); rv = NS_NewURL(&url, aURL);
#else #else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv); rv = NS_NewURI(&url, aURL);
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;
#endif // NECKO #endif // NECKO
if (NS_OK == rv) if (NS_OK == rv)
@ -2204,7 +2240,11 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
rv = listenerPeer->Initialize(url, aInstance, aListener); rv = listenerPeer->Initialize(url, aInstance, aListener);
if (NS_OK == rv) { if (NS_OK == rv) {
#ifdef NECKO
rv = NS_OpenURI(listenerPeer, url);
#else
rv = NS_OpenURL(url, listenerPeer); rv = NS_OpenURL(url, listenerPeer);
#endif
} }
NS_RELEASE(url); NS_RELEASE(url);
@ -2254,7 +2294,11 @@ nsresult nsPluginHostImpl::NewEmbededPluginStream(nsIURI* aURL,
rv = NS_ERROR_ILLEGAL_VALUE; rv = NS_ERROR_ILLEGAL_VALUE;
if (NS_OK == rv) { if (NS_OK == rv) {
#ifdef NECKO
rv = NS_OpenURI(listener, aURL);
#else
rv = NS_OpenURL(aURL, listener); rv = NS_OpenURL(aURL, listener);
#endif
} }
//NS_RELEASE(aURL); //NS_RELEASE(aURL);

Просмотреть файл

@ -47,7 +47,11 @@ LINCS = \
-I$(PUBLIC)\xpcom \ -I$(PUBLIC)\xpcom \
-I$(PUBLIC)\plugin \ -I$(PUBLIC)\plugin \
-I$(PUBLIC)\java \ -I$(PUBLIC)\java \
!ifdef NECKO
-I$(PUBLIC)\necko \
!else
-I$(PUBLIC)\netlib \ -I$(PUBLIC)\netlib \
!endif
-I$(PUBLIC)\oji \ -I$(PUBLIC)\oji \
-I$(PUBLIC)\cache \ -I$(PUBLIC)\cache \
-I$(PUBLIC)\pref \ -I$(PUBLIC)\pref \
@ -69,8 +73,12 @@ CACHELIBNAME=netcache.lib
OURLIBS = \ OURLIBS = \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
$(DIST)\lib\plc3.lib \ $(DIST)\lib\plc3.lib \
!ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
$(DIST)\lib\$(CACHELIBNAME) \ $(DIST)\lib\$(CACHELIBNAME) \
!endif
$(DIST)\lib\xppref32.lib \ $(DIST)\lib\xppref32.lib \
$(DIST)\lib\dbm32.lib \ $(DIST)\lib\dbm32.lib \
$(LIBNSPR) $(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 * 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 * Version 1.0 (the "NPL"); you may not use this file except in
@ -37,6 +37,7 @@
#include "nsIURL.h" #include "nsIURL.h"
#include "nsIChannel.h" #include "nsIChannel.h"
#include "nsCOMPtr.h" #include "nsCOMPtr.h"
#include "nsNeckoUtil.h"
#endif // NECKO #endif // NECKO
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
@ -101,7 +102,7 @@ nsPluginTag::nsPluginTag()
mLibrary = nsnull; mLibrary = nsnull;
mEntryPoint = nsnull; mEntryPoint = nsnull;
mFlags = NS_PLUGIN_FLAG_ENABLED; mFlags = NS_PLUGIN_FLAG_ENABLED;
mFileName = nsnull; mFileName = nsnull;
} }
inline char* new_str(char* str) inline char* new_str(char* str)
@ -134,7 +135,7 @@ nsPluginTag::nsPluginTag(nsPluginTag* aPluginTag)
mLibrary = nsnull; mLibrary = nsnull;
mEntryPoint = nsnull; mEntryPoint = nsnull;
mFlags = NS_PLUGIN_FLAG_ENABLED; mFlags = NS_PLUGIN_FLAG_ENABLED;
mFileName = new_str(aPluginTag->mFileName); mFileName = new_str(aPluginTag->mFileName);
} }
nsPluginTag::~nsPluginTag() nsPluginTag::~nsPluginTag()
@ -393,8 +394,8 @@ public:
// nsIStreamObserver methods: // nsIStreamObserver methods:
NS_IMETHOD OnStartBinding(nsISupports *ctxt); NS_IMETHOD OnStartBinding(nsISupports *ctxt);
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg); 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); NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg) { return NS_OK; }
// nsIStreamListener methods: // nsIStreamListener methods:
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, PRUint32 sourceOffset, PRUint32 count); NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
@ -477,13 +478,14 @@ public:
NS_IMETHOD OnProgress(nsISupports* context, PRUint32 progress, NS_IMETHOD OnProgress(nsISupports* context, PRUint32 progress,
PRUint32 maxProgress); PRUint32 maxProgress);
NS_IMETHOD OnStatus(nsISupports* context, const PRUnichar* aMsg); NS_IMETHOD OnStatus(nsISupports* context, const PRUnichar* aMsg);
// nsIStreamObserver methods: // nsIStreamObserver methods:
NS_IMETHOD OnStartBinding(nsISupports *ctxt); NS_IMETHOD OnStartBinding(nsISupports *ctxt);
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status, NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status,
const PRUnichar *errorMsg); const PRUnichar *errorMsg);
NS_IMETHOD OnStartRequest(nsISupports *ctxt); NS_IMETHOD OnStartRequest(nsISupports *ctxt) { return NS_OK; }
NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status,
const PRUnichar *errorMsg); const PRUnichar *errorMsg) { return NS_OK; }
// nsIStreamListener methods: // nsIStreamListener methods:
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr,
@ -783,7 +785,11 @@ nsPluginStreamListenerPeer::~nsPluginStreamListenerPeer()
#ifdef NS_DEBUG #ifdef NS_DEBUG
if(mURL != nsnull) if(mURL != nsnull)
{ {
#ifdef NECKO
char* spec;
#else
const char* spec; const char* spec;
#endif
(void)mURL->GetSpec(&spec); (void)mURL->GetSpec(&spec);
printf("killing stream for %s\n", mURL ? spec : "(unknown URL)"); printf("killing stream for %s\n", mURL ? spec : "(unknown URL)");
#ifdef NECKO #ifdef NECKO
@ -840,9 +846,16 @@ nsresult nsPluginStreamListenerPeer::Initialize(nsIURI *aURL, nsIPluginInstance
nsIPluginStreamListener* aListener) nsIPluginStreamListener* aListener)
{ {
#ifdef NS_DEBUG #ifdef NS_DEBUG
#ifdef NECKO
char* spec;
#else
const char* spec; const char* spec;
#endif
(void)aURL->GetSpec(&spec); (void)aURL->GetSpec(&spec);
printf("created stream for %s\n", spec); printf("created stream for %s\n", spec);
#ifdef NECKO
nsCRT::free(spec);
#endif
#endif #endif
mURL = aURL; mURL = aURL;
@ -870,9 +883,16 @@ nsresult nsPluginStreamListenerPeer::InitializeEmbeded(nsIURI *aURL, nsIPluginIn
nsIPluginHost *aHost) nsIPluginHost *aHost)
{ {
#ifdef NS_DEBUG #ifdef NS_DEBUG
#ifdef NECKO
char* spec;
#else
const char* spec; const char* spec;
#endif
(void)aURL->GetSpec(&spec); (void)aURL->GetSpec(&spec);
printf("created stream for %s\n", spec); printf("created stream for %s\n", spec);
#ifdef NECKO
nsCRT::free(spec);
#endif
#endif #endif
mURL = aURL; mURL = aURL;
@ -924,14 +944,14 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartBinding(nsIURI* aURL, const cha
#ifdef NECKO #ifdef NECKO
nsCOMPtr<nsIChannel> channel(do_QueryInterface(aContext)); nsCOMPtr<nsIChannel> channel(do_QueryInterface(aContext));
if (channel) if (channel == nsnull) return NS_ERROR_FAILURE;
{
char* aContentType = nsnull; char* aContentType = nsnull;
rv = channel->GetContentType(&aContentType); rv = channel->GetContentType(&aContentType);
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsIURI> aURL; nsCOMPtr<nsIURI> aURL;
rv = channel->GetURI(getter_AddRefs(aURL)); rv = channel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
#endif #endif
if (nsnull != aContentType) if (nsnull != aContentType)
@ -975,8 +995,7 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStartBinding(nsIURI* aURL, const cha
mOnStartBinding = PR_TRUE; mOnStartBinding = PR_TRUE;
#ifdef NECKO #ifdef NECKO
nsCRT::free(aContentType); nsCRT::free(aContentType);
}
#endif //NECKO #endif //NECKO
return rv; return rv;
} }
@ -1044,21 +1063,31 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInput
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
#ifdef NECKO #ifdef NECKO
nsCOMPtr<nsIChannel> channel (do_QueryInterface(aContext)); nsCOMPtr<nsIChannel> channel (do_QueryInterface(aContext));
if (channel) if (channel == nsnull) return NS_ERROR_FAILURE;
{
nsCOMPtr<nsIURI> aURL; nsCOMPtr<nsIURI> aURL;
rv = channel->GetURI(getter_AddRefs(aURL)); rv = channel->GetURI(getter_AddRefs(aURL));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
#endif
char* url;
#else
const char* url; const char* url;
#endif
if(!mPStreamListener) if(!mPStreamListener)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
#ifdef NECKO
char* urlString;
#else
const char* urlString; const char* urlString;
#endif
aURL->GetSpec(&urlString); aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString); mPluginStreamInfo->SetURL(urlString);
#ifdef NECKO
nsCRT::free(urlString);
#endif
// if the plugin has requested an AsFileOnly stream, then don't call OnDataAvailable // if the plugin has requested an AsFileOnly stream, then don't call OnDataAvailable
if(mStreamType != nsPluginStreamType_AsFileOnly) if(mStreamType != nsPluginStreamType_AsFileOnly)
@ -1074,10 +1103,6 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnDataAvailable(nsIURI* aURL, nsIInput
rv = aIStream->Read(buffer, aLength, &amountRead); rv = aIStream->Read(buffer, aLength, &amountRead);
delete [] buffer; delete [] buffer;
} }
#ifdef NECKO
nsCRT::free(urlString);
}
#endif
return rv; return rv;
} }
@ -1103,12 +1128,16 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopBinding(nsIURI* aURL, nsresult a
if(nsnull != mPStreamListener) if(nsnull != mPStreamListener)
{ {
const char* url; #ifdef NECKO
aURL->GetSpec(&url); char* urlString;
#else
const char* urlString; const char* urlString;
#endif
aURL->GetSpec(&urlString); aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString); mPluginStreamInfo->SetURL(urlString);
#ifdef NECKO
nsCRT::free(urlString);
#endif
// tell the plugin that the stream has ended only if the cache is done // tell the plugin that the stream has ended only if the cache is done
if(mCacheDone) if(mCacheDone)
@ -1131,7 +1160,11 @@ NS_IMETHODIMP nsPluginStreamListenerPeer::OnStopBinding(nsIURI* aURL, nsresult a
nsresult nsPluginStreamListenerPeer::SetUpCache(nsIURI* aURL) nsresult nsPluginStreamListenerPeer::SetUpCache(nsIURI* aURL)
{ {
nsPluginCacheListener* cacheListener = new nsPluginCacheListener(this); nsPluginCacheListener* cacheListener = new nsPluginCacheListener(this);
#ifdef NECKO
return NS_OpenURI(cacheListener, aURL);
#else
return NS_OpenURL(aURL, cacheListener); return NS_OpenURL(aURL, cacheListener);
#endif
} }
nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIURI* aURL) nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIURI* aURL)
@ -1155,9 +1188,16 @@ nsresult nsPluginStreamListenerPeer::SetUpStreamListener(nsIURI* aURL)
mPluginStreamInfo->SetSeekable(PR_FALSE); mPluginStreamInfo->SetSeekable(PR_FALSE);
//mPluginStreamInfo->SetModified(??); //mPluginStreamInfo->SetModified(??);
#ifdef NECKO
char* urlString;
aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString);
nsCRT::free(urlString);
#else
const char* urlString; const char* urlString;
aURL->GetSpec(&urlString); aURL->GetSpec(&urlString);
mPluginStreamInfo->SetURL(urlString); mPluginStreamInfo->SetURL(urlString);
#endif
rv = mPStreamListener->OnStartBinding((nsIPluginStreamInfo*)mPluginStreamInfo); rv = mPStreamListener->OnStartBinding((nsIPluginStreamInfo*)mPluginStreamInfo);
@ -1624,17 +1664,7 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
#ifndef NECKO #ifndef NECKO
rv = NS_NewURL(&url, aURLSpec); rv = NS_NewURL(&url, aURLSpec);
#else #else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv); rv = NS_NewURI(&url, aURLSpec);
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;
#endif // NECKO #endif // NECKO
if (rv != NS_OK) if (rv != NS_OK)
@ -1681,7 +1711,11 @@ NS_IMETHODIMP nsPluginHostImpl::InstantiateFullPagePlugin(const char *aMimeType,
nsresult nsPluginHostImpl::FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstanceOwner *aOwner) nsresult nsPluginHostImpl::FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstanceOwner *aOwner)
{ {
PRUint32 i; PRUint32 i;
#ifdef NECKO
char* url;
#else
const char* url; const char* url;
#endif
if(!aURL) if(!aURL)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
@ -1706,16 +1740,25 @@ nsresult nsPluginHostImpl::FindStoppedPluginForURL(nsIURI* aURL, nsIPluginInstan
instance->SetWindow(window); instance->SetWindow(window);
mActivePluginList[i].mStopped = PR_FALSE; mActivePluginList[i].mStopped = PR_FALSE;
#ifdef NECKO
nsCRT::free(url);
#endif
return NS_OK; return NS_OK;
} }
} }
#ifdef NECKO
nsCRT::free(url);
#endif
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
} }
void nsPluginHostImpl::AddInstanceToActiveList(nsIPluginInstance* aInstance, nsIURI* aURL) void nsPluginHostImpl::AddInstanceToActiveList(nsIPluginInstance* aInstance, nsIURI* aURL)
{ {
#ifdef NECKO
char* url;
#else
const char* url; const char* url;
#endif
if(!aURL) if(!aURL)
return; return;
@ -1750,8 +1793,10 @@ void nsPluginHostImpl::AddInstanceToActiveList(nsIPluginInstance* aInstance, nsI
++mOldestActivePlugin; ++mOldestActivePlugin;
if(mOldestActivePlugin == MAX_ACTIVE_PLUGINS) if(mOldestActivePlugin == MAX_ACTIVE_PLUGINS)
mOldestActivePlugin = 0; mOldestActivePlugin = 0;
} }
#ifdef NECKO
nsCRT::free(url);
#endif
} }
NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType, 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 don't have a mimetype, check by file extension
if(!aMimeType) if(!aMimeType)
{ {
const char* filename;
char* extension; char* extension;
#ifdef NECKO #ifdef NECKO
char* filename;
aURL->GetPath(&filename); aURL->GetPath(&filename);
#else #else
const char* filename;
aURL->GetFile(&filename); aURL->GetFile(&filename);
#endif #endif
extension = PL_strrchr(filename, '.'); extension = PL_strrchr(filename, '.');
@ -1786,7 +1832,7 @@ NS_IMETHODIMP nsPluginHostImpl::SetUpPluginInstance(const char *aMimeType,
if(IsPluginEnabledForExtension(extension, mimetype) != NS_OK) if(IsPluginEnabledForExtension(extension, mimetype) != NS_OK)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
#ifdef NECKO #ifdef NECKO
nsCRT::free(filename); nsCRT::free(filename);
#endif #endif
} }
else else
@ -2174,7 +2220,7 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
nsIPluginInstance *aInstance, nsIPluginInstance *aInstance,
nsIPluginStreamListener* aListener) nsIPluginStreamListener* aListener)
{ {
nsIURI *url; nsIURI *url;
nsPluginStreamListenerPeer *listenerPeer = (nsPluginStreamListenerPeer *)new nsPluginStreamListenerPeer(); nsPluginStreamListenerPeer *listenerPeer = (nsPluginStreamListenerPeer *)new nsPluginStreamListenerPeer();
if (listenerPeer == NULL) if (listenerPeer == NULL)
return NS_ERROR_OUT_OF_MEMORY; return NS_ERROR_OUT_OF_MEMORY;
@ -2186,17 +2232,7 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
#ifndef NECKO #ifndef NECKO
rv = NS_NewURL(&url, aURL); rv = NS_NewURL(&url, aURL);
#else #else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv); rv = NS_NewURI(&url, aURL);
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;
#endif // NECKO #endif // NECKO
if (NS_OK == rv) if (NS_OK == rv)
@ -2204,7 +2240,11 @@ NS_IMETHODIMP nsPluginHostImpl::NewPluginURLStream(const nsString& aURL,
rv = listenerPeer->Initialize(url, aInstance, aListener); rv = listenerPeer->Initialize(url, aInstance, aListener);
if (NS_OK == rv) { if (NS_OK == rv) {
#ifdef NECKO
rv = NS_OpenURI(listenerPeer, url);
#else
rv = NS_OpenURL(url, listenerPeer); rv = NS_OpenURL(url, listenerPeer);
#endif
} }
NS_RELEASE(url); NS_RELEASE(url);
@ -2254,7 +2294,11 @@ nsresult nsPluginHostImpl::NewEmbededPluginStream(nsIURI* aURL,
rv = NS_ERROR_ILLEGAL_VALUE; rv = NS_ERROR_ILLEGAL_VALUE;
if (NS_OK == rv) { if (NS_OK == rv) {
#ifdef NECKO
rv = NS_OpenURI(listener, aURL);
#else
rv = NS_OpenURL(aURL, listener); rv = NS_OpenURL(aURL, listener);
#endif
} }
//NS_RELEASE(aURL); //NS_RELEASE(aURL);

Просмотреть файл

@ -38,7 +38,11 @@ LLIBS=\
$(DIST)\lib\rdfdatasource_s.lib \ $(DIST)\lib\rdfdatasource_s.lib \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
$(DIST)\lib\raptorgfxwin.lib \ $(DIST)\lib\raptorgfxwin.lib \
!ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(DIST)\lib\plc3.lib \ $(DIST)\lib\plc3.lib \
$(DIST)\lib\jsdom.lib \ $(DIST)\lib\jsdom.lib \
$(DIST)\lib\js3250.lib \ $(DIST)\lib\js3250.lib \

Просмотреть файл

@ -32,7 +32,11 @@ OBJS= .\$(OBJDIR)\rdfcat.obj
LLIBS= \ LLIBS= \
$(DIST)\lib\rdf.lib \ $(DIST)\lib\rdf.lib \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
!ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(DIST)\lib\plc3.lib \ $(DIST)\lib\plc3.lib \
$(LIBNSPR) $(LIBNSPR)

Просмотреть файл

@ -31,12 +31,12 @@
#include "nsIInputStream.h" #include "nsIInputStream.h"
#ifndef NECKO #ifndef NECKO
#include "nsINetService.h" #include "nsINetService.h"
#include "nsIPostToServer.h"
#else #else
#include "nsIIOService.h" #include "nsIIOService.h"
#endif // NECKO #endif // NECKO
#include "nsIOutputStream.h" #include "nsIOutputStream.h"
#include "nsIGenericFactory.h" #include "nsIGenericFactory.h"
#include "nsIPostToServer.h"
#include "nsIRDFCompositeDataSource.h" #include "nsIRDFCompositeDataSource.h"
#include "nsIRDFRemoteDataSource.h" #include "nsIRDFRemoteDataSource.h"
#include "nsIRDFDocument.h" #include "nsIRDFDocument.h"

Просмотреть файл

@ -32,7 +32,11 @@ OBJS= .\$(OBJDIR)\rdfpoll.obj
LLIBS= \ LLIBS= \
$(DIST)\lib\rdf.lib \ $(DIST)\lib\rdf.lib \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
!ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(DIST)\lib\plc3.lib \ $(DIST)\lib\plc3.lib \
$(LIBNSPR) $(LIBNSPR)

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -68,6 +68,15 @@ public:
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg); NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg);
// nsIDocumentLoaderObserver // 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 OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus, nsIDocumentLoaderObserver* aObserver); NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus, nsIDocumentLoaderObserver* aObserver);
NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aContentType, nsIContentViewer* aViewer); 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 OnStatusURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, nsString& aMsg);
NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus); NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus);
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader, nsIURI *aURL,const char *aContentType,const char *aCommand ); NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* loader, nsIURI *aURL,const char *aContentType,const char *aCommand );
#endif
}; };
#endif #endif

Просмотреть файл

@ -26,6 +26,9 @@
class nsIContentViewer; class nsIContentViewer;
class nsIURI; class nsIURI;
class nsIDocumentLoader; class nsIDocumentLoader;
#ifdef NECKO
class nsIChannel;
#endif
#define NS_ICONTENT_VIEWER_CONTAINER_IID \ #define NS_ICONTENT_VIEWER_CONTAINER_IID \
{ 0xa6cf9055, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}} { 0xa6cf9055, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}}
@ -48,7 +51,11 @@ public:
NS_IMETHOD GetContentViewer(nsIContentViewer** aResult) = 0; NS_IMETHOD GetContentViewer(nsIContentViewer** aResult) = 0;
NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* aLoader, NS_IMETHOD HandleUnknownContentType(nsIDocumentLoader* aLoader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL, nsIURI* aURL,
#endif
const char *aContentType, const char *aContentType,
const char *aCommand ) = 0; const char *aCommand ) = 0;
}; };

Просмотреть файл

@ -22,7 +22,9 @@
#include "nsweb.h" #include "nsweb.h"
#include "prtypes.h" #include "prtypes.h"
#include "nsISupports.h" #include "nsISupports.h"
#ifndef NECKO #ifdef NECKO
#include "nsIChannel.h"
#else
#include "nsILoadAttribs.h" #include "nsILoadAttribs.h"
#endif // NECKO #endif // NECKO
@ -100,20 +102,18 @@ public:
nsISupports* aExtraInfo = nsnull, nsISupports* aExtraInfo = nsnull,
nsIStreamObserver* anObserver = nsnull, nsIStreamObserver* anObserver = nsnull,
#ifdef NECKO #ifdef NECKO
PRBool bypassCache = PR_FALSE, PRUint32 aType = nsIChannel::LOAD_NORMAL,
PRBool bypassProxy = PR_FALSE,
#else #else
nsURLReloadType type = nsURLReload, nsURLReloadType aType = nsURLReload,
#endif #endif
const PRUint32 aLocalIP = 0) = 0; const PRUint32 aLocalIP = 0) = 0;
NS_IMETHOD LoadSubDocument(const nsString& aURLSpec, NS_IMETHOD LoadSubDocument(const nsString& aURLSpec,
nsISupports* aExtraInfo = nsnull, nsISupports* aExtraInfo = nsnull,
#ifdef NECKO #ifdef NECKO
PRBool bypassCache = PR_FALSE, PRUint32 aType = nsIChannel::LOAD_NORMAL,
PRBool bypassProxy = PR_FALSE,
#else #else
nsURLReloadType type = nsURLReload, nsURLReloadType aType = nsURLReload,
#endif #endif
const PRUint32 aLocalIP = 0) = 0; const PRUint32 aLocalIP = 0) = 0;

Просмотреть файл

@ -25,7 +25,9 @@
class nsIURI; class nsIURI;
class nsIContentViewer; class nsIContentViewer;
class nsIDocumentLoader; class nsIDocumentLoader;
#ifdef NECKO
class nsIChannel;
#endif
/* f6b4f550-317c-11d2-bd8c-00805f8ae3f4 */ /* f6b4f550-317c-11d2-bd8c-00805f8ae3f4 */
#define NS_IDOCUMENT_LOADER_OBSERVER_IID \ #define NS_IDOCUMENT_LOADER_OBSERVER_IID \
@ -52,8 +54,13 @@ public:
/** /**
* Notify the observer that a document has been completely loaded. * 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, NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver) = 0; nsIDocumentLoaderObserver * aObserver) = 0;
#endif
/** /**
* Notify the observer that the specified nsIURI has just started to load. * 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 * This notification occurs after DNS resolution, and a connection to the
* server has been established. * 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, NS_IMETHOD OnStartURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aContentType,
nsIContentViewer* aViewer) = 0; nsIContentViewer* aViewer) = 0;
#endif
/** /**
* Notify the observer that progress has occurred in the loading of the * Notify the observer that progress has occurred in the loading of the
* specified URL... * specified URL...
*/ */
#ifdef NECKO
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel, PRUint32 aProgress,
PRUint32 aProgressMax) = 0;
#else
NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader, NS_IMETHOD OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, PRUint32 aProgress, nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax) = 0; PRUint32 aProgressMax) = 0;
#endif
/** /**
* Notify the observer that status text is available regarding the URL * Notify the observer that status text is available regarding the URL
* being loaded... * 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; NS_IMETHOD OnStatusURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, nsString& aMsg) = 0;
#endif
/** /**
* Notify the observer that the specified nsIURI has finished loading. * 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; NS_IMETHOD OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, PRInt32 aStatus) = 0;
#endif
/** /**
* Notify the observer that some content of unknown type has been * Notify the observer that some content of unknown type has been
* encountered... * encountered...
*/ */
#ifdef NECKO
NS_IMETHOD HandleUnknownContentType( nsIDocumentLoader* loader,
nsIChannel* channel,
const char *aContentType,
const char *aCommand ) = 0;
#else
NS_IMETHOD HandleUnknownContentType( nsIDocumentLoader* loader, NS_IMETHOD HandleUnknownContentType( nsIDocumentLoader* loader,
nsIURI *aURL, nsIURI *aURL,
const char *aContentType, const char *aContentType,
const char *aCommand ) = 0; const char *aCommand ) = 0;
#endif
}; };

Просмотреть файл

@ -23,7 +23,9 @@
#include "nsIWidget.h" #include "nsIWidget.h"
#include "nsIScrollableView.h" #include "nsIScrollableView.h"
#include "nsIContentViewerContainer.h" #include "nsIContentViewerContainer.h"
#ifndef NECKO #ifdef NECKO
#include "nsIChannel.h"
#else
#include "nsILoadAttribs.h" #include "nsILoadAttribs.h"
#endif // NECKO #endif // NECKO
#include "nsIScrollableView.h" #include "nsIScrollableView.h"
@ -336,8 +338,7 @@ public:
nsIPostData* aPostData=nsnull, nsIPostData* aPostData=nsnull,
PRBool aModifyHistory=PR_TRUE, PRBool aModifyHistory=PR_TRUE,
#ifdef NECKO #ifdef NECKO
PRBool bypassCache = PR_FALSE, PRUint32 aType = nsIChannel::LOAD_NORMAL,
PRBool bypassProxy = PR_FALSE,
#else #else
nsURLReloadType aType=nsURLReload, nsURLReloadType aType=nsURLReload,
#endif #endif
@ -351,8 +352,7 @@ public:
nsIPostData* aPostData=nsnull, nsIPostData* aPostData=nsnull,
PRBool aModifyHistory=PR_TRUE, PRBool aModifyHistory=PR_TRUE,
#ifdef NECKO #ifdef NECKO
PRBool bypassCache = PR_FALSE, PRUint32 aType = nsIChannel::LOAD_NORMAL,
PRBool bypassProxy = PR_FALSE,
#else #else
nsURLReloadType aType=nsURLReload, nsURLReloadType aType=nsURLReload,
#endif #endif
@ -368,7 +368,7 @@ public:
* Reload the current document. * Reload the current document.
*/ */
#ifdef NECKO #ifdef NECKO
NS_IMETHOD Reload(PRBool bypassCache, PRBool bypassProxy) = 0; NS_IMETHOD Reload(PRUint32 aType) = 0;
#else #else
NS_IMETHOD Reload(nsURLReloadType aType) = 0; NS_IMETHOD Reload(nsURLReloadType aType) = 0;
#endif #endif

Просмотреть файл

@ -38,7 +38,12 @@ CPP_OBJS= \
$(NULL) $(NULL)
LINCS=-I..\public -I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor \ 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)\plugin -I$(PUBLIC)\java -I$(PUBLIC)\pref -I$(PUBLIC)\profile \
-I$(PUBLIC)\js -I$(DEPTH)\include -I$(PUBLIC)\jsurl \ -I$(PUBLIC)\js -I$(DEPTH)\include -I$(PUBLIC)\jsurl \
-I$(PUBLIC)\editor -I$(PUBLIC)\rdf \ -I$(PUBLIC)\editor -I$(PUBLIC)\rdf \
@ -72,7 +77,11 @@ LLIBS= \
$(DIST)\lib\util.lib \ $(DIST)\lib\util.lib \
$(DIST)\lib\plc3.lib \ $(DIST)\lib\plc3.lib \
$(DIST)\lib\jsdom.lib \ $(DIST)\lib\jsdom.lib \
!ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(LIBNSPR) \ $(LIBNSPR) \
OLE32.LIB OLE32.LIB

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -24,7 +24,10 @@
#include "nsIDeviceContext.h" #include "nsIDeviceContext.h"
#include "nsILinkHandler.h" #include "nsILinkHandler.h"
#include "nsIStreamListener.h" #include "nsIStreamListener.h"
#ifndef NECKO
#include "nsINetSupport.h" #include "nsINetSupport.h"
#include "nsIRefreshUrl.h"
#endif
#include "nsIScriptGlobalObject.h" #include "nsIScriptGlobalObject.h"
#include "nsIScriptContextOwner.h" #include "nsIScriptContextOwner.h"
#include "nsIDocumentLoaderObserver.h" #include "nsIDocumentLoaderObserver.h"
@ -45,7 +48,6 @@
//#include "nsPluginsCID.h" //#include "nsPluginsCID.h"
#include "nsIPluginManager.h" #include "nsIPluginManager.h"
#include "nsIPref.h" #include "nsIPref.h"
#include "nsIRefreshUrl.h"
#include "nsITimer.h" #include "nsITimer.h"
#include "nsITimerCallback.h" #include "nsITimerCallback.h"
#include "jsurl.h" #include "jsurl.h"
@ -57,6 +59,7 @@
#include "nsIStreamObserver.h" #include "nsIStreamObserver.h"
#include "nsIWebShellServices.h" #include "nsIWebShellServices.h"
#include "nsIGlobalHistory.h" #include "nsIGlobalHistory.h"
#include "prmem.h"
#ifdef XP_PC #ifdef XP_PC
#include <windows.h> #include <windows.h>
@ -130,8 +133,10 @@ class nsWebShell : public nsIWebShell,
public nsILinkHandler, public nsILinkHandler,
public nsIScriptContextOwner, public nsIScriptContextOwner,
public nsIDocumentLoaderObserver, public nsIDocumentLoaderObserver,
#ifndef NECKO
public nsIRefreshUrl, public nsIRefreshUrl,
public nsINetSupport, public nsINetSupport,
#endif
// public nsIStreamObserver, // public nsIStreamObserver,
public nsIClipboardCommands public nsIClipboardCommands
{ {
@ -210,17 +215,29 @@ public:
NS_IMETHOD LoadURL(const PRUnichar *aURLSpec, NS_IMETHOD LoadURL(const PRUnichar *aURLSpec,
nsIPostData* aPostData=nsnull, nsIPostData* aPostData=nsnull,
PRBool aModifyHistory=PR_TRUE, PRBool aModifyHistory=PR_TRUE,
#ifdef NECKO
PRUint32 aType = nsIChannel::LOAD_NORMAL,
#else
nsURLReloadType aType = nsURLReload, nsURLReloadType aType = nsURLReload,
#endif
const PRUint32 localIP = 0); const PRUint32 localIP = 0);
NS_IMETHOD LoadURL(const PRUnichar *aURLSpec, NS_IMETHOD LoadURL(const PRUnichar *aURLSpec,
const char* aCommand, const char* aCommand,
nsIPostData* aPostData=nsnull, nsIPostData* aPostData=nsnull,
PRBool aModifyHistory=PR_TRUE, PRBool aModifyHistory=PR_TRUE,
#ifdef NECKO
PRUint32 aType = nsIChannel::LOAD_NORMAL,
#else
nsURLReloadType aType = nsURLReload, nsURLReloadType aType = nsURLReload,
#endif
const PRUint32 localIP = 0); const PRUint32 localIP = 0);
NS_IMETHOD Stop(void); NS_IMETHOD Stop(void);
#ifdef NECKO
NS_IMETHOD Reload(PRUint32 aType);
#else
NS_IMETHOD Reload(nsURLReloadType aType); NS_IMETHOD Reload(nsURLReloadType aType);
#endif
// History api's // History api's
NS_IMETHOD Back(void); NS_IMETHOD Back(void);
@ -278,6 +295,30 @@ public:
NS_IMETHOD GetScriptGlobalObject(nsIScriptGlobalObject **aGlobal); NS_IMETHOD GetScriptGlobalObject(nsIScriptGlobalObject **aGlobal);
NS_IMETHOD ReleaseScriptContext(nsIScriptContext *aContext); 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 // nsIDocumentLoaderObserver
NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsIURI* aURL,
@ -300,6 +341,7 @@ public:
nsIURI* aURL, nsIURI* aURL,
const char *aContentType, const char *aContentType,
const char *aCommand ); const char *aCommand );
#endif
// NS_IMETHOD OnConnectionsComplete(); // NS_IMETHOD OnConnectionsComplete();
// nsIRefreshURL interface methods... // nsIRefreshURL interface methods...
@ -395,7 +437,9 @@ protected:
nsIWidget* mWindow; nsIWidget* mWindow;
nsIDocumentLoader* mDocLoader; nsIDocumentLoader* mDocLoader;
nsIDocumentLoaderObserver* mDocLoaderObserver; nsIDocumentLoaderObserver* mDocLoaderObserver;
#ifndef NECKO
nsINetSupport* mNetSupport; nsINetSupport* mNetSupport;
#endif
nsIWebShell* mParent; nsIWebShell* mParent;
nsVoidArray mChildren; nsVoidArray mChildren;
@ -430,7 +474,11 @@ protected:
nsresult DoLoadURL(const nsString& aUrlSpec, nsresult DoLoadURL(const nsString& aUrlSpec,
const char* aCommand, const char* aCommand,
nsIPostData* aPostData, nsIPostData* aPostData,
#ifdef NECKO
PRUint32 aType,
#else
nsURLReloadType aType, nsURLReloadType aType,
#endif
const PRUint32 aLocalIP); const PRUint32 aLocalIP);
float mZoom; 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(kIScriptContextOwnerIID, NS_ISCRIPTCONTEXTOWNER_IID);
static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID); static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);
#ifndef NECKO
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID); 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(kIWebShellIID, NS_IWEB_SHELL_IID);
static NS_DEFINE_IID(kIWebShellServicesIID, NS_IWEB_SHELL_SERVICES_IID); static NS_DEFINE_IID(kIWebShellServicesIID, NS_IWEB_SHELL_SERVICES_IID);
static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_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(kCPluginHostCID, NS_PLUGIN_HOST_CID);
static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID); static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID);
static NS_DEFINE_IID(kIDocumentViewerIID, NS_IDOCUMENT_VIEWER_IID); 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(kITimerCallbackIID, NS_ITIMERCALLBACK_IID);
static NS_DEFINE_IID(kIWebShellContainerIID, NS_IWEB_SHELL_CONTAINER_IID); static NS_DEFINE_IID(kIWebShellContainerIID, NS_IWEB_SHELL_CONTAINER_IID);
static NS_DEFINE_IID(kIBrowserWindowIID, NS_IBROWSER_WINDOW_IID); static NS_DEFINE_IID(kIBrowserWindowIID, NS_IBROWSER_WINDOW_IID);
@ -596,7 +646,9 @@ nsWebShell::~nsWebShell()
NS_IF_RELEASE(mPrefs); NS_IF_RELEASE(mPrefs);
NS_IF_RELEASE(mContainer); NS_IF_RELEASE(mContainer);
NS_IF_RELEASE(mObserver); NS_IF_RELEASE(mObserver);
#ifndef NECKO
NS_IF_RELEASE(mNetSupport); NS_IF_RELEASE(mNetSupport);
#endif
if (nsnull != mScriptGlobal) { if (nsnull != mScriptGlobal) {
mScriptGlobal->SetWebShell(nsnull); mScriptGlobal->SetWebShell(nsnull);
@ -729,6 +781,7 @@ nsWebShell::QueryInterface(REFNSIID aIID, void** aInstancePtr)
NS_ADDREF_THIS(); NS_ADDREF_THIS();
return NS_OK; return NS_OK;
} }
#ifndef NECKO
if (aIID.Equals(kRefreshURLIID)) { if (aIID.Equals(kRefreshURLIID)) {
*aInstancePtr = (void*)(nsIRefreshUrl*)this; *aInstancePtr = (void*)(nsIRefreshUrl*)this;
NS_ADDREF_THIS(); NS_ADDREF_THIS();
@ -739,6 +792,7 @@ nsWebShell::QueryInterface(REFNSIID aIID, void** aInstancePtr)
NS_ADDREF_THIS(); NS_ADDREF_THIS();
return NS_OK; return NS_OK;
} }
#endif
if (aIID.Equals(kIClipboardCommandsIID)) { if (aIID.Equals(kIClipboardCommandsIID)) {
*aInstancePtr = (void*) ((nsIClipboardCommands*)this); *aInstancePtr = (void*) ((nsIClipboardCommands*)this);
NS_ADDREF_THIS(); NS_ADDREF_THIS();
@ -840,11 +894,19 @@ nsWebShell::GetContentViewer(nsIContentViewer** aResult)
NS_IMETHODIMP NS_IMETHODIMP
nsWebShell::HandleUnknownContentType(nsIDocumentLoader* loader, nsWebShell::HandleUnknownContentType(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL, nsIURI* aURL,
#endif
const char *aContentType, const char *aContentType,
const char *aCommand ) { const char *aCommand ) {
// If we have a doc loader observer, let it respond to this. // 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 ) return mDocLoaderObserver ? mDocLoaderObserver->HandleUnknownContentType( mDocLoader, aURL, aContentType, aCommand )
#endif
: NS_ERROR_FAILURE; : NS_ERROR_FAILURE;
} }
@ -1181,11 +1243,15 @@ NS_IMETHODIMP
nsWebShell::SetObserver(nsIStreamObserver* anObserver) nsWebShell::SetObserver(nsIStreamObserver* anObserver)
{ {
NS_IF_RELEASE(mObserver); NS_IF_RELEASE(mObserver);
#ifndef NECKO
NS_IF_RELEASE(mNetSupport); NS_IF_RELEASE(mNetSupport);
#endif
mObserver = anObserver; mObserver = anObserver;
if (nsnull != mObserver) { if (nsnull != mObserver) {
#ifndef NECKO
mObserver->QueryInterface(kINetSupportIID, (void **) &mNetSupport); mObserver->QueryInterface(kINetSupportIID, (void **) &mNetSupport);
#endif
NS_ADDREF(mObserver); NS_ADDREF(mObserver);
} }
return NS_OK; return NS_OK;
@ -1633,7 +1699,11 @@ NS_IMETHODIMP
nsWebShell::LoadURL(const PRUnichar *aURLSpec, nsWebShell::LoadURL(const PRUnichar *aURLSpec,
nsIPostData* aPostData, nsIPostData* aPostData,
PRBool aModifyHistory, PRBool aModifyHistory,
#ifdef NECKO
PRUint32 aType,
#else
nsURLReloadType aType, nsURLReloadType aType,
#endif
const PRUint32 aLocalIP) const PRUint32 aLocalIP)
{ {
// Initialize margnwidth, marginheight. Put scrolling back the way it was // Initialize margnwidth, marginheight. Put scrolling back the way it was
@ -1647,7 +1717,11 @@ nsresult
nsWebShell::DoLoadURL(const nsString& aUrlSpec, nsWebShell::DoLoadURL(const nsString& aUrlSpec,
const char* aCommand, const char* aCommand,
nsIPostData* aPostData, nsIPostData* aPostData,
#ifdef NECKO
PRUint32 aType,
#else
nsURLReloadType aType, nsURLReloadType aType,
#endif
const PRUint32 aLocalIP) 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 // 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 // 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; nsCOMPtr<nsIDocumentViewer> docViewer;
if (NS_SUCCEEDED(mContentViewer->QueryInterface(kIDocumentViewerIID, if (NS_SUCCEEDED(mContentViewer->QueryInterface(kIDocumentViewerIID,
getter_AddRefs(docViewer)))) { getter_AddRefs(docViewer)))) {
@ -1685,10 +1764,25 @@ nsWebShell::DoLoadURL(const nsString& aUrlSpec,
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
#endif // NECKO #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 // 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; const char* ref;
url->GetRef(&ref); url->GetRef(&ref);
#endif
if (nsnull != ref) { if (nsnull != ref) {
// Get the pres shell object // Get the pres shell object
@ -1737,7 +1831,11 @@ nsWebShell::LoadURL(const PRUnichar *aURLSpec,
const char* aCommand, const char* aCommand,
nsIPostData* aPostData, nsIPostData* aPostData,
PRBool aModifyHistory, PRBool aModifyHistory,
#ifdef NECKO
PRUint32 aType,
#else
nsURLReloadType aType, nsURLReloadType aType,
#endif
const PRUint32 aLocalIP) const PRUint32 aLocalIP)
{ {
@ -1866,7 +1964,11 @@ NS_IMETHODIMP nsWebShell::Stop(void)
return NS_OK; return NS_OK;
} }
#ifdef NECKO
NS_IMETHODIMP nsWebShell::Reload(PRUint32 aType)
#else
NS_IMETHODIMP nsWebShell::Reload(nsURLReloadType aType) NS_IMETHODIMP nsWebShell::Reload(nsURLReloadType aType)
#endif
{ {
nsString* s = (nsString*) mHistory.ElementAt(mHistoryIndex); nsString* s = (nsString*) mHistory.ElementAt(mHistoryIndex);
if (nsnull != s) { if (nsnull != s) {
@ -1928,7 +2030,11 @@ nsWebShell::GoTo(PRInt32 aHistoryIndex)
rv = DoLoadURL(urlSpec, // URL string rv = DoLoadURL(urlSpec, // URL string
"view", // Command "view", // Command
nsnull, // Post Data nsnull, // Post Data
#ifdef NECKO
nsIChannel::LOAD_NORMAL, // the reload type
#else
nsURLReload, // the reload type nsURLReload, // the reload type
#endif
0); // load attributes 0); // load attributes
} }
return rv; return rv;
@ -2613,16 +2719,27 @@ nsWebShell::OnStartDocumentLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP NS_IMETHODIMP
nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader, nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL, nsIURI* aURL,
#endif
PRInt32 aStatus, PRInt32 aStatus,
nsIDocumentLoaderObserver * aWebShell) 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 #if DEBUG_nisheeth
const char* spec; const char* spec;
aURL->GetSpec(&spec); aURL->GetSpec(&spec);
printf("nsWebShell::OnEndDocumentLoad:%p: loader=%p url=%s status=%d\n", this, loader, spec, aStatus); printf("nsWebShell::OnEndDocumentLoad:%p: loader=%p url=%s status=%d\n", this, loader, spec, aStatus);
#endif #endif
nsresult rv = NS_ERROR_FAILURE;
if (!mProcessedEndDocumentLoad) { if (!mProcessedEndDocumentLoad) {
mProcessedEndDocumentLoad = PR_TRUE; mProcessedEndDocumentLoad = PR_TRUE;
@ -2648,13 +2765,20 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
// Fire the EndLoadURL of the web shell container // Fire the EndLoadURL of the web shell container
if (nsnull != aURL) { if (nsnull != aURL) {
nsAutoString urlString; nsAutoString urlString;
#ifdef NECKO
char* spec;
#else
const char* spec; const char* spec;
#endif
rv = aURL->GetSpec(&spec); rv = aURL->GetSpec(&spec);
if (NS_SUCCEEDED(rv)) { if (NS_SUCCEEDED(rv)) {
urlString = spec; urlString = spec;
if (nsnull != mContainer) { if (nsnull != mContainer) {
rv = mContainer->EndLoadURL(this, urlString.GetUnicode(), 0); 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 * Fire the OnEndDocumentLoad of the DocLoaderobserver
*/ */
if (dlObserver && (nsnull != aURL)) { if (dlObserver && (nsnull != aURL)) {
#ifdef NECKO
dlObserver->OnEndDocumentLoad(mDocLoader, channel, aStatus, aWebShell);
#else
dlObserver->OnEndDocumentLoad(mDocLoader, aURL, aStatus, aWebShell); dlObserver->OnEndDocumentLoad(mDocLoader, aURL, aStatus, aWebShell);
#endif
} }
} //!mProcessedEndDocumentLoad } //!mProcessedEndDocumentLoad
@ -2696,10 +2824,21 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP NS_IMETHODIMP
nsWebShell::OnStartURLLoad(nsIDocumentLoader* loader, nsWebShell::OnStartURLLoad(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL, nsIURI* aURL,
#endif
const char* aContentType, const char* aContentType,
nsIContentViewer* aViewer) 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 // XXX This is a temporary hack for meeting the M4 milestone
// for seamonkey. I think Netlib should send a message to all stream listeners // 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)) if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{ {
#ifdef NECKO
mDocLoaderObserver->OnStartURLLoad(mDocLoader, channel, aContentType, aViewer);
#else
mDocLoaderObserver->OnStartURLLoad(mDocLoader, aURL, aContentType, aViewer); mDocLoaderObserver->OnStartURLLoad(mDocLoader, aURL, aContentType, aViewer);
#endif
} }
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader, nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL, nsIURI* aURL,
#endif
PRUint32 aProgress, PRUint32 aProgress,
PRUint32 aProgressMax) PRUint32 aProgressMax)
{ {
@ -2734,7 +2881,11 @@ nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
*/ */
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver)) if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{ {
#ifdef NECKO
mDocLoaderObserver->OnProgressURLLoad(mDocLoader, channel, aProgress, aProgressMax);
#else
mDocLoaderObserver->OnProgressURLLoad(mDocLoader, aURL, aProgress, aProgressMax); mDocLoaderObserver->OnProgressURLLoad(mDocLoader, aURL, aProgress, aProgressMax);
#endif
} }
return NS_OK; return NS_OK;
@ -2742,7 +2893,11 @@ nsWebShell::OnProgressURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP NS_IMETHODIMP
nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader, nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL, nsIURI* aURL,
#endif
nsString& aMsg) nsString& aMsg)
{ {
/* /*
@ -2750,7 +2905,11 @@ nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
*/ */
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver)) if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{ {
#ifdef NECKO
mDocLoaderObserver->OnStatusURLLoad(mDocLoader, channel, aMsg);
#else
mDocLoaderObserver->OnStatusURLLoad(mDocLoader, aURL, aMsg); mDocLoaderObserver->OnStatusURLLoad(mDocLoader, aURL, aMsg);
#endif
} }
return NS_OK; return NS_OK;
@ -2758,7 +2917,11 @@ nsWebShell::OnStatusURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP NS_IMETHODIMP
nsWebShell::OnEndURLLoad(nsIDocumentLoader* loader, nsWebShell::OnEndURLLoad(nsIDocumentLoader* loader,
#ifdef NECKO
nsIChannel* channel,
#else
nsIURI* aURL, nsIURI* aURL,
#endif
PRInt32 aStatus) PRInt32 aStatus)
{ {
#if 0 #if 0
@ -2771,7 +2934,11 @@ nsWebShell::OnEndURLLoad(nsIDocumentLoader* loader,
*/ */
if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver)) if ((nsnull != mContainer) && (nsnull != mDocLoaderObserver))
{ {
#ifdef NECKO
mDocLoaderObserver->OnEndURLLoad(mDocLoader, channel, aStatus);
#else
mDocLoaderObserver->OnEndURLLoad(mDocLoader, aURL, aStatus); mDocLoaderObserver->OnEndURLLoad(mDocLoader, aURL, aStatus);
#endif
} }
return NS_OK; return NS_OK;
@ -2816,7 +2983,11 @@ void refreshData::Notify(nsITimer *aTimer)
{ {
NS_PRECONDITION((nsnull != mShell), "Null pointer..."); NS_PRECONDITION((nsnull != mShell), "Null pointer...");
if (nsnull != mShell) { if (nsnull != mShell) {
#ifdef NECKO
mShell->LoadURL(mUrlSpec.GetUnicode(), nsnull, PR_TRUE, nsIChannel::LOAD_NORMAL);
#else
mShell->LoadURL(mUrlSpec.GetUnicode(), nsnull, PR_TRUE, nsURLReload); mShell->LoadURL(mUrlSpec.GetUnicode(), nsnull, PR_TRUE, nsURLReload);
#endif
} }
/* /*
* LoadURL(...) will cancel all refresh timers... This causes the Timer and * 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; goto done;
} }
#ifdef NECKO
char* spec;
#else
const char* spec; const char* spec;
#endif
aURL->GetSpec(&spec); aURL->GetSpec(&spec);
rv = RefreshURL(spec, millis, repeat); rv = RefreshURL(spec, millis, repeat);
#ifdef NECKO
nsCRT::free(spec);
#endif
done: done:
return rv; return rv;
} }
@ -2955,9 +3133,16 @@ nsresult nsWebShell::CheckForTrailingSlash(nsIURI* aURL)
nsString * historyURL = (nsString *) new nsString(url); nsString * historyURL = (nsString *) new nsString(url);
/* Get the url that netlib passed us */ /* Get the url that netlib passed us */
#ifdef NECKO
char* spec;
#else
const char* spec; const char* spec;
#endif
aURL->GetSpec(&spec); aURL->GetSpec(&spec);
nsString* newURL = (nsString*) new nsString(spec); nsString* newURL = (nsString*) new nsString(spec);
#ifdef NECKO
nsCRT::free(spec);
#endif
if (newURL && newURL->Last() == '/' && !historyURL->Equals(*newURL)) { if (newURL && newURL->Last() == '/' && !historyURL->Equals(*newURL)) {
// Replace the top most history entry with the new url // 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) NS_IMETHODIMP_(void)
nsWebShell::Alert(const nsString &aText) nsWebShell::Alert(const nsString &aText)
{ {
#ifdef NECKO
NS_ASSERTION(0, "help");
#else
if (nsnull != mNetSupport) { if (nsnull != mNetSupport) {
mNetSupport->Alert(aText); mNetSupport->Alert(aText);
} }
#endif
} }
NS_IMETHODIMP_(PRBool) NS_IMETHODIMP_(PRBool)
@ -3057,9 +3246,13 @@ nsWebShell::Confirm(const nsString &aText)
{ {
PRBool bResult = PR_FALSE; PRBool bResult = PR_FALSE;
#ifdef NECKO
NS_ASSERTION(0, "help");
#else
if (nsnull != mNetSupport) { if (nsnull != mNetSupport) {
bResult = mNetSupport->Confirm(aText); bResult = mNetSupport->Confirm(aText);
} }
#endif
return bResult; return bResult;
} }
@ -3070,9 +3263,13 @@ nsWebShell::Prompt(const nsString &aText,
{ {
PRBool bResult = PR_FALSE; PRBool bResult = PR_FALSE;
#ifdef NECKO
NS_ASSERTION(0, "help");
#else
if (nsnull != mNetSupport) { if (nsnull != mNetSupport) {
bResult = mNetSupport->Prompt(aText, aDefault, aResult); bResult = mNetSupport->Prompt(aText, aDefault, aResult);
} }
#endif
return bResult; return bResult;
} }
@ -3083,9 +3280,13 @@ nsWebShell::PromptUserAndPassword(const nsString &aText,
{ {
PRBool bResult = PR_FALSE; PRBool bResult = PR_FALSE;
#ifdef NECKO
NS_ASSERTION(0, "help");
#else
if (nsnull != mNetSupport) { if (nsnull != mNetSupport) {
bResult = mNetSupport->PromptUserAndPassword(aText, aUser, aPassword); bResult = mNetSupport->PromptUserAndPassword(aText, aUser, aPassword);
} }
#endif
return bResult; return bResult;
} }
@ -3095,9 +3296,13 @@ nsWebShell::PromptPassword(const nsString &aText,
{ {
PRBool bResult = PR_FALSE; PRBool bResult = PR_FALSE;
#ifdef NECKO
NS_ASSERTION(0, "help");
#else
if (nsnull != mNetSupport) { if (nsnull != mNetSupport) {
bResult = mNetSupport->PromptPassword(aText, aPassword); bResult = mNetSupport->PromptPassword(aText, aPassword);
} }
#endif
return bResult; return bResult;
} }

Просмотреть файл

@ -56,7 +56,11 @@ LINCS= \
-I$(PUBLIC)\xpcom \ -I$(PUBLIC)\xpcom \
-I$(PUBLIC)\dom \ -I$(PUBLIC)\dom \
-I$(PUBLIC)\js \ -I$(PUBLIC)\js \
!ifdef NECKO
-I$(PUBLIC)\necko \
!else
-I$(PUBLIC)\netlib \ -I$(PUBLIC)\netlib \
!endif
-I$(PUBLIC)\java \ -I$(PUBLIC)\java \
-I$(PUBLIC)\plugin \ -I$(PUBLIC)\plugin \
-I$(PUBLIC)\pref \ -I$(PUBLIC)\pref \
@ -91,7 +95,11 @@ MYLIBS= \
$(DIST)\lib\js32$(VERSION_NUMBER).lib \ $(DIST)\lib\js32$(VERSION_NUMBER).lib \
$(LIBNSPR) \ $(LIBNSPR) \
$(DIST)\lib\plc3.lib \ $(DIST)\lib\plc3.lib \
!ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(DIST)\lib\jsdom.lib \ $(DIST)\lib\jsdom.lib \
comdlg32.lib \ comdlg32.lib \
!if defined(NGPREFS) !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(kICheckButtonIID, NS_ICHECKBUTTON_IID);
static NS_DEFINE_IID(kIRadioButtonIID, NS_IRADIOBUTTON_IID); static NS_DEFINE_IID(kIRadioButtonIID, NS_IRADIOBUTTON_IID);
static NS_DEFINE_IID(kILabelIID, NS_ILABEL_IID); static NS_DEFINE_IID(kILabelIID, NS_ILABEL_IID);
#ifdef NECKO
#else
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID); static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
#endif
static NS_DEFINE_IID(kIDocumentViewerIID, NS_IDOCUMENT_VIEWER_IID); static NS_DEFINE_IID(kIDocumentViewerIID, NS_IDOCUMENT_VIEWER_IID);
static NS_DEFINE_IID(kXPBaseWindowCID, NS_XPBASE_WINDOW_CID); static NS_DEFINE_IID(kXPBaseWindowCID, NS_XPBASE_WINDOW_CID);
static NS_DEFINE_IID(kIStringBundleServiceIID, NS_ISTRINGBUNDLESERVICE_IID); static NS_DEFINE_IID(kIStringBundleServiceIID, NS_ISTRINGBUNDLESERVICE_IID);
@ -1088,11 +1091,19 @@ nsBrowserWindow::QueryInterface(const nsIID& aIID,
NS_ADDREF_THIS(); NS_ADDREF_THIS();
return NS_OK; 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)) { if (aIID.Equals(kINetSupportIID)) {
*aInstancePtrResult = (void*) ((nsINetSupport*)this); *aInstancePtrResult = (void*) ((nsINetSupport*)this);
NS_ADDREF_THIS(); NS_ADDREF_THIS();
return NS_OK; return NS_OK;
} }
#endif
if (aIID.Equals(kISupportsIID)) { if (aIID.Equals(kISupportsIID)) {
*aInstancePtrResult = (void*) ((nsISupports*)((nsIBrowserWindow*)this)); *aInstancePtrResult = (void*) ((nsISupports*)((nsIBrowserWindow*)this));
NS_ADDREF_THIS(); NS_ADDREF_THIS();
@ -1845,17 +1856,40 @@ nsBrowserWindow::FocusAvailable(nsIWebShell* aFocusedWebShell, PRBool& aFocusTak
// Stream observer implementation // Stream observer implementation
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsBrowserWindow::OnProgress(nsISupports *ctxt, PRUint32 aProgress, PRUint32 aProgressMax)
#else
nsBrowserWindow::OnProgress(nsIURI* aURL, nsBrowserWindow::OnProgress(nsIURI* aURL,
PRUint32 aProgress, PRUint32 aProgress,
PRUint32 aProgressMax) 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) { if (mStatus) {
nsAutoString url; nsAutoString url;
if (nsnull != aURL) { if (nsnull != aURL) {
#ifdef NECKO
char* str;
aURL->GetSpec(&str);
#else
PRUnichar* str; PRUnichar* str;
aURL->ToString(&str); aURL->ToString(&str);
#endif
url = str; url = str;
#ifdef NECKO
nsCRT::free(str);
#else
delete[] str; delete[] str;
#endif
} }
url.Append(": progress "); url.Append(": progress ");
url.Append(aProgress, 10); url.Append(aProgress, 10);
@ -1871,7 +1905,11 @@ nsBrowserWindow::OnProgress(nsIURI* aURL,
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsBrowserWindow::OnStatus(nsISupports *ctxt, const PRUnichar *aMsg)
#else
nsBrowserWindow::OnStatus(nsIURI* aURL, const PRUnichar* aMsg) nsBrowserWindow::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
#endif
{ {
if (mStatus) { if (mStatus) {
PRUint32 size; PRUint32 size;
@ -1881,15 +1919,38 @@ nsBrowserWindow::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsBrowserWindow::OnStartBinding(nsISupports *ctxt)
#else
nsBrowserWindow::OnStartBinding(nsIURI* aURL, const char *aContentType) 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) { if (mStatus) {
nsAutoString url; nsAutoString url;
if (nsnull != aURL) { if (nsnull != aURL) {
#ifdef NECKO
char* str;
aURL->GetSpec(&str);
#else
PRUnichar* str; PRUnichar* str;
aURL->ToString(&str); aURL->ToString(&str);
#endif
url = str; url = str;
#ifdef NECKO
nsCRT::free(str);
#else
delete[] str; delete[] str;
#endif
} }
url.Append(": start"); url.Append(": start");
PRUint32 size; PRUint32 size;
@ -1899,17 +1960,40 @@ nsBrowserWindow::OnStartBinding(nsIURI* aURL, const char *aContentType)
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsBrowserWindow::OnStopBinding(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg)
#else
nsBrowserWindow::OnStopBinding(nsIURI* aURL, nsBrowserWindow::OnStopBinding(nsIURI* aURL,
nsresult status, nsresult status,
const PRUnichar* aMsg) 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) { if (mStatus) {
nsAutoString url; nsAutoString url;
if (nsnull != aURL) { if (nsnull != aURL) {
#ifdef NECKO
char* str;
aURL->GetSpec(&str);
#else
PRUnichar* str; PRUnichar* str;
aURL->ToString(&str); aURL->ToString(&str);
#endif
url = str; url = str;
#ifdef NECKO
nsCRT::free(str);
#else
delete[] str; delete[] str;
#endif
} }
url.Append(": stop"); url.Append(": stop");
PRUint32 size; PRUint32 size;

Просмотреть файл

@ -21,7 +21,11 @@
#include "nsIBrowserWindow.h" #include "nsIBrowserWindow.h"
#include "nsIStreamListener.h" #include "nsIStreamListener.h"
#ifdef NECKO
#include "nsIProgressEventSink.h"
#else
#include "nsINetSupport.h" #include "nsINetSupport.h"
#endif
#include "nsIWebShell.h" #include "nsIWebShell.h"
#include "nsIScriptContextOwner.h" #include "nsIScriptContextOwner.h"
#include "nsIDocumentLoaderObserver.h" #include "nsIDocumentLoaderObserver.h"
@ -58,7 +62,11 @@ class nsWebCrawler;
*/ */
class nsBrowserWindow : public nsIBrowserWindow, class nsBrowserWindow : public nsIBrowserWindow,
public nsIStreamObserver, public nsIStreamObserver,
#ifdef NECKO
public nsIProgressEventSink,
#else
public nsINetSupport, public nsINetSupport,
#endif
public nsIWebShellContainer public nsIWebShellContainer
{ {
public: public:
@ -97,11 +105,24 @@ public:
NS_IMETHOD GetWebShell(nsIWebShell*& aResult); NS_IMETHOD GetWebShell(nsIWebShell*& aResult);
NS_IMETHOD GetContentWebShell(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 // nsIStreamObserver
NS_IMETHOD OnStartBinding(nsIURI* aURL, const char *aContentType); NS_IMETHOD OnStartBinding(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax); NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg); NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg); NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg);
#endif
// nsIWebShellContainer // nsIWebShellContainer
NS_IMETHOD WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason); NS_IMETHOD WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason);

Просмотреть файл

@ -993,7 +993,11 @@ nsViewerApp::CreateRobot(nsBrowserWindow* aWindow)
nsCOMPtr<nsIDocument> doc; nsCOMPtr<nsIDocument> doc;
shell->GetDocument(getter_AddRefs(doc)); shell->GetDocument(getter_AddRefs(doc));
if (doc) { if (doc) {
#ifdef NECKO
char * str;
#else
const char * str; const char * str;
#endif
nsresult rv = doc->GetDocumentURL()->GetSpec(&str); nsresult rv = doc->GetDocumentURL()->GetSpec(&str);
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
return rv; return rv;
@ -1007,6 +1011,9 @@ nsViewerApp::CreateRobot(nsBrowserWindow* aWindow)
gDebugRobotLoads, gDebugRobotLoads,
PL_strdup(gVerifyDir), PL_strdup(gVerifyDir),
yieldProc); yieldProc);
#endif
#ifdef NECKO
nsCRT::free(str);
#endif #endif
} }
} }

Просмотреть файл

@ -212,19 +212,41 @@ nsWebCrawler::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL,
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsWebCrawler::OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
PRInt32 aStatus,
nsIDocumentLoaderObserver* aObserver)
#else
nsWebCrawler::OnEndDocumentLoad(nsIDocumentLoader* loader, nsWebCrawler::OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsIURI* aURL,
PRInt32 aStatus, PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver) 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) { if (nsnull == aURL) {
return NS_OK; return NS_OK;
} }
if (mVerbose) { if (mVerbose) {
#ifdef NECKO
char* spec;
#else
const char* spec; const char* spec;
#endif
aURL->GetSpec(&spec); aURL->GetSpec(&spec);
printf("Crawler: done loading %s\n", 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 // Make sure the document bits make it to the screen at least once
@ -262,9 +284,17 @@ nsWebCrawler::OnEndDocumentLoad(nsIDocumentLoader* loader,
} }
} }
else { else {
#ifdef NECKO
char* file;
(void)aURL->GetPath(&file);
#else
const char* file; const char* file;
(void)aURL->GetFile(&file); (void)aURL->GetFile(&file);
#endif
printf("could not open output file for %s\n", file); printf("could not open output file for %s\n", file);
#ifdef NECKO
nsCRT::free(file);
#endif
} }
} }
else else
@ -302,40 +332,72 @@ nsWebCrawler::OnEndDocumentLoad(nsIDocumentLoader* loader,
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsWebCrawler::OnStartURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
const char* aContentType,
nsIContentViewer* aViewer)
#else
nsWebCrawler::OnStartURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, nsWebCrawler::OnStartURLLoad(nsIDocumentLoader* loader, nsIURI* aURL,
const char* aContentType, const char* aContentType,
nsIContentViewer* aViewer) nsIContentViewer* aViewer)
#endif
{ {
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsWebCrawler::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
PRUint32 aProgress,
PRUint32 aProgressMax)
#else
nsWebCrawler::OnProgressURLLoad(nsIDocumentLoader* loader, nsWebCrawler::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, PRUint32 aProgress, nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax) PRUint32 aProgressMax)
#endif
{ {
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsWebCrawler::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
nsString& aMsg)
#else
nsWebCrawler::OnStatusURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, nsWebCrawler::OnStatusURLLoad(nsIDocumentLoader* loader, nsIURI* aURL,
nsString& aMsg) nsString& aMsg)
#endif
{ {
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsWebCrawler::OnEndURLLoad(nsIDocumentLoader* loader, nsIChannel* channel,
PRInt32 aStatus)
#else
nsWebCrawler::OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL, nsWebCrawler::OnEndURLLoad(nsIDocumentLoader* loader, nsIURI* aURL,
PRInt32 aStatus) PRInt32 aStatus)
#endif
{ {
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsWebCrawler::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIChannel* channel,
const char *aContentType,
const char *aCommand)
#else
nsWebCrawler::HandleUnknownContentType(nsIDocumentLoader* loader, nsWebCrawler::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURI *aURL, nsIURI *aURL,
const char *aContentType, const char *aContentType,
const char *aCommand) const char *aCommand)
#endif
{ {
return NS_OK; return NS_OK;
} }
@ -348,9 +410,17 @@ nsWebCrawler::GetOutputFile(nsIURI *aURL, nsString& aOutputName)
if (nsnull!=aURL) if (nsnull!=aURL)
{ {
char *inputFileName; char *inputFileName;
#ifdef NECKO
char* file;
(void)aURL->GetPath(&file);
#else
const char* file; const char* file;
(void)aURL->GetFile(&file); (void)aURL->GetFile(&file);
#endif
nsAutoString inputFileFullPath(file); nsAutoString inputFileFullPath(file);
#ifdef NECKO
nsCRT::free(file);
#endif
PRInt32 fileNameOffset = inputFileFullPath.RFind('/'); PRInt32 fileNameOffset = inputFileFullPath.RFind('/');
if (-1==fileNameOffset) if (-1==fileNameOffset)
{ {
@ -538,7 +608,11 @@ nsWebCrawler::OkToLoad(const nsString& aURLSpec)
#endif // NECKO #endif // NECKO
if (NS_OK == rv) { if (NS_OK == rv) {
#ifdef NECKO
char* host;
#else
const char* host; const char* host;
#endif
rv = url->GetHost(&host); rv = url->GetHost(&host);
if (rv == NS_OK) { if (rv == NS_OK) {
PRInt32 hostlen = PL_strlen(host); PRInt32 hostlen = PL_strlen(host);
@ -569,6 +643,9 @@ nsWebCrawler::OkToLoad(const nsString& aURLSpec)
} }
} }
ok = PR_FALSE; ok = PR_FALSE;
#ifdef NECKO
nsCRT::free(host);
#endif
} }
NS_RELEASE(url); NS_RELEASE(url);
} }

Просмотреть файл

@ -43,6 +43,15 @@ public:
NS_DECL_ISUPPORTS NS_DECL_ISUPPORTS
// nsIDocumentLoaderObserver // 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, NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL,
const char* aCommand); const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aURL, NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aURL,
@ -62,6 +71,7 @@ public:
nsIURI *aURL, nsIURI *aURL,
const char *aContentType, const char *aContentType,
const char *aCommand); const char *aCommand);
#endif
// Add a url to load // Add a url to load
void AddURL(const nsString& aURL); void AddURL(const nsString& aURL);

Просмотреть файл

@ -28,7 +28,10 @@
#include "nsXPBaseWindow.h" #include "nsXPBaseWindow.h"
#endif #endif
#ifdef NECKO
#else
#include "nsINetSupport.h" #include "nsINetSupport.h"
#endif
#include "nsIAppShell.h" #include "nsIAppShell.h"
#include "nsIWidget.h" #include "nsIWidget.h"
#include "nsIDOMDocument.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(kIDOMElementIID, NS_IDOMELEMENT_IID);
static NS_DEFINE_IID(kIDOMHTMLDocumentIID, NS_IDOMHTMLDOCUMENT_IID); static NS_DEFINE_IID(kIDOMHTMLDocumentIID, NS_IDOMHTMLDOCUMENT_IID);
#ifdef NECKO
#else
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID); static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
#endif
//---------------------------------------------------------------------- //----------------------------------------------------------------------
nsXPBaseWindow::nsXPBaseWindow() : nsXPBaseWindow::nsXPBaseWindow() :
@ -136,11 +142,14 @@ nsresult nsXPBaseWindow::QueryInterface(const nsIID& aIID,
NS_ADDREF_THIS(); NS_ADDREF_THIS();
return NS_OK; return NS_OK;
} }
#ifdef NECKO
#else
if (aIID.Equals(kINetSupportIID)) { if (aIID.Equals(kINetSupportIID)) {
*aInstancePtrResult = (void*) ((nsINetSupport*)this); *aInstancePtrResult = (void*) ((nsINetSupport*)this);
NS_ADDREF_THIS(); NS_ADDREF_THIS();
return NS_OK; return NS_OK;
} }
#endif
if (aIID.Equals(kIDOMMouseListenerIID)) { if (aIID.Equals(kIDOMMouseListenerIID)) {
NS_ADDREF_THIS(); // Increase reference count for caller NS_ADDREF_THIS(); // Increase reference count for caller
*aInstancePtrResult = (void *)((nsIDOMMouseListener*)this); *aInstancePtrResult = (void *)((nsIDOMMouseListener*)this);
@ -574,7 +583,7 @@ nsXPBaseWindow::CreatePopup(nsIDOMElement* aElement, nsIDOMElement* aPopupConten
//---------------------------------------- //----------------------------------------
// Stream observer implementation // Stream observer implementation
#ifndef NECKO
NS_IMETHODIMP NS_IMETHODIMP
nsXPBaseWindow::OnProgress(nsIURI* aURL, nsXPBaseWindow::OnProgress(nsIURI* aURL,
PRUint32 aProgress, PRUint32 aProgress,
@ -588,15 +597,25 @@ NS_IMETHODIMP nsXPBaseWindow::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
{ {
return NS_OK; return NS_OK;
} }
#endif
//---------------------------------------- //----------------------------------------
#ifdef NECKO
NS_IMETHODIMP nsXPBaseWindow::OnStartBinding(nsISupports *ctxt)
#else
NS_IMETHODIMP nsXPBaseWindow::OnStartBinding(nsIURI* aURL, const char *aContentType) NS_IMETHODIMP nsXPBaseWindow::OnStartBinding(nsIURI* aURL, const char *aContentType)
#endif
{ {
return NS_OK; 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) NS_IMETHODIMP nsXPBaseWindow::OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg)
#endif
{ {
return NS_OK; return NS_OK;
} }

Просмотреть файл

@ -21,7 +21,10 @@
#include "nsIXPBaseWindow.h" #include "nsIXPBaseWindow.h"
#include "nsIStreamListener.h" #include "nsIStreamListener.h"
#ifdef NECKO
#else
#include "nsINetSupport.h" #include "nsINetSupport.h"
#endif
#include "nsIWebShell.h" #include "nsIWebShell.h"
#include "nsIScriptContextOwner.h" #include "nsIScriptContextOwner.h"
#include "nsString.h" #include "nsString.h"
@ -43,7 +46,10 @@ class nsIPref;
*/ */
class nsXPBaseWindow : public nsIXPBaseWindow, class nsXPBaseWindow : public nsIXPBaseWindow,
public nsIStreamObserver, public nsIStreamObserver,
#ifdef NECKO
#else
public nsINetSupport, public nsINetSupport,
#endif
public nsIWebShellContainer, public nsIWebShellContainer,
public nsIDOMMouseListener public nsIDOMMouseListener
{ {
@ -83,11 +89,21 @@ public:
NS_IMETHOD LoadURL(const nsString &aURL); 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 // nsIStreamObserver
NS_IMETHOD OnStartBinding(nsIURI* aURL, const char *aContentType); NS_IMETHOD OnStartBinding(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax); NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg); NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg); NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg);
#endif
// nsIWebShellContainer // nsIWebShellContainer
NS_IMETHOD WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason); NS_IMETHOD WillLoadURL(nsIWebShell* aShell, const PRUnichar* aURL, nsLoadType aReason);

Просмотреть файл

@ -860,7 +860,11 @@ char *str;
if (gImageGroup == NULL) if (gImageGroup == NULL)
{ {
nsIDeviceContext *deviceCtx = scribbleData.mContext; 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) if (NS_NewImageGroup(&gImageGroup) != NS_OK || gImageGroup->Init(deviceCtx, nsnull) != NS_OK)
#endif
{ {
NS_RELEASE(deviceCtx); NS_RELEASE(deviceCtx);
return; return;

Просмотреть файл

@ -35,7 +35,10 @@ MYLIBS= \
$(LIBNSPR) \ $(LIBNSPR) \
$(DIST)\lib\raptorgfxwin.lib \ $(DIST)\lib\raptorgfxwin.lib \
$(DIST)\lib\raptorwidget.lib \ $(DIST)\lib\raptorwidget.lib \
!ifdef NECKO
!else
$(DIST)\lib\netlib.lib\ $(DIST)\lib\netlib.lib\
!endif
$(NULL) $(NULL)
LLIBS= $(MYLIBS) \ LLIBS= $(MYLIBS) \

Просмотреть файл

@ -62,15 +62,23 @@ REQUIRES=libreg
LINCS= \ LINCS= \
-Iservices \ -Iservices \
!ifdef NECKO
-I$(PUBLIC)\necko \
!else
!ifdef MODULAR_NETLIB !ifdef MODULAR_NETLIB
-I$(PUBLIC)\netlib \ -I$(PUBLIC)\netlib \
!endif
!endif !endif
-I$(PUBLIC)\xpcom -I$(PUBLIC)\xpcom
LLIBS= \ LLIBS= \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
!ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
!ifdef MODULAR_NETLIB !ifdef MODULAR_NETLIB
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
!endif !endif
$(LIBNSPR) \ $(LIBNSPR) \
$(DIST)\lib\plc3.lib $(DIST)\lib\plc3.lib

Просмотреть файл

@ -36,7 +36,11 @@ LINCS= \
-I$(XPDIST)\public\browser \ -I$(XPDIST)\public\browser \
-I$(XPDIST)\public\txtsvc \ -I$(XPDIST)\public\txtsvc \
-I$(XPDIST)\public\js \ -I$(XPDIST)\public\js \
!ifdef NECKO
-I$(XPDIST)\public\necko \
!else
-I$(XPDIST)\public\netlib \ -I$(XPDIST)\public\netlib \
!endif
-I$(XPDIST)\public\network \ -I$(XPDIST)\public\network \
-I$(XPDIST)\public\dom \ -I$(XPDIST)\public\dom \
-I$(XPDIST)\public\xpcom \ -I$(XPDIST)\public\xpcom \
@ -52,7 +56,11 @@ LINCS= \
$(NULL) $(NULL)
LLIBS = \ LLIBS = \
!ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
$(DIST)\lib\xppref32.lib \ $(DIST)\lib\xppref32.lib \
$(DIST)\lib\xplib.lib \ $(DIST)\lib\xplib.lib \

Просмотреть файл

@ -37,12 +37,12 @@
#include "pratom.h" #include "pratom.h"
#include "prmem.h" #include "prmem.h"
#include "prio.h" #include "prio.h"
#include "mkutils.h"
#include "prefapi.h" #include "prefapi.h"
#include "nsIURL.h" #include "nsIURL.h"
#include "nsINetlibURL.h"
#ifndef NECKO #ifndef NECKO
#include "mkutils.h"
#include "nsINetlibURL.h"
#include "nsINetService.h" #include "nsINetService.h"
#endif // NECKO #endif // NECKO
#include "nsIInputStream.h" #include "nsIInputStream.h"
@ -77,9 +77,9 @@ static NS_DEFINE_IID(kIScriptExternalNameSetIID, NS_ISCRIPTEXTERNALNAMESET_IID);
#ifndef NECKO #ifndef NECKO
static NS_DEFINE_IID(kInetServiceIID, NS_INETSERVICE_IID); static NS_DEFINE_IID(kInetServiceIID, NS_INETSERVICE_IID);
static NS_DEFINE_IID(kInetServiceCID, NS_NETSERVICE_CID); static NS_DEFINE_IID(kInetServiceCID, NS_NETSERVICE_CID);
static NS_DEFINE_IID(kInetLibURLIID, NS_INETLIBURL_IID);
#endif // NECKO #endif // NECKO
static NS_DEFINE_IID(kInetLibURLIID, NS_INETLIBURL_IID);
static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID); static NS_DEFINE_IID(kIStreamListenerIID, NS_ISTREAMLISTENER_IID);
static NS_DEFINE_IID(kBrowserWindowCID, NS_BROWSER_WINDOW_CID); 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(kIBrowserAppCoreIID, NS_IDOMBROWSERAPPCORE_IID);
static NS_DEFINE_IID(kIDOMDocumentIID, nsIDOMDocument::GetIID()); static NS_DEFINE_IID(kIDOMDocumentIID, nsIDOMDocument::GetIID());
static NS_DEFINE_IID(kIDocumentIID, nsIDocument::GetIID()); static NS_DEFINE_IID(kIDocumentIID, nsIDocument::GetIID());
#ifdef NECKO
#else
static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID); static NS_DEFINE_IID(kINetSupportIID, NS_INETSUPPORT_IID);
#endif
static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID); static NS_DEFINE_IID(kIStreamObserverIID, NS_ISTREAMOBSERVER_IID);
static NS_DEFINE_IID(kIWebShellWindowIID, NS_IWEBSHELL_WINDOW_IID); static NS_DEFINE_IID(kIWebShellWindowIID, NS_IWEBSHELL_WINDOW_IID);
static NS_DEFINE_IID(kIGlobalHistoryIID, NS_IGLOBALHISTORY_IID); static NS_DEFINE_IID(kIGlobalHistoryIID, NS_IGLOBALHISTORY_IID);
@ -195,11 +198,14 @@ nsBrowserAppCore::QueryInterface(REFNSIID aIID,void** aInstancePtr)
AddRef(); AddRef();
return NS_OK; return NS_OK;
} }
#ifdef NECKO
#else
if (aIID.Equals(kINetSupportIID)) { if (aIID.Equals(kINetSupportIID)) {
*aInstancePtr = (void*) ((nsINetSupport*)this); *aInstancePtr = (void*) ((nsINetSupport*)this);
NS_ADDREF_THIS(); NS_ADDREF_THIS();
return NS_OK; return NS_OK;
} }
#endif
/* This isn't supported any more /* This isn't supported any more
if (aIID.Equals(kIStreamObserverIID)) { if (aIID.Equals(kIStreamObserverIID)) {
*aInstancePtr = (void*) ((nsIStreamObserver*)this); *aInstancePtr = (void*) ((nsIStreamObserver*)this);
@ -1045,11 +1051,18 @@ nsBrowserAppCore::OnStartDocumentLoad(nsIDocumentLoader* aLoader, nsIURI* aURL,
NS_WITH_SERVICE(nsIObserverService, observer, NS_OBSERVERSERVICE_PROGID, &rv); NS_WITH_SERVICE(nsIObserverService, observer, NS_OBSERVERSERVICE_PROGID, &rv);
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
#ifdef NECKO
char* url;
#else
const char* url; const char* url;
#endif
rv = aURL->GetSpec(&url); rv = aURL->GetSpec(&url);
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
nsAutoString urlStr(url); nsAutoString urlStr(url);
#ifdef NECKO
nsCRT::free(url);
#endif
nsAutoString kStartDocumentLoad("StartDocumentLoad"); nsAutoString kStartDocumentLoad("StartDocumentLoad");
rv = observer->Notify(mContentWindow, rv = observer->Notify(mContentWindow,
@ -1073,22 +1086,28 @@ nsBrowserAppCore::OnStartDocumentLoad(nsIDocumentLoader* aLoader, nsIURI* aURL,
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsBrowserAppCore::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIChannel* channel, PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver)
#else
nsBrowserAppCore::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIURI *aUrl, PRInt32 aStatus, nsBrowserAppCore::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIURI *aUrl, PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver) nsIDocumentLoaderObserver * aObserver)
#endif
{ {
NS_PRECONDITION(aLoader != nsnull, "null ptr"); NS_PRECONDITION(aLoader != nsnull, "null ptr");
if (! aLoader) if (! aLoader)
return NS_ERROR_NULL_POINTER; 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"); NS_PRECONDITION(aUrl != nsnull, "null ptr");
if (! aUrl) if (! aUrl)
return NS_ERROR_NULL_POINTER; return NS_ERROR_NULL_POINTER;
#endif
const char* spec =nsnull;
aUrl->GetSpec(&spec);
nsresult rv; nsresult rv;
nsIWebShell * aWebShell= nsnull, * parent = nsnull; nsIWebShell * aWebShell= nsnull, * parent = nsnull;
@ -1098,7 +1117,14 @@ nsBrowserAppCore::OnEndDocumentLoad(nsIDocumentLoader* aLoader, nsIURI *aUrl, PR
NS_WITH_SERVICE(nsIObserverService, observer, NS_OBSERVERSERVICE_PROGID, &rv); NS_WITH_SERVICE(nsIObserverService, observer, NS_OBSERVERSERVICE_PROGID, &rv);
if (NS_FAILED(rv)) return 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; const char* url;
#endif
rv = aUrl->GetSpec(&url); rv = aUrl->GetSpec(&url);
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
@ -1155,39 +1181,50 @@ done:
/* To satisfy a request from the QA group */ /* To satisfy a request from the QA group */
if (aStatus == NS_OK) { if (aStatus == NS_OK) {
fprintf(stdout, "Document %s loaded successfully\n", spec); fprintf(stdout, "Document %s loaded successfully\n", url);
fflush(stdout); fflush(stdout);
} }
else { else {
fprintf(stdout, "Error loading URL %s \n", spec); fprintf(stdout, "Error loading URL %s \n", url);
fflush(stdout); fflush(stdout);
} }
end: end:
setAttribute( mWebShell, "Browser:Throbber", "busy", "false" ); setAttribute( mWebShell, "Browser:Throbber", "busy", "false" );
PRBool result=PR_TRUE; PRBool result=PR_TRUE;
// Check with sessionHistory if you can go forward // Check with sessionHistory if you can go forward
canForward(result); canForward(result);
setAttribute(mWebShell, "canGoForward", "disabled", (result == PR_TRUE) ? "" : "true"); setAttribute(mWebShell, "canGoForward", "disabled", (result == PR_TRUE) ? "" : "true");
// Check with sessionHistory if you can go back // Check with sessionHistory if you can go back
canBack(result); canBack(result);
setAttribute(mWebShell, "canGoBack", "disabled", (result == PR_TRUE) ? "" : "true"); setAttribute(mWebShell, "canGoBack", "disabled", (result == PR_TRUE) ? "" : "true");
//Disable the Stop button //Disable the Stop button
setAttribute( mWebShell, "canStop", "disabled", "true" ); setAttribute( mWebShell, "canStop", "disabled", "true" );
//Enable the reload button //Enable the reload button
setAttribute(mWebShell, "canReload", "disabled", ""); setAttribute(mWebShell, "canReload", "disabled", "");
return NS_OK; #ifdef NECKO
nsCRT::free(url);
#endif
return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsBrowserAppCore::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIChannel* channel,
const char *aContentType,
const char *aCommand )
#else
nsBrowserAppCore::HandleUnknownContentType(nsIDocumentLoader* loader, nsBrowserAppCore::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURI *aURL, nsIURI *aURL,
const char *aContentType, const char *aContentType,
const char *aCommand ) { const char *aCommand )
#endif
{
nsresult rv = NS_OK; nsresult rv = NS_OK;
// Turn off the indicators in the chrome. // Turn off the indicators in the chrome.
@ -1201,7 +1238,11 @@ nsBrowserAppCore::HandleUnknownContentType(nsIDocumentLoader* loader,
if ( NS_SUCCEEDED( rv ) ) { if ( NS_SUCCEEDED( rv ) ) {
/* Have handler take care of this. */ /* Have handler take care of this. */
#ifdef NECKO
rv = handler->HandleUnknownContentType( channel, aContentType, loader );
#else
rv = handler->HandleUnknownContentType( aURL, aContentType, loader ); rv = handler->HandleUnknownContentType( aURL, aContentType, loader );
#endif
// Release the unknown content type handler service object. // Release the unknown content type handler service object.
nsServiceManager::ReleaseService( NS_IUNKNOWNCONTENTTYPEHANDLER_PROGID, handler ); nsServiceManager::ReleaseService( NS_IUNKNOWNCONTENTTYPEHANDLER_PROGID, handler );
@ -1216,30 +1257,57 @@ nsBrowserAppCore::HandleUnknownContentType(nsIDocumentLoader* loader,
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsBrowserAppCore::OnStartURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel, const char* aContentType,
nsIContentViewer* aViewer)
#else
nsBrowserAppCore::OnStartURLLoad(nsIDocumentLoader* loader, nsBrowserAppCore::OnStartURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, const char* aContentType, nsIURI* aURL, const char* aContentType,
nsIContentViewer* aViewer) nsIContentViewer* aViewer)
#endif
{ {
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsBrowserAppCore::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel, PRUint32 aProgress,
PRUint32 aProgressMax)
#else
nsBrowserAppCore::OnProgressURLLoad(nsIDocumentLoader* loader, nsBrowserAppCore::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, PRUint32 aProgress, nsIURI* aURL, PRUint32 aProgress,
PRUint32 aProgressMax) PRUint32 aProgressMax)
#endif
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
PRUint32 progress = aProgressMax ? ( aProgress * 100 ) / aProgressMax : 0; 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; const char *urlString = 0;
#endif
aURL->GetSpec( &urlString ); aURL->GetSpec( &urlString );
#ifdef NECKO
nsCRT::free(urlString);
#endif
return rv; return rv;
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsBrowserAppCore::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel, nsString& aMsg)
#else
nsBrowserAppCore::OnStatusURLLoad(nsIDocumentLoader* loader, nsBrowserAppCore::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsString& aMsg) nsIURI* aURL, nsString& aMsg)
#endif
{ {
nsresult rv = setAttribute( mWebShell, "Browser:Status", "value", aMsg ); nsresult rv = setAttribute( mWebShell, "Browser:Status", "value", aMsg );
return rv; return rv;
@ -1247,8 +1315,13 @@ nsBrowserAppCore::OnStatusURLLoad(nsIDocumentLoader* loader,
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsBrowserAppCore::OnEndURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel, PRInt32 aStatus)
#else
nsBrowserAppCore::OnEndURLLoad(nsIDocumentLoader* loader, nsBrowserAppCore::OnEndURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, PRInt32 aStatus) nsIURI* aURL, PRInt32 aStatus)
#endif
{ {
return NS_OK; 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 * 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 * Version 1.0 (the "NPL"); you may not use this file except in
@ -26,7 +26,10 @@
#include "nsIDOMBrowserAppCore.h" #include "nsIDOMBrowserAppCore.h"
#include "nsBaseAppCore.h" #include "nsBaseAppCore.h"
#ifdef NECKO
#else
#include "nsINetSupport.h" #include "nsINetSupport.h"
#endif
#include "nsIStreamObserver.h" #include "nsIStreamObserver.h"
#include "nsIDocumentLoaderObserver.h" #include "nsIDocumentLoaderObserver.h"
#include "nsIObserver.h" #include "nsIObserver.h"
@ -48,7 +51,10 @@ class nsIFindComponent;
class nsBrowserAppCore : public nsBaseAppCore, class nsBrowserAppCore : public nsBaseAppCore,
public nsIDOMBrowserAppCore, public nsIDOMBrowserAppCore,
#ifdef NECKO
#else
public nsINetSupport, public nsINetSupport,
#endif
// public nsIStreamObserver, // public nsIStreamObserver,
public nsIDocumentLoaderObserver, public nsIDocumentLoaderObserver,
public nsIObserver, public nsIObserver,
@ -95,6 +101,15 @@ class nsBrowserAppCore : public nsBaseAppCore,
NS_IMETHOD LoadInitialPage(); NS_IMETHOD LoadInitialPage();
// nsIDocumentLoaderObserver // 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 OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus, NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, nsIURI *aUrl, PRInt32 aStatus,
nsIDocumentLoaderObserver * aObserver); nsIDocumentLoaderObserver * aObserver);
@ -109,7 +124,7 @@ class nsBrowserAppCore : public nsBaseAppCore,
nsIURI *aURL, nsIURI *aURL,
const char *aContentType, const char *aContentType,
const char *aCommand ); const char *aCommand );
#endif
// nsINetSupport // nsINetSupport
NS_IMETHOD_(void) Alert(const nsString &aText); NS_IMETHOD_(void) Alert(const nsString &aText);
@ -136,7 +151,9 @@ class nsBrowserAppCore : public nsBaseAppCore,
NS_IMETHOD GoForward(nsIWebShell * aPrev); NS_IMETHOD GoForward(nsIWebShell * aPrev);
NS_IMETHOD GoBack(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); NS_IMETHOD Reload(nsIWebShell * aPrev, nsURLReloadType aType);
#endif /* NECKO */ #endif /* NECKO */

Просмотреть файл

@ -65,7 +65,7 @@ public:
* Reload the current history entry * Reload the current history entry
*/ */
#ifdef NECKO #ifdef NECKO
NS_IMETHOD Reload(PRBool bypassCache, PRBool bypassProxy) = 0; NS_IMETHOD Reload(nsIWebShell * aPrev, PRUint32 aReloadFlags) = 0;
#else #else
NS_IMETHOD Reload(nsIWebShell * aPrev, nsURLReloadType aReloadType) = 0; NS_IMETHOD Reload(nsIWebShell * aPrev, nsURLReloadType aReloadType) = 0;
#endif #endif

Просмотреть файл

@ -62,7 +62,11 @@ LINCS=-I$(PUBLIC)\raptor \
-I$(PUBLIC)\pref \ -I$(PUBLIC)\pref \
-I$(PUBLIC)\profile \ -I$(PUBLIC)\profile \
-I$(PUBLIC)\appcores \ -I$(PUBLIC)\appcores \
!ifdef NECKO
-I$(PUBLIC)\necko \
!else
-I$(PUBLIC)\netlib \ -I$(PUBLIC)\netlib \
!endif
-I$(PUBLIC)\rdf \ -I$(PUBLIC)\rdf \
-I$(PUBLIC)\pics \ -I$(PUBLIC)\pics \
-I$(PUBLIC)\xpfe\components \ -I$(PUBLIC)\xpfe\components \
@ -82,10 +86,14 @@ LLIBS= \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
$(DIST)\lib\raptorgfxwin.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 \ $(DIST)\lib\netlib.lib \
$(DIST)\lib\js3250.lib \ !endif
$(DIST)\lib\jsdombase_s.lib \ $(DIST)\lib\js3250.lib \
$(DIST)\lib\jsdomevents_s.lib \ $(DIST)\lib\jsdombase_s.lib \
$(DIST)\lib\jsdomevents_s.lib \
$(LIBNSPR) \ $(LIBNSPR) \
$(NULL) $(NULL)

Просмотреть файл

@ -568,7 +568,11 @@ public:
/** /**
* Reload the current history entry * Reload the current history entry
*/ */
#ifdef NECKO
NS_IMETHOD Reload(nsIWebShell * aPrev, PRUint32 aReloadFlags);
#else
NS_IMETHOD Reload(nsIWebShell * aPrev, nsURLReloadType aReloadType); NS_IMETHOD Reload(nsIWebShell * aPrev, nsURLReloadType aReloadType);
#endif
/** /**
* whether you can go forward in History * whether you can go forward in History
@ -961,7 +965,11 @@ nsSessionHistory::Goto(PRInt32 aGotoIndex, nsIWebShell * prev, PRBool aIsReload)
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsSessionHistory::Reload(nsIWebShell * aPrev, PRUint32 aReloadFlags)
#else
nsSessionHistory::Reload(nsIWebShell * aPrev, nsURLReloadType aReloadType) nsSessionHistory::Reload(nsIWebShell * aPrev, nsURLReloadType aReloadType)
#endif
{ {
// Call goto with the Reload flag set to true // Call goto with the Reload flag set to true

Просмотреть файл

@ -375,11 +375,18 @@ nsresult nsWebShellWindow::Initialize(nsIWebShellWindow* aParent,
NS_IF_ADDREF(mCallbacks); NS_IF_ADDREF(mCallbacks);
if (nsnull != aUrl) { if (nsnull != aUrl) {
#ifdef NECKO
char *tmpStr = NULL;
#else
const char *tmpStr = NULL; const char *tmpStr = NULL;
#endif
nsString urlString; nsString urlString;
aUrl->GetSpec(&tmpStr); aUrl->GetSpec(&tmpStr);
urlString = tmpStr; urlString = tmpStr;
#ifdef NECKO
nsCRT::free(tmpStr);
#endif
mWebShell->LoadURL(urlString.GetUnicode()); mWebShell->LoadURL(urlString.GetUnicode());
} }
@ -1596,9 +1603,15 @@ nsWebShellWindow::OnStartDocumentLoad(nsIDocumentLoader* loader,
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsWebShellWindow::OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIChannel* channel, PRInt32 aStatus,
nsIDocumentLoaderObserver * aDocObserver)
#else
nsWebShellWindow::OnEndDocumentLoad(nsIDocumentLoader* loader, nsWebShellWindow::OnEndDocumentLoad(nsIDocumentLoader* loader,
nsIURI* aURL, PRInt32 aStatus, nsIURI* aURL, PRInt32 aStatus,
nsIDocumentLoaderObserver * aDocObserver) nsIDocumentLoaderObserver * aDocObserver)
#endif
{ {
#ifdef DEBUG_MENUSDEL #ifdef DEBUG_MENUSDEL
printf("OnEndDocumentLoad\n"); printf("OnEndDocumentLoad\n");
@ -1706,42 +1719,73 @@ nsWebShellWindow::OnEndDocumentLoad(nsIDocumentLoader* loader,
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsWebShellWindow::OnStartURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
const char* aContentType,
nsIContentViewer* aViewer)
#else
nsWebShellWindow::OnStartURLLoad(nsIDocumentLoader* loader, nsWebShellWindow::OnStartURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsIURI* aURL,
const char* aContentType, const char* aContentType,
nsIContentViewer* aViewer) nsIContentViewer* aViewer)
#endif
{ {
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsWebShellWindow::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel,
PRUint32 aProgress,
PRUint32 aProgressMax)
#else
nsWebShellWindow::OnProgressURLLoad(nsIDocumentLoader* loader, nsWebShellWindow::OnProgressURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsIURI* aURL,
PRUint32 aProgress, PRUint32 aProgress,
PRUint32 aProgressMax) PRUint32 aProgressMax)
#endif
{ {
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsWebShellWindow::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel, nsString& aMsg)
#else
nsWebShellWindow::OnStatusURLLoad(nsIDocumentLoader* loader, nsWebShellWindow::OnStatusURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, nsString& aMsg) nsIURI* aURL, nsString& aMsg)
#endif
{ {
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsWebShellWindow::OnEndURLLoad(nsIDocumentLoader* loader,
nsIChannel* channel, PRInt32 aStatus)
#else
nsWebShellWindow::OnEndURLLoad(nsIDocumentLoader* loader, nsWebShellWindow::OnEndURLLoad(nsIDocumentLoader* loader,
nsIURI* aURL, PRInt32 aStatus) nsIURI* aURL, PRInt32 aStatus)
#endif
{ {
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsWebShellWindow::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIChannel* channel,
const char *aContentType,
const char *aCommand )
#else
nsWebShellWindow::HandleUnknownContentType(nsIDocumentLoader* loader, nsWebShellWindow::HandleUnknownContentType(nsIDocumentLoader* loader,
nsIURI* aURL, nsIURI* aURL,
const char *aContentType, const char *aContentType,
const char *aCommand ) const char *aCommand )
#endif
{ {
return NS_OK; return NS_OK;
} }
@ -2181,9 +2225,19 @@ void nsWebShellWindow::LoadContentAreas() {
docViewer->GetDocument(*getter_AddRefs(doc)); docViewer->GetDocument(*getter_AddRefs(doc));
nsCOMPtr<nsIURI> mainURL = getter_AddRefs(doc->GetDocumentURL()); nsCOMPtr<nsIURI> mainURL = getter_AddRefs(doc->GetDocumentURL());
if (mainURL) { if (mainURL) {
#ifdef NECKO
char *search = nsnull;
nsCOMPtr<nsIURL> url = do_QueryInterface(mainURL);
if (url)
url->GetQuery(&search);
#else
const char *search; const char *search;
mainURL->GetSearch(&search); mainURL->GetSearch(&search);
#endif
searchSpec = search; searchSpec = search;
#ifdef NECKO
nsCRT::free(search);
#endif
} }
} }
} }

Просмотреть файл

@ -134,6 +134,15 @@ public:
const nsString& aAnchorAlignment); const nsString& aAnchorAlignment);
// nsIDocumentLoaderObserver // 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, NS_IMETHOD OnStartDocumentLoad(nsIDocumentLoader* loader,
nsIURI* aURL, const char* aCommand); nsIURI* aURL, const char* aCommand);
NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader, NS_IMETHOD OnEndDocumentLoad(nsIDocumentLoader* loader,
@ -153,7 +162,7 @@ public:
nsIURI* aURL, nsIURI* aURL,
const char *aContentType, const char *aContentType,
const char *aCommand ); const char *aCommand );
#endif
// nsIDocumentObserver // nsIDocumentObserver
NS_IMETHOD BeginUpdate(nsIDocument *aDocument); NS_IMETHOD BeginUpdate(nsIDocument *aDocument);

Просмотреть файл

@ -34,7 +34,11 @@ CPP_OBJS= \
LINCS=-I$(PUBLIC)\raptor \ LINCS=-I$(PUBLIC)\raptor \
-I$(PUBLIC)\xpcom \ -I$(PUBLIC)\xpcom \
-I$(PUBLIC)\base \ -I$(PUBLIC)\base \
!ifdef NECKO
-I$(PUBLIC)\necko \
!else
-I$(PUBLIC)\netlib \ -I$(PUBLIC)\netlib \
!endif
-I$(PUBLIC)\pref \ -I$(PUBLIC)\pref \
-I$(PUBLIC)\js \ -I$(PUBLIC)\js \
-I$(PUBLIC)\dom \ -I$(PUBLIC)\dom \
@ -67,10 +71,14 @@ LCFLAGS = \
# These are the libraries we need to link with to create the exe # These are the libraries we need to link with to create the exe
LLIBS= \ LLIBS= \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
$(DIST)\lib\raptorgfxwin.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 \ $(DIST)\lib\netlib.lib \
!endif
$(LIBNSPR) \ $(LIBNSPR) \
$(NULL) $(NULL)

Просмотреть файл

@ -20,9 +20,7 @@
#include "nsIComponentManager.h" #include "nsIComponentManager.h"
#include "nsIURL.h" #include "nsIURL.h"
#ifdef NECKO #ifdef NECKO
#include "nsIIOService.h" #include "nsNeckoUtil.h"
#include "nsIServiceManager.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO #endif // NECKO
#include "nsIWidget.h" #include "nsIWidget.h"
#include "nsIWebShellWindow.h" #include "nsIWebShellWindow.h"
@ -160,10 +158,6 @@ int main(int argc, char* argv[])
nsIDOMAppCoresManager *appCoresManager = nsnull; nsIDOMAppCoresManager *appCoresManager = nsnull;
nsIURI* url = nsnull; nsIURI* url = nsnull;
nsIPref *prefs = nsnull; nsIPref *prefs = nsnull;
#ifdef NECKO
nsIIOService* service = nsnull;
nsIURI *uri = nsnull;
#endif // NECKO
// initialization for Full Circle // initialization for Full Circle
#ifdef MOZ_FULLCIRCLE #ifdef MOZ_FULLCIRCLE
@ -536,16 +530,7 @@ int main(int argc, char* argv[])
#ifndef NECKO #ifndef NECKO
rv = NS_NewURL(&url, urlstr); rv = NS_NewURL(&url, urlstr);
#else #else
rv = nsServiceManager::GetService(kIOServiceCID, rv = NS_NewURI(&url, urlstr);
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);
#endif // NECKO #endif // NECKO
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
@ -620,7 +605,11 @@ int main(int argc, char* argv[])
if (profstr) if (profstr)
{ {
#ifdef NECKO
rv = NS_NewURI(&profURL, profstr);
#else
rv = NS_NewURL(&profURL, profstr); rv = NS_NewURL(&profURL, profstr);
#endif
if (NS_FAILED(rv)) { if (NS_FAILED(rv)) {
goto done; goto done;
@ -734,9 +723,5 @@ done:
* Translate the nsresult into an appropriate platform-specific return code. * Translate the nsresult into an appropriate platform-specific return code.
*/ */
#ifdef NECKO
nsServiceManager::ReleaseService(kIOServiceCID, service);
#endif // NECKO
return TranslateReturnValue(rv); return TranslateReturnValue(rv);
} }

Просмотреть файл

@ -43,7 +43,6 @@ LINCS = \
-I$(PUBLIC)/txtsvc \ -I$(PUBLIC)/txtsvc \
-I$(PUBLIC)/xpfe/components \ -I$(PUBLIC)/xpfe/components \
-I$(PUBLIC)/raptor \ -I$(PUBLIC)/raptor \
-I$(PUBLIC)/netlib \
-I$(PUBLIC)/rdf \ -I$(PUBLIC)/rdf \
-I$(PUBLIC)/dom \ -I$(PUBLIC)/dom \
$(NULL) $(NULL)
@ -51,7 +50,9 @@ LINCS = \
LLIBS = \ LLIBS = \
$(LIBNSPR) \ $(LIBNSPR) \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
!ifndef NECKO
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(NULL) $(NULL)
#//------------------------------------------------------------------------ #//------------------------------------------------------------------------

Просмотреть файл

@ -47,7 +47,9 @@ LINCS = \
LLIBS = \ LLIBS = \
$(LIBNSPR) \ $(LIBNSPR) \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
!ifndef NECKO
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(NULL) $(NULL)
#//------------------------------------------------------------------------ #//------------------------------------------------------------------------

Просмотреть файл

@ -34,7 +34,11 @@ LCFLAGS = \
# These are the libraries we need to link with to create the DLL # These are the libraries we need to link with to create the DLL
LLIBS= \ LLIBS= \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
!ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(DIST)\lib\plc3.lib \ $(DIST)\lib\plc3.lib \
$(LIBNSPR) \ $(LIBNSPR) \
$(NULL) $(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 * 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 * Version 1.0 (the "NPL"); you may not use this file except in
@ -36,9 +36,8 @@
#include "nsIStreamListener.h" #include "nsIStreamListener.h"
#include "nsIURL.h" #include "nsIURL.h"
#ifdef NECKO #ifdef NECKO
#include "nsIIOService.h" #include "nsNeckoUtil.h"
#include "nsIURL.h" #include "nsIBufferInputStream.h"
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO #endif // NECKO
#include "nsRDFCID.h" #include "nsRDFCID.h"
#include "nsString.h" #include "nsString.h"
@ -99,17 +98,32 @@ public:
NS_METHOD Init(); NS_METHOD Init();
NS_METHOD CreateAnonymousResource(const nsString& aPrefixURI, nsCOMPtr<nsIRDFResource>* aResult); 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); // nsIStreamListener
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax); NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
NS_IMETHOD OnStatus(nsIURI* aURL, const PRUnichar* aMsg);
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg); #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 // stream listener
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo); NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream,
PRUint32 aLength); PRUint32 aLength);
#endif
}; };
PRInt32 RelatedLinksStreamListener::gRefCnt; PRInt32 RelatedLinksStreamListener::gRefCnt;
@ -230,7 +244,11 @@ NS_IMPL_ISUPPORTS(RelatedLinksStreamListener, nsIStreamListener::GetIID());
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
RelatedLinksStreamListener::OnStartBinding(nsISupports *ctxt)
#else
RelatedLinksStreamListener::OnStartBinding(nsIURI *aURL, const char *aContentType) RelatedLinksStreamListener::OnStartBinding(nsIURI *aURL, const char *aContentType)
#endif
{ {
nsAutoString trueStr("true"); nsAutoString trueStr("true");
nsIRDFLiteral *literal = nsnull; nsIRDFLiteral *literal = nsnull;
@ -244,7 +262,7 @@ RelatedLinksStreamListener::OnStartBinding(nsIURI *aURL, const char *aContentTyp
} }
#ifndef NECKO
NS_IMETHODIMP NS_IMETHODIMP
RelatedLinksStreamListener::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax) RelatedLinksStreamListener::OnProgress(nsIURI* aURL, PRUint32 aProgress, PRUint32 aProgressMax)
{ {
@ -258,11 +276,16 @@ RelatedLinksStreamListener::OnStatus(nsIURI* aURL, const PRUnichar* aMsg)
{ {
return(NS_OK); return(NS_OK);
} }
#endif
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
RelatedLinksStreamListener::OnStopBinding(nsISupports *ctxt, nsresult status,
const PRUnichar *errorMsg)
#else
RelatedLinksStreamListener::OnStopBinding(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg) RelatedLinksStreamListener::OnStopBinding(nsIURI* aURL, nsresult aStatus, const PRUnichar* aMsg)
#endif
{ {
nsAutoString trueStr("true"); nsAutoString trueStr("true");
nsIRDFLiteral *literal = nsnull; nsIRDFLiteral *literal = nsnull;
@ -280,17 +303,24 @@ RelatedLinksStreamListener::OnStopBinding(nsIURI* aURL, nsresult aStatus, const
// stream listener methods // stream listener methods
#ifndef NECKO
NS_IMETHODIMP NS_IMETHODIMP
RelatedLinksStreamListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo) RelatedLinksStreamListener::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* aInfo)
{ {
return(NS_OK); return(NS_OK);
} }
#endif
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
RelatedLinksStreamListener::OnDataAvailable(nsISupports *ctxt,
nsIBufferInputStream *aIStream,
PRUint32 sourceOffset,
PRUint32 aLength)
#else
RelatedLinksStreamListener::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength) RelatedLinksStreamListener::OnDataAvailable(nsIURI* aURL, nsIInputStream *aIStream, PRUint32 aLength)
#endif
{ {
nsresult rv = NS_OK; nsresult rv = NS_OK;
@ -814,15 +844,7 @@ RelatedLinksHandlerImpl::SetURL(char* aURL)
#ifndef NECKO #ifndef NECKO
rv = NS_NewURL(getter_AddRefs(url), queryURL); rv = NS_NewURL(getter_AddRefs(url), queryURL);
#else #else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv); rv = NS_NewURI(getter_AddRefs(url), queryURL);
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);
#endif // NECKO #endif // NECKO
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
@ -832,7 +854,11 @@ RelatedLinksHandlerImpl::SetURL(char* aURL)
rv = NS_NewRelatedLinksStreamListener(mInner, getter_AddRefs(listener)); rv = NS_NewRelatedLinksStreamListener(mInner, getter_AddRefs(listener));
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
#ifdef NECKO
rv = NS_OpenURI(listener, url);
#else
rv = NS_OpenURL(url, listener); rv = NS_OpenURL(url, listener);
#endif
if (NS_FAILED(rv)) return rv; if (NS_FAILED(rv)) return rv;
return NS_OK; return NS_OK;

Просмотреть файл

@ -18,14 +18,17 @@
#include "nsIAppShellComponent.idl" #include "nsIAppShellComponent.idl"
[ptr] native nsIURI( nsIURI ); interface nsIURI;
[ptr] native nsIDocumentLoader( nsIDocumentLoader ); interface nsIDocumentLoader;
interface nsIChannel;
%{C++ %{C++
class nsIURI; #ifndef NECKO // gross hack since we can't put ifdefs in idl:
class nsIDocumentLoader; #define nsIChannel nsIURI
#endif
%} %}
/*----------------------- nsIUnknownContentTypeHandler ------------------------- /*----------------------- nsIUnknownContentTypeHandler -------------------------
| This file describes the interface for Mozilla's "unknown content-type | | This file describes the interface for Mozilla's "unknown content-type |
| handler" component. This component is notified whenever the browser | | handler" component. This component is notified whenever the browser |
@ -45,7 +48,7 @@ class nsIDocumentLoader;
[scriptable, uuid(a6cf90ef-15b3-11d2-932e-00805f8add32)] [scriptable, uuid(a6cf90ef-15b3-11d2-932e-00805f8add32)]
interface nsIUnknownContentTypeHandler : nsIAppShellComponent { interface nsIUnknownContentTypeHandler : nsIAppShellComponent {
void HandleUnknownContentType( in nsIURI aURL, void HandleUnknownContentType( in nsIChannel aURL,
in string aContentType, in string aContentType,
in nsIDocumentLoader aDocLoader ); in nsIDocumentLoader aDocLoader );
}; };

Просмотреть файл

@ -42,7 +42,6 @@ LINCS = \
-I$(PUBLIC)/xpcom \ -I$(PUBLIC)/xpcom \
-I$(PUBLIC)/xpfe/components \ -I$(PUBLIC)/xpfe/components \
-I$(PUBLIC)/raptor \ -I$(PUBLIC)/raptor \
-I$(PUBLIC)/netlib \
-I$(PUBLIC)/rdf \ -I$(PUBLIC)/rdf \
-I$(PUBLIC)/dom \ -I$(PUBLIC)/dom \
$(NULL) $(NULL)
@ -50,7 +49,9 @@ LINCS = \
LLIBS = \ LLIBS = \
$(LIBNSPR) \ $(LIBNSPR) \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
!ifndef NECKO
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(NULL) $(NULL)
#//------------------------------------------------------------------------ #//------------------------------------------------------------------------

Просмотреть файл

@ -42,7 +42,11 @@ LINCS = \
-I$(PUBLIC)/xpcom \ -I$(PUBLIC)/xpcom \
-I$(PUBLIC)/xpfe/components \ -I$(PUBLIC)/xpfe/components \
-I$(PUBLIC)/raptor \ -I$(PUBLIC)/raptor \
-I$(PUBLIC)/netlib \ !ifdef NECKO
-I$(PUBLIC)\necko \
!else
-I$(PUBLIC)\netlib \
!endif
-I$(PUBLIC)/rdf \ -I$(PUBLIC)/rdf \
-I$(PUBLIC)/dom \ -I$(PUBLIC)/dom \
$(NULL) $(NULL)
@ -50,7 +54,11 @@ LINCS = \
LLIBS = \ LLIBS = \
$(LIBNSPR) \ $(LIBNSPR) \
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
$(DIST)\lib\netlib.lib \ !ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
$(DIST)\lib\netlib.lib \
!endif
$(NULL) $(NULL)
#//------------------------------------------------------------------------ #//------------------------------------------------------------------------

Просмотреть файл

@ -29,15 +29,13 @@
#include "nsINetService.h" #include "nsINetService.h"
static NS_DEFINE_IID( kNetServiceCID, NS_NETSERVICE_CID ); static NS_DEFINE_IID( kNetServiceCID, NS_NETSERVICE_CID );
#else #else
#include "nsIIOService.h" #include "nsNeckoUtil.h"
#include "nsIURL.h" #include "nsIURL.h"
#include "nsIServiceManager.h"
#include "nsIChannel.h" #include "nsIChannel.h"
#include "nsIEventQueueService.h" #include "nsIEventQueueService.h"
#include "nsIProgressEventSink.h" #include "nsIProgressEventSink.h"
#include "nsIBufferInputStream.h" #include "nsIBufferInputStream.h"
static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID); static NS_DEFINE_IID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID);
#endif // NECKO #endif // NECKO
static NS_DEFINE_IID( kAppShellServiceCID, NS_APPSHELL_SERVICE_CID ); static NS_DEFINE_IID( kAppShellServiceCID, NS_APPSHELL_SERVICE_CID );
@ -75,32 +73,8 @@ nsDownloadProgressDialog::OnStart() {
__FILE__, (int)__LINE__, (int)rv ); __FILE__, (int)__LINE__, (int)rv );
} }
#else #else
nsresult rv; nsresult rv = NS_OpenURI(this, mUrl);
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv); NS_ASSERTION(NS_SUCCEEDED(rv), "OnStart doesn't return 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;
#endif // NECKO #endif // NECKO
} }
@ -152,15 +126,7 @@ nsDownloadProgressDialog::Show() {
#ifndef NECKO #ifndef NECKO
rv = NS_NewURL( &url, urlStr ); rv = NS_NewURL( &url, urlStr );
#else #else
NS_WITH_SERVICE(nsIIOService, service, kIOServiceCID, &rv); rv = NS_NewURI( &url, urlStr );
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);
#endif // NECKO #endif // NECKO
if ( NS_SUCCEEDED(rv) ) { if ( NS_SUCCEEDED(rv) ) {

Просмотреть файл

@ -52,8 +52,8 @@ public:
// nsIStreamObserver methods: // nsIStreamObserver methods:
NS_IMETHOD OnStartBinding(nsISupports *ctxt); NS_IMETHOD OnStartBinding(nsISupports *ctxt);
NS_IMETHOD OnStopBinding(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg); 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); NS_IMETHOD OnStopRequest(nsISupports *ctxt, nsresult status, const PRUnichar *errorMsg) { return NS_OK; }
// nsIStreamListener methods: // nsIStreamListener methods:
NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, PRUint32 sourceOffset, PRUint32 count); NS_IMETHOD OnDataAvailable(nsISupports *ctxt, nsIBufferInputStream *inStr, PRUint32 sourceOffset, PRUint32 count);
#else #else

Просмотреть файл

@ -42,7 +42,11 @@ LINCS= \
-I$(PUBLIC)\xpinstall \ -I$(PUBLIC)\xpinstall \
-I$(PUBLIC)\jar \ -I$(PUBLIC)\jar \
-I$(PUBLIC)\libreg \ -I$(PUBLIC)\libreg \
-I$(PUBLIC)\netlib \ !ifdef NECKO
-I$(PUBLIC)\necko \
!else
-I$(PUBLIC)\netlib \
!endif
-I$(PUBLIC)\xpcom \ -I$(PUBLIC)\xpcom \
-I$(PUBLIC)\pref \ -I$(PUBLIC)\pref \
-I$(PUBLIC)\rdf \ -I$(PUBLIC)\rdf \
@ -59,7 +63,11 @@ LINCS= \
LLIBS = \ LLIBS = \
$(DIST)\lib\jar50.lib \ $(DIST)\lib\jar50.lib \
$(DIST)\lib\libreg32.lib \ $(DIST)\lib\libreg32.lib \
!ifdef NECKO
$(DIST)\lib\neckoutil_s.lib \
!else
$(DIST)\lib\netlib.lib \ $(DIST)\lib\netlib.lib \
!endif
$(DIST)\lib\xpcom.lib \ $(DIST)\lib\xpcom.lib \
$(DIST)\lib\js3250.lib \ $(DIST)\lib\js3250.lib \
$(DIST)\lib\jsdombase_s.lib \ $(DIST)\lib\jsdombase_s.lib \

Просмотреть файл

@ -53,6 +53,9 @@
#include "nsInstallExecute.h" #include "nsInstallExecute.h"
#include "nsInstallPatch.h" #include "nsInstallPatch.h"
#include "nsInstallUninstall.h" #include "nsInstallUninstall.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#endif
#ifdef _WINDOWS #ifdef _WINDOWS
#include "nsWinReg.h" #include "nsWinReg.h"
@ -74,6 +77,16 @@
#define FILESEP "/" #define FILESEP "/"
#endif #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, nsInstallInfo::nsInstallInfo(nsIFileSpec* aFile,
const PRUnichar* aArgs, const PRUnichar* aArgs,
@ -834,20 +847,15 @@ nsInstall::GetWinRegistry(JSContext* jscontext, JSClass* WinRegClass, jsval* aRe
PRInt32 PRInt32
nsInstall::LoadResources(JSContext* cx, const nsString& aBaseName, jsval* aReturn) 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; nsresult ret;
nsFileSpec* resFile; nsFileSpec* resFile;
nsFileURL* resFileURL = nsnull; nsFileURL* resFileURL = nsnull;
nsIURI *url = nsnull; nsIURI *url = nsnull;
nsILocale* locale = nsnull; nsILocale* locale = nsnull;
nsIStringBundleService* service = nsnull; nsIStringBundleService* service = nsnull;
#ifndef NECKO
nsINetService* pNetService = nsnull; nsINetService* pNetService = nsnull;
#endif
nsIEventQueueService* pEventQueueService = nsnull; nsIEventQueueService* pEventQueueService = nsnull;
nsIStringBundle* bundle = nsnull; nsIStringBundle* bundle = nsnull;
nsIBidirectionalEnumerator* propEnum = nsnull; nsIBidirectionalEnumerator* propEnum = nsnull;
@ -878,9 +886,11 @@ nsInstall::LoadResources(JSContext* cx, const nsString& aBaseName, jsval* aRetur
kIStringBundleServiceIID, (nsISupports**) &service); kIStringBundleServiceIID, (nsISupports**) &service);
if (NS_FAILED(ret)) if (NS_FAILED(ret))
goto handle_err; goto handle_err;
#ifndef NECKO
ret = nsServiceManager::GetService(kNetServiceCID, kINetServiceIID, (nsISupports**) &pNetService); ret = nsServiceManager::GetService(kNetServiceCID, kINetServiceIID, (nsISupports**) &pNetService);
if (NS_FAILED(ret)) if (NS_FAILED(ret))
goto handle_err; goto handle_err;
#endif
ret = nsServiceManager::GetService(kEventQueueServiceCID, ret = nsServiceManager::GetService(kEventQueueServiceCID,
kIEventQueueServiceIID, (nsISupports**) &pEventQueueService); kIEventQueueServiceIID, (nsISupports**) &pEventQueueService);
if (NS_FAILED(ret)) 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 // construct properties file URL as required by StringBundle interface
resFileURL = new nsFileURL( *resFile ); resFileURL = new nsFileURL( *resFile );
#ifdef NECKO
ret = NS_NewURI(&url, resFileURL->GetURLString());
#else
ret = pNetService->CreateURL(&url, nsString( resFileURL->GetURLString()), nsnull, nsnull, nsnull); ret = pNetService->CreateURL(&url, nsString( resFileURL->GetURLString()), nsnull, nsnull, nsnull);
#endif
if (resFileURL) if (resFileURL)
delete resFileURL; delete resFileURL;
if (resFile) if (resFile)

Просмотреть файл

@ -49,7 +49,9 @@
#include "nsIStringBundle.h" #include "nsIStringBundle.h"
#include "nsILocale.h" #include "nsILocale.h"
#ifndef NECKO
#include "nsINetService.h" #include "nsINetService.h"
#endif
#include "nsIEventQueueService.h" #include "nsIEventQueueService.h"
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "nsIComponentManager.h" #include "nsIComponentManager.h"

Просмотреть файл

@ -30,8 +30,13 @@
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "nsIURL.h" #include "nsIURL.h"
#ifdef NECKO
#include "nsNeckoUtil.h"
#include "nsIBufferInputStream.h"
#else
#include "nsINetlibURL.h" #include "nsINetlibURL.h"
#include "nsINetService.h" #include "nsINetService.h"
#endif
#include "nsIInputStream.h" #include "nsIInputStream.h"
#include "nsIStreamListener.h" #include "nsIStreamListener.h"
@ -204,9 +209,18 @@ nsresult nsXPInstallManager::DownloadNext()
{ {
// --- start the download // --- start the download
nsIURI *pURL; nsIURI *pURL;
#ifdef NECKO
rv = NS_NewURI(&pURL, mItem->mURL);
#else
rv = NS_NewURL(&pURL, mItem->mURL); 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 ); rv = NS_OpenURL( pURL, this );
#endif
}
} }
if (NS_FAILED(rv)) if (NS_FAILED(rv))
@ -248,7 +262,7 @@ nsresult nsXPInstallManager::DownloadNext()
// IStreamListener methods // IStreamListener methods
#ifndef NECKO
NS_IMETHODIMP NS_IMETHODIMP
nsXPInstallManager::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* info) nsXPInstallManager::GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* info)
{ {
@ -272,19 +286,29 @@ nsXPInstallManager::OnStatus(nsIURI* aURL,
else else
return NS_ERROR_NULL_POINTER; return NS_ERROR_NULL_POINTER;
} }
#endif
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsXPInstallManager::OnStartBinding(nsISupports *ctxt)
#else
nsXPInstallManager::OnStartBinding(nsIURI* aURL, nsXPInstallManager::OnStartBinding(nsIURI* aURL,
const char *aContentType) const char *aContentType)
#endif
{ {
mItem->mFile->openStreamForWriting(); mItem->mFile->openStreamForWriting();
return NS_OK; return NS_OK;
} }
NS_IMETHODIMP NS_IMETHODIMP
#ifdef NECKO
nsXPInstallManager::OnStopBinding(nsISupports *ctxt, nsresult status,
const PRUnichar *errorMsg)
#else
nsXPInstallManager::OnStopBinding(nsIURI* aURL, nsXPInstallManager::OnStopBinding(nsIURI* aURL,
nsresult status, nsresult status,
const PRUnichar* aMsg) const PRUnichar* aMsg)
#endif
{ {
nsresult rv; nsresult rv;
switch( status ) switch( status )
@ -314,7 +338,16 @@ nsXPInstallManager::OnStopBinding(nsIURI* aURL,
#define BUF_SIZE 1024 #define BUF_SIZE 1024
NS_IMETHODIMP 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; PRUint32 len;
PRInt32 result; PRInt32 result;

Просмотреть файл

@ -32,8 +32,10 @@
#include "nsString.h" #include "nsString.h"
#include "nsIURL.h" #include "nsIURL.h"
#ifndef NECKO
#include "nsINetlibURL.h" #include "nsINetlibURL.h"
#include "nsINetService.h" #include "nsINetService.h"
#endif
#include "nsIInputStream.h" #include "nsIInputStream.h"
#include "nsIStreamListener.h" #include "nsIStreamListener.h"
#include "nsIXPINotifier.h" #include "nsIXPINotifier.h"
@ -60,6 +62,20 @@ class nsXPInstallManager : public nsIXPINotifier, public nsIStreamListener
NS_IMETHOD InitManager( nsXPITriggerInfo* aTrigger ); 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 // IStreamListener methods
NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* info); NS_IMETHOD GetBindInfo(nsIURI* aURL, nsStreamBindingInfo* info);
NS_IMETHOD OnProgress(nsIURI* aURL, PRUint32 Progress, PRUint32 ProgressMax); 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 OnStartBinding(nsIURI* aURL, const char *aContentType);
NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32 length); NS_IMETHOD OnDataAvailable(nsIURI* aURL, nsIInputStream *pIStream, PRUint32 length);
NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg); NS_IMETHOD OnStopBinding(nsIURI* aURL, nsresult status, const PRUnichar* aMsg);
#endif
// IXPINotifier methods // IXPINotifier methods
NS_IMETHOD BeforeJavascriptEvaluation(); NS_IMETHOD BeforeJavascriptEvaluation();