diff --git a/content/base/public/nsIDocument.h b/content/base/public/nsIDocument.h index 23283d39ea1..13270667bb7 100644 --- a/content/base/public/nsIDocument.h +++ b/content/base/public/nsIDocument.h @@ -69,23 +69,6 @@ class nsISupportsArray; { 0x94c6ceb0, 0x9447, 0x11d1, \ {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } -// specification for data to be sent via form "post" -// IID for the nsIPostData interface - 152ab6e0-ff13-11d1-beb9-00805f8a66dc -#define NS_IPOSTDATA_IID \ -{ 0x152ab6e0, 0xff13, 0x11d1, \ - {0xbe, 0xb9, 0x00, 0x80, 0x5f, 0x8a, 0x66, 0xdc} } - -#if 0 -class nsIPostData : public nsISupports { -public: - static const nsIID& GetIID() { static nsIID iid = NS_IPOSTDATA_IID; return iid; } - - virtual PRBool IsFile() = 0; // is the data a file (or raw data) - virtual const char* GetData() = 0; // get the file name or raw data - virtual PRInt32 GetDataLength() = 0; -}; -#endif - // The base value for the content ID counter. // This counter is used by the document to // assign a monotonically increasing ID to each content diff --git a/docshell/base/MANIFEST_IDL b/docshell/base/MANIFEST_IDL index d7405c13cef..03297483553 100644 --- a/docshell/base/MANIFEST_IDL +++ b/docshell/base/MANIFEST_IDL @@ -28,4 +28,5 @@ nsIDocShellTreeNode.idl nsIDocShellTreeOwner.idl nsIMarkupDocumentViewer.idl nsIScrollable.idl -nsITextScroll.idl \ No newline at end of file +nsITextScroll.idl +nsIContentViewerEdit.idl \ No newline at end of file diff --git a/docshell/base/Makefile.in b/docshell/base/Makefile.in index 0c698d0e1bd..436f40e87bf 100644 --- a/docshell/base/Makefile.in +++ b/docshell/base/Makefile.in @@ -35,15 +35,17 @@ XPIDLSRCS = \ nsIDocShellTreeItem.idl \ nsIDocShellTreeNode.idl \ nsIDocShellTreeOwner.idl \ - nsIDocShellHistory.idl \ + nsIDocShellHistory.idl \ nsIMarkupDocumentViewer.idl \ nsIScrollable.idl \ nsITextScroll.idl \ nsIWebNavigation.idl \ + nsIContentViewerEdit.idl \ $(NULL) CPPSRCS = \ nsDocShell.cpp \ + nsWebShell.cpp \ nsDocShellLoadInfo.cpp \ nsDSURIContentListener.cpp \ # nsDSWebProgressListener.cpp \ diff --git a/docshell/base/makefile.win b/docshell/base/makefile.win index 72cd0ef0198..832f0977a15 100644 --- a/docshell/base/makefile.win +++ b/docshell/base/makefile.win @@ -22,15 +22,17 @@ DEPTH=..\.. MODULE=docshell_base +LIBRARY_NAME=basedocshell_s + XPIDLSRCS= \ .\nsCDocShell.idl \ .\nsIDocShell.idl \ - .\nsIDocShellHistory.idl \ + .\nsIDocShellHistory.idl \ .\nsIDocShellLoadInfo.idl \ .\nsIDocShellTreeItem.idl \ .\nsIDocShellTreeNode.idl \ .\nsIDocShellTreeOwner.idl \ -# .\nsIContentViewerEdit.idl \ + .\nsIContentViewerEdit.idl \ # .\nsIContentViewerFile.idl \ .\nsIMarkupDocumentViewer.idl \ .\nsIScrollable.idl \ @@ -38,10 +40,9 @@ XPIDLSRCS= \ .\nsIWebNavigation.idl \ $(NULL) -LIBRARY_NAME=basedocshell_s - CPP_OBJS= \ .\$(OBJDIR)\nsDocShell.obj \ + .\$(OBJDIR)\nsWebShell.obj \ .\$(OBJDIR)\nsDocShellLoadInfo.obj \ .\$(OBJDIR)\nsDSURIContentListener.obj \ # .\$(OBJDIR)\nsDSWebProgressListener.obj \ @@ -51,5 +52,5 @@ include <$(DEPTH)\config\rules.mak> include <$(DEPTH)\config\config.mak> install:: $(LIBRARY) - $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib - $(MAKE_INSTALL) appstrings.properties $(DIST)\bin\chrome\locales\en-US\global\locale + $(MAKE_INSTALL) $(LIBRARY) $(DIST)\lib + $(MAKE_INSTALL) appstrings.properties $(DIST)\bin\chrome\locales\en-US\global\locale diff --git a/docshell/base/nsIContentViewerEdit.idl b/docshell/base/nsIContentViewerEdit.idl index 629216e17e1..76ead3064d7 100644 --- a/docshell/base/nsIContentViewerEdit.idl +++ b/docshell/base/nsIContentViewerEdit.idl @@ -22,25 +22,21 @@ #include "nsISupports.idl" -/** - * The nsIDocShellFile - */ - [scriptable, uuid(42d5215c-9bc7-11d3-bccc-0060b0fc76bd)] interface nsIContentViewerEdit : nsISupports { - void Search(); + void search(); readonly attribute boolean searchable; - void ClearSelection(); - void SelectAll(); + void clearSelection(); + void selectAll(); - void CopySelection(); + void copySelection(); readonly attribute boolean copyable; - void CutSelection(); + void cutSelection(); readonly attribute boolean cutable; - void Paste(); + void paste(); readonly attribute boolean pasteable; }; \ No newline at end of file diff --git a/docshell/base/nsWebShell.cpp b/docshell/base/nsWebShell.cpp index ecf965c5c33..afbe4e109b5 100644 --- a/docshell/base/nsWebShell.cpp +++ b/docshell/base/nsWebShell.cpp @@ -31,6 +31,7 @@ typedef unsigned long HMTX; #endif #include "nsDocShell.h" #include "nsIWebShell.h" +#include "nsWebShell.h" #include "nsIWebBrowserChrome.h" #include "nsIInterfaceRequestor.h" #include "nsIDocumentLoader.h" @@ -163,182 +164,6 @@ static NS_DEFINE_CID(kIOServiceCID, NS_IOSERVICE_CID); //---------------------------------------------------------------------- -typedef enum { - eCharsetReloadInit, - eCharsetReloadRequested, - eCharsetReloadStopOrigional -} eCharsetReloadState; - -class nsWebShell : public nsDocShell, - public nsIWebShell, - public nsIWebShellContainer, - public nsIWebShellServices, - public nsILinkHandler, - public nsIDocumentLoaderObserver, - public nsIClipboardCommands -{ -public: - nsWebShell(); - virtual ~nsWebShell(); - - NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW - - // nsISupports - NS_DECL_ISUPPORTS_INHERITED - - // nsIInterfaceRequestor - NS_DECL_NSIINTERFACEREQUESTOR - - NS_DECL_NSIDOCUMENTLOADEROBSERVER - - NS_IMETHOD SetupNewViewer(nsIContentViewer* aViewer); - - // nsIContentViewerContainer - NS_IMETHOD Embed(nsIContentViewer* aDocViewer, - const char* aCommand, - nsISupports* aExtraInfo); - - // nsIWebShell - NS_IMETHOD SetContainer(nsIWebShellContainer* aContainer); - NS_IMETHOD GetContainer(nsIWebShellContainer*& aResult); - NS_IMETHOD GetTopLevelWindow(nsIWebShellContainer** aWebShellWindow); - NS_IMETHOD GetRootWebShell(nsIWebShell*& aResult); - NS_IMETHOD SetParent(nsIWebShell* aParent); - NS_IMETHOD GetParent(nsIWebShell*& aParent); - NS_IMETHOD GetReferrer(nsIURI **aReferrer); - - // Document load api's - NS_IMETHOD GetDocumentLoader(nsIDocumentLoader*& aResult); - -/* NS_IMETHOD LoadURL(const PRUnichar *aURLSpec, - const char* aCommand, - nsIInputStream* aPostDataStream=nsnull, - PRBool aModifyHistory=PR_TRUE, - nsLoadFlags aType = nsIChannel::LOAD_NORMAL, - nsISupports * aHistoryState=nsnull, - const PRUnichar* aReferrer=nsnull, - const char * aWindowTarget = nsnull); - - NS_IMETHOD LoadURI(nsIURI * aUri, - const char * aCommand, - nsIInputStream* aPostDataStream=nsnull, - PRBool aModifyHistory=PR_TRUE, - nsLoadFlags aType = nsIChannel::LOAD_NORMAL, - nsISupports * aHistoryState=nsnull, - const PRUnichar* aReferrer=nsnull, - const char * aWindowTarget = nsnull); - */ - void SetReferrer(const PRUnichar* aReferrer); - - // History api's - NS_IMETHOD GoTo(PRInt32 aHistoryIndex); - NS_IMETHOD GetHistoryLength(PRInt32& aResult); - NS_IMETHOD GetHistoryIndex(PRInt32& aResult); - NS_IMETHOD GetURL(PRInt32 aHistoryIndex, const PRUnichar** aURLResult); - - // nsIWebShellContainer - NS_IMETHOD SetHistoryState(nsISupports* aLayoutHistoryState); - NS_IMETHOD FireUnloadEvent(void); - - // nsIWebShellServices - NS_IMETHOD LoadDocument(const char* aURL, - const char* aCharset= nsnull , - nsCharsetSource aSource = kCharsetUninitialized); - NS_IMETHOD ReloadDocument(const char* aCharset= nsnull , - nsCharsetSource aSource = kCharsetUninitialized); - NS_IMETHOD StopDocumentLoad(void); - NS_IMETHOD SetRendering(PRBool aRender); - - // nsILinkHandler - NS_IMETHOD OnLinkClick(nsIContent* aContent, - nsLinkVerb aVerb, - const PRUnichar* aURLSpec, - const PRUnichar* aTargetSpec, - nsIInputStream* aPostDataStream = 0); - NS_IMETHOD OnOverLink(nsIContent* aContent, - const PRUnichar* aURLSpec, - const PRUnichar* aTargetSpec); - NS_IMETHOD GetLinkState(const nsString& aLinkURI, nsLinkState& aState); - - // nsIClipboardCommands - NS_IMETHOD CanCutSelection (PRBool* aResult); - NS_IMETHOD CanCopySelection (PRBool* aResult); - NS_IMETHOD CanPasteSelection(PRBool* aResult); - - NS_IMETHOD CutSelection (void); - NS_IMETHOD CopySelection (void); - NS_IMETHOD PasteSelection(void); - - NS_IMETHOD SelectAll(void); - NS_IMETHOD SelectNone(void); - - NS_IMETHOD FindNext(const PRUnichar * aSearchStr, PRBool aMatchCase, PRBool aSearchDown, PRBool &aIsFound); - - // nsIBaseWindow - NS_IMETHOD Create(); - NS_IMETHOD Destroy(); - NS_IMETHOD SetPositionAndSize(PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy, - PRBool fRepaint); - NS_IMETHOD GetPositionAndSize(PRInt32* x, PRInt32* y, PRInt32* cx, - PRInt32* cy); - - // nsWebShell - nsIEventQueue* GetEventQueue(void); - void HandleLinkClickEvent(nsIContent *aContent, - nsLinkVerb aVerb, - const PRUnichar* aURLSpec, - const PRUnichar* aTargetSpec, - nsIInputStream* aPostDataStream = 0); - - static nsEventStatus PR_CALLBACK HandleEvent(nsGUIEvent *aEvent); - - NS_IMETHOD SetURL(const PRUnichar* aURL); - -protected: - void GetRootWebShellEvenIfChrome(nsIWebShell** aResult); - void InitFrameData(); - - nsIEventQueue* mThreadEventQueue; - - nsIWebShellContainer* mContainer; - nsIDocumentLoader* mDocLoader; - - PRBool mFiredUnloadEvent; - - nsRect mBounds; - - eCharsetReloadState mCharsetReloadState; - - nsISupports* mHistoryState; // Weak reference. Session history owns this. - - nsresult FireUnloadForChildren(); - - nsresult CreateViewer(nsIChannel* aChannel, - const char* aContentType, - const char* aCommand, - nsIStreamListener** aResult); - -#ifdef DETECT_WEBSHELL_LEAKS -private: - // We're counting the number of |nsWebShells| to help find leaks - static unsigned long gNumberOfWebShells; - -public: - static unsigned long TotalWebShellsInExistence() { return gNumberOfWebShells; } -#endif -}; - -#ifdef DETECT_WEBSHELL_LEAKS -unsigned long nsWebShell::gNumberOfWebShells = 0; - -extern "C" NS_WEB -unsigned long -NS_TotalWebShellsInExistence() -{ - return nsWebShell::TotalWebShellsInExistence(); -} -#endif - //---------------------------------------------------------------------- // Class IID's @@ -349,7 +174,7 @@ static NS_DEFINE_IID(kWebShellCID, NS_WEB_SHELL_CID); // IID's static NS_DEFINE_IID(kIContentViewerContainerIID, - NS_ICONTENT_VIEWER_CONTAINER_IID); + NS_ICONTENTVIEWERCONTAINER_IID); static NS_DEFINE_IID(kIDocumentLoaderIID, NS_IDOCUMENTLOADER_IID); static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); @@ -650,6 +475,7 @@ nsWebShell::GetRootWebShellEvenIfChrome(nsIWebShell** aResult) NS_IF_ADDREF(*aResult); } +/* NS_IMETHODIMP nsWebShell::SetParent(nsIWebShell* aParent) { @@ -671,7 +497,7 @@ nsWebShell::GetParent(nsIWebShell*& aParent) aParent = nsnull; return NS_OK; } - +*/ NS_IMETHODIMP nsWebShell::GetReferrer(nsIURI **aReferrer) { @@ -707,34 +533,6 @@ nsWebShell::GetDocumentLoader(nsIDocumentLoader*& aResult) return (nsnull != mDocLoader) ? NS_OK : NS_ERROR_FAILURE; } -static PRBool EqualBaseURLs(nsIURI* url1, nsIURI* url2) -{ - nsXPIDLCString spec1; - nsXPIDLCString spec2; - char * anchor1 = nsnull, * anchor2=nsnull; - PRBool rv = PR_FALSE; - - if (url1 && url2) { - // XXX We need to make these strcmps case insensitive. - url1->GetSpec(getter_Copies(spec1)); - url2->GetSpec(getter_Copies(spec2)); - - /* Don't look at the ref-part */ - anchor1 = PL_strrchr(spec1, '#'); - anchor2 = PL_strrchr(spec2, '#'); - - if (anchor1) - *anchor1 = '\0'; - if (anchor2) - *anchor2 = '\0'; - - if (0 == PL_strcmp(spec1,spec2)) { - rv = PR_TRUE; - } - } // url1 && url2 - return rv; -} - //---------------------------------------- // History methods @@ -1631,84 +1429,6 @@ NS_IMETHODIMP nsWebShell::GetPositionAndSize(PRInt32* x, PRInt32* y, return NS_OK; } - -//---------------------------------------------------------------------- - -// Factory code for creating nsWebShell's - -class nsWebShellFactory : public nsIFactory -{ -public: - nsWebShellFactory(); - virtual ~nsWebShellFactory(); - - NS_DECL_ISUPPORTS - - // nsIFactory methods - NS_IMETHOD CreateInstance(nsISupports *aOuter, - const nsIID &aIID, - void **aResult); - - NS_IMETHOD LockFactory(PRBool aLock); -}; - -nsWebShellFactory::nsWebShellFactory() -{ - NS_INIT_REFCNT(); -} - -nsWebShellFactory::~nsWebShellFactory() -{ -} - -NS_IMPL_ADDREF(nsWebShellFactory); -NS_IMPL_RELEASE(nsWebShellFactory); - -NS_INTERFACE_MAP_BEGIN(nsWebShellFactory) - NS_INTERFACE_MAP_ENTRY(nsISupports) - NS_INTERFACE_MAP_ENTRY(nsIFactory) -NS_INTERFACE_MAP_END - -nsresult -nsWebShellFactory::CreateInstance(nsISupports *aOuter, - const nsIID &aIID, - void **aResult) -{ - nsresult rv; - nsWebShell *inst; - - NS_ENSURE_ARG_POINTER(aResult); - NS_ENSURE_NO_AGGREGATION(aOuter); - *aResult = NULL; - - NS_NEWXPCOM(inst, nsWebShell); - NS_ENSURE_TRUE(inst, NS_ERROR_OUT_OF_MEMORY); - - NS_ADDREF(inst); - rv = inst->QueryInterface(aIID, aResult); - NS_RELEASE(inst); - - return rv; -} - -nsresult -nsWebShellFactory::LockFactory(PRBool aLock) -{ - // Not implemented in simplest case. - return NS_OK; -} - -extern "C" NS_WEB nsresult -NS_NewWebShellFactory(nsIFactory** aFactory) -{ - nsresult rv = NS_OK; - nsIFactory* inst = new nsWebShellFactory(); - if (nsnull == inst) { - rv = NS_ERROR_OUT_OF_MEMORY; - } - else { - NS_ADDREF(inst); - } - *aFactory = inst; - return rv; -} +#ifdef DETECT_WEBSHELL_LEAKS +unsigned long nsWebShell::gNumberOfWebShells = 0; +#endif diff --git a/docshell/base/nsWebShell.h b/docshell/base/nsWebShell.h new file mode 100644 index 00000000000..9c320b18dda --- /dev/null +++ b/docshell/base/nsWebShell.h @@ -0,0 +1,151 @@ +#ifndef webshell____h +#define webshell____h + +#include "nsIWebShellServices.h" +#include "nsIWebShell.h" +#include "nsILinkHandler.h" +#include "nsIDocumentLoaderObserver.h" +#include "nsIClipboardCommands.h" +#include "nsDocShell.h" + +typedef enum { + eCharsetReloadInit, + eCharsetReloadRequested, + eCharsetReloadStopOrigional +} eCharsetReloadState; + +class nsWebShell : public nsDocShell, + public nsIWebShell, + public nsIWebShellContainer, + public nsIWebShellServices, + public nsILinkHandler, + public nsIDocumentLoaderObserver, + public nsIClipboardCommands +{ +public: + nsWebShell(); + virtual ~nsWebShell(); + + NS_DECL_AND_IMPL_ZEROING_OPERATOR_NEW + + NS_DECL_ISUPPORTS_INHERITED + NS_DECL_NSIINTERFACEREQUESTOR + NS_DECL_NSIDOCUMENTLOADEROBSERVER + NS_DECL_NSICLIPBOARDCOMMANDS + NS_DECL_NSIWEBSHELLSERVICES + + NS_IMETHOD SetupNewViewer(nsIContentViewer* aViewer); + + // nsIContentViewerContainer + NS_IMETHOD Embed(nsIContentViewer* aDocViewer, + const char* aCommand, + nsISupports* aExtraInfo); + + // nsIWebShell + NS_IMETHOD SetContainer(nsIWebShellContainer* aContainer); + NS_IMETHOD GetContainer(nsIWebShellContainer*& aResult); + NS_IMETHOD GetTopLevelWindow(nsIWebShellContainer** aWebShellWindow); + NS_IMETHOD GetRootWebShell(nsIWebShell*& aResult); + /*NS_IMETHOD SetParent(nsIWebShell* aParent); + NS_IMETHOD GetParent(nsIWebShell*& aParent);*/ + NS_IMETHOD GetReferrer(nsIURI **aReferrer); + + // Document load api's + NS_IMETHOD GetDocumentLoader(nsIDocumentLoader*& aResult); + +/* NS_IMETHOD LoadURL(const PRUnichar *aURLSpec, + const char* aCommand, + nsIInputStream* aPostDataStream=nsnull, + PRBool aModifyHistory=PR_TRUE, + nsLoadFlags aType = nsIChannel::LOAD_NORMAL, + nsISupports * aHistoryState=nsnull, + const PRUnichar* aReferrer=nsnull, + const char * aWindowTarget = nsnull); + + NS_IMETHOD LoadURI(nsIURI * aUri, + const char * aCommand, + nsIInputStream* aPostDataStream=nsnull, + PRBool aModifyHistory=PR_TRUE, + nsLoadFlags aType = nsIChannel::LOAD_NORMAL, + nsISupports * aHistoryState=nsnull, + const PRUnichar* aReferrer=nsnull, + const char * aWindowTarget = nsnull); + */ + void SetReferrer(const PRUnichar* aReferrer); + + // History api's + NS_IMETHOD GoTo(PRInt32 aHistoryIndex); + NS_IMETHOD GetHistoryLength(PRInt32& aResult); + NS_IMETHOD GetHistoryIndex(PRInt32& aResult); + NS_IMETHOD GetURL(PRInt32 aHistoryIndex, const PRUnichar** aURLResult); + + // nsIWebShellContainer + NS_IMETHOD SetHistoryState(nsISupports* aLayoutHistoryState); + NS_IMETHOD FireUnloadEvent(void); + + // nsILinkHandler + NS_IMETHOD OnLinkClick(nsIContent* aContent, + nsLinkVerb aVerb, + const PRUnichar* aURLSpec, + const PRUnichar* aTargetSpec, + nsIInputStream* aPostDataStream = 0); + NS_IMETHOD OnOverLink(nsIContent* aContent, + const PRUnichar* aURLSpec, + const PRUnichar* aTargetSpec); + NS_IMETHOD GetLinkState(const nsString& aLinkURI, nsLinkState& aState); + + + NS_IMETHOD FindNext(const PRUnichar * aSearchStr, PRBool aMatchCase, PRBool aSearchDown, PRBool &aIsFound); + + // nsIBaseWindow + NS_IMETHOD SetPositionAndSize(PRInt32 x, PRInt32 y, PRInt32 cx, + PRInt32 cy, PRBool fRepaint); + NS_IMETHOD GetPositionAndSize(PRInt32* x, PRInt32* y, + PRInt32* cx, PRInt32* cy); + NS_IMETHOD Create(); + NS_IMETHOD Destroy(); + + // nsWebShell + nsIEventQueue* GetEventQueue(void); + void HandleLinkClickEvent(nsIContent *aContent, + nsLinkVerb aVerb, + const PRUnichar* aURLSpec, + const PRUnichar* aTargetSpec, + nsIInputStream* aPostDataStream = 0); + + static nsEventStatus PR_CALLBACK HandleEvent(nsGUIEvent *aEvent); + + NS_IMETHOD SetURL(const PRUnichar* aURL); + +protected: + void GetRootWebShellEvenIfChrome(nsIWebShell** aResult); + void InitFrameData(); + + nsIEventQueue* mThreadEventQueue; + + nsIWebShellContainer* mContainer; + nsIDocumentLoader* mDocLoader; + + PRBool mFiredUnloadEvent; + + nsRect mBounds; + + eCharsetReloadState mCharsetReloadState; + + nsISupports* mHistoryState; // Weak reference. Session history owns this. + + nsresult FireUnloadForChildren(); + + nsresult CreateViewer(nsIChannel* aChannel, + const char* aContentType, + const char* aCommand, + nsIStreamListener** aResult); + +#ifdef DETECT_WEBSHELL_LEAKS +private: + // We're counting the number of |nsWebShells| to help find leaks + static unsigned long gNumberOfWebShells; +#endif +}; + +#endif \ No newline at end of file diff --git a/docshell/build/nsDocShellModule.cpp b/docshell/build/nsDocShellModule.cpp index 74beceba031..f024141d997 100644 --- a/docshell/build/nsDocShellModule.cpp +++ b/docshell/build/nsDocShellModule.cpp @@ -20,98 +20,27 @@ * Travis Bogard */ +#include "nsIModule.h" #include "nsIGenericFactory.h" -#include "nsIComponentManager.h" -#include "nsIServiceManager.h" +#include "nsWebShell.h" -#include "nsDocShell.h" +NS_GENERIC_FACTORY_CONSTRUCTOR(nsWebShell); -// Factory Constructors +// Currently no-one is instanciating docshell's directly because +// nsWebShell is still our main "shell" class. nsWebShell is a subclass +// of nsDocShell. Once migration is complete, docshells will be the main +// "shell" class and this module will need to register the docshell as +// a component +//NS_GENERIC_FACTORY_CONSTRUCTOR(nsDocShell); -NS_GENERIC_FACTORY_CONSTRUCTOR(nsDocShell) - -static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID); -static NS_DEFINE_CID(kDocShellCID, NS_DOCSHELL_CID); - -//***************************************************************************** -//*** Library Exports -//***************************************************************************** - -extern "C" PR_IMPLEMENT(nsresult) -NSGetFactory(nsISupports* aServMgr, - const nsCID &aClass, - const char *aClassName, - const char *aProgID, - nsIFactory **aFactory) -{ - NS_ENSURE_ARG_POINTER(aFactory); - nsresult rv; - - nsIGenericFactory* fact; - - if(aClass.Equals(kDocShellCID)) - rv = NS_NewGenericFactory(&fact, nsDocShellConstructor); - else - rv = NS_NOINTERFACE; - - if(NS_SUCCEEDED(rv)) - *aFactory = fact; - return rv; -} - -extern "C" PR_IMPLEMENT(nsresult) -NSRegisterSelf(nsISupports* aServMgr , const char* aPath) -{ - nsresult rv; - NS_WITH_SERVICE1(nsIComponentManager, compMgr, aServMgr, kComponentManagerCID, &rv); - NS_ENSURE_SUCCESS(rv, rv); - - rv = compMgr->RegisterComponent(kDocShellCID, - "nsDocShell", - NS_DOCSHELL_PROGID, - aPath, PR_TRUE, PR_TRUE); - NS_ENSURE_SUCCESS(rv, rv); - - return rv; -} - -extern "C" PR_IMPLEMENT(nsresult) -NSUnregisterSelf(nsISupports* aServMgr, const char* aPath) -{ - nsresult rv; - - NS_WITH_SERVICE1(nsIComponentManager, compMgr, aServMgr, kComponentManagerCID, &rv); - NS_ENSURE_SUCCESS(rv, rv); - rv = compMgr->UnregisterComponent(kDocShellCID, aPath); - NS_ENSURE_SUCCESS(rv, rv); - - return rv; -} - - -/*#include "nsIModule.h" -#include "nsIGenericFactory.h" - -#include "nsDocShell.h" - - - -// Factory Constructors - -//NS_GENERIC_FACTORY_CONSTRUCTOR(nsDocShell) - - -// Component Table - -static nsModuleComponentInfo components[] = -{ - { "DocShell Component", NS_DOCSHELL_CID, NS_DOCSHELL_PROGID, nsDocShellConstructor } +static nsModuleComponentInfo gDocShellModuleInfo[] = { + { "WebShell", + NS_WEB_SHELL_CID, + "component://netscape/webshell", + nsWebShellConstructor } }; - -// NSGetModule implementation. - -NS_IMPL_NSGETMODULE("nsDocShellModule", components) - - */ +// "docshell provider" to illustrate that this thing really *should* +// be dispensing docshells rather than webshells. +NS_IMPL_NSGETMODULE("docshell provider", gDocShellModuleInfo) diff --git a/embedding/browser/activex/src/control/MozillaBrowser.cpp b/embedding/browser/activex/src/control/MozillaBrowser.cpp index caf9a7658c8..e6b80ceed6a 100644 --- a/embedding/browser/activex/src/control/MozillaBrowser.cpp +++ b/embedding/browser/activex/src/control/MozillaBrowser.cpp @@ -1647,16 +1647,10 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::Navigate(BSTR URL, VARIANT __RPC_FAR mLastPostData.Copy(PostData); } - nsIPostData *pIPostData = nsnull; if (PostData && PostData->vt == VT_BSTR) { USES_CONVERSION; char *szPostData = OLE2A(PostData->bstrVal); -#if 0 - // TODO fix - // Create post data from string - NS_NewPostData(PR_FALSE, szPostData, &pIPostData); -#endif } if (lFlags & navNoHistory) { diff --git a/layout/base/public/nsIDocument.h b/layout/base/public/nsIDocument.h index 23283d39ea1..13270667bb7 100644 --- a/layout/base/public/nsIDocument.h +++ b/layout/base/public/nsIDocument.h @@ -69,23 +69,6 @@ class nsISupportsArray; { 0x94c6ceb0, 0x9447, 0x11d1, \ {0x93, 0x23, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} } -// specification for data to be sent via form "post" -// IID for the nsIPostData interface - 152ab6e0-ff13-11d1-beb9-00805f8a66dc -#define NS_IPOSTDATA_IID \ -{ 0x152ab6e0, 0xff13, 0x11d1, \ - {0xbe, 0xb9, 0x00, 0x80, 0x5f, 0x8a, 0x66, 0xdc} } - -#if 0 -class nsIPostData : public nsISupports { -public: - static const nsIID& GetIID() { static nsIID iid = NS_IPOSTDATA_IID; return iid; } - - virtual PRBool IsFile() = 0; // is the data a file (or raw data) - virtual const char* GetData() = 0; // get the file name or raw data - virtual PRInt32 GetDataLength() = 0; -}; -#endif - // The base value for the content ID counter. // This counter is used by the document to // assign a monotonically increasing ID to each content diff --git a/layout/generic/nsObjectFrame.cpp b/layout/generic/nsObjectFrame.cpp index 75c6884ba62..64c2364aa03 100644 --- a/layout/generic/nsObjectFrame.cpp +++ b/layout/generic/nsObjectFrame.cpp @@ -198,7 +198,7 @@ static NS_DEFINE_IID(kIHTMLContentIID, NS_IHTMLCONTENT_IID); static NS_DEFINE_IID(kILinkHandlerIID, NS_ILINKHANDLER_IID); static NS_DEFINE_IID(kCAppShellCID, NS_APPSHELL_CID); static NS_DEFINE_IID(kIPluginHostIID, NS_IPLUGINHOST_IID); -static NS_DEFINE_IID(kIContentViewerContainerIID, NS_ICONTENT_VIEWER_CONTAINER_IID); +static NS_DEFINE_IID(kIContentViewerContainerIID, NS_ICONTENTVIEWERCONTAINER_IID); static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID); PRIntn diff --git a/layout/html/base/src/nsObjectFrame.cpp b/layout/html/base/src/nsObjectFrame.cpp index 75c6884ba62..64c2364aa03 100644 --- a/layout/html/base/src/nsObjectFrame.cpp +++ b/layout/html/base/src/nsObjectFrame.cpp @@ -198,7 +198,7 @@ static NS_DEFINE_IID(kIHTMLContentIID, NS_IHTMLCONTENT_IID); static NS_DEFINE_IID(kILinkHandlerIID, NS_ILINKHANDLER_IID); static NS_DEFINE_IID(kCAppShellCID, NS_APPSHELL_CID); static NS_DEFINE_IID(kIPluginHostIID, NS_IPLUGINHOST_IID); -static NS_DEFINE_IID(kIContentViewerContainerIID, NS_ICONTENT_VIEWER_CONTAINER_IID); +static NS_DEFINE_IID(kIContentViewerContainerIID, NS_ICONTENTVIEWERCONTAINER_IID); static NS_DEFINE_IID(kCPluginManagerCID, NS_PLUGINMANAGER_CID); PRIntn diff --git a/webshell/makefile.win b/webshell/makefile.win index 86891e0fa57..7a530db06ef 100644 --- a/webshell/makefile.win +++ b/webshell/makefile.win @@ -23,7 +23,6 @@ DEPTH=.. DIRS=public \ - src \ !if !defined(DISABLE_TESTS) tests \ !endif diff --git a/webshell/public/MANIFEST b/webshell/public/MANIFEST index ea0e1fa2ba5..b617b302090 100644 --- a/webshell/public/MANIFEST +++ b/webshell/public/MANIFEST @@ -5,9 +5,6 @@ nsIContentViewer.h nsIDocStreamLoaderFactory.h nsILinkHandler.h -nsIUrlDispatcher.h nsIWebShell.h +nsIContentViewerFile.h nsIWebShellServices.h -nsweb.h -nsIContentViewerEdit.h -nsIContentViewerFile.h \ No newline at end of file diff --git a/webshell/public/Makefile.in b/webshell/public/Makefile.in index 5ecc625f76a..8f1e67d0f46 100644 --- a/webshell/public/Makefile.in +++ b/webshell/public/Makefile.in @@ -28,20 +28,20 @@ include $(DEPTH)/config/autoconf.mk MODULE = webshell +XPIDLSRCS = \ + .\nsIRefreshURI.idl \ + .\nsIClipboardCommands.idl \ + .\nsIContentViewerContainer.idl \ + .\nsIDocumentLoaderFactory.idl \ + $(NULL) + EXPORTS = \ - nsIClipboardCommands.h \ nsIContentViewer.h \ - nsIContentViewerContainer.h \ nsIDocStreamLoaderFactory.h \ - nsIDocumentLoaderFactory.h \ nsILinkHandler.h \ - nsIUrlDispatcher.h \ nsIWebShell.h \ - nsIWebShellServices.h \ - nsweb.h \ - nsIRefreshURI.h \ - nsIContentViewerEdit.h \ - nsIContentViewerFile.h \ + nsIContentViewerFile.h \ + nsIWebShellServices.h \ $(NULL) EXPORTS := $(addprefix $(srcdir)/, $(EXPORTS)) diff --git a/webshell/public/makefile.win b/webshell/public/makefile.win index fd53d230700..1c809f509d8 100644 --- a/webshell/public/makefile.win +++ b/webshell/public/makefile.win @@ -21,28 +21,24 @@ DEPTH=..\.. - - MODULE=raptor include <$(DEPTH)\config\config.mak> +XPIDLSRCS = \ + .\nsIRefreshURI.idl \ + .\nsIClipboardCommands.idl \ + .\nsIContentViewerContainer.idl \ + .\nsIDocumentLoaderFactory.idl \ + $(NULL) + EXPORTS = \ - nsIClipboardCommands.h \ nsIContentViewer.h \ - nsIContentViewerContainer.h \ nsIDocStreamLoaderFactory.h \ - nsIDocumentLoaderFactory.h \ nsILinkHandler.h \ - nsIUrlDispatcher.h \ nsIWebShell.h \ + nsIContentViewerFile.h \ nsIWebShellServices.h \ - nsweb.h \ -!ifdef NECKO - nsIRefreshURI.h \ -!endif - nsIContentViewerEdit.h \ - nsIContentViewerFile.h \ $(NULL) include <$(DEPTH)\config\rules.mak> diff --git a/webshell/public/nsIClipboardCommands.idl b/webshell/public/nsIClipboardCommands.idl index 8115947d339..40363a5a05d 100644 --- a/webshell/public/nsIClipboardCommands.idl +++ b/webshell/public/nsIClipboardCommands.idl @@ -42,7 +42,7 @@ interface nsIClipboardCommands : nsISupports { /** * Cut the current selection onto the clipboard. */ - boolean cutSelection(); + void cutSelection(); /** * Copy the current selection onto the clipboard. diff --git a/webshell/public/nsIContentViewer.h b/webshell/public/nsIContentViewer.h index a649f44c0de..e69de29bb2d 100644 --- a/webshell/public/nsIContentViewer.h +++ b/webshell/public/nsIContentViewer.h @@ -1,87 +0,0 @@ -/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- - * - * The contents of this file are subject to the Netscape Public - * License Version 1.1 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.mozilla.org/NPL/ - * - * Software distributed under the License is distributed on an "AS - * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or - * implied. See the License for the specific language governing - * rights and limitations under the License. - * - * The Original Code is Mozilla Communicator client code. - * - * The Initial Developer of the Original Code is Netscape Communications - * Corporation. Portions created by Netscape are - * Copyright (C) 1998 Netscape Communications Corporation. All - * Rights Reserved. - * - * Contributor(s): - */ -#ifndef nsIContentViewer_h___ -#define nsIContentViewer_h___ - -#include "nsweb.h" -#include "nsIWidget.h" -#include "nsIScrollableView.h" - -// Forward declarations... -class nsIDeviceContext; -class nsString; -struct nsRect; -class nsIContentViewerContainer; -class nsIDOMDocument; - -// IID for the nsIContentViewer interface -#define NS_ICONTENT_VIEWER_IID \ - { 0xa6cf9056, 0x15b3, 0x11d2,{0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32}} - -/** - * Content viewer interface. When a stream of data is to be presented - * visually to the user, a content viewer is found for the underlying - * mime-type associated with the data in the stream. This interface - * defines the capabilities of the viewer. - */ -class nsIContentViewer : public nsISupports -{ -public: - NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICONTENT_VIEWER_IID) - - /** - * Initialize the content viewer. Make it a child of the - * the given native parent widget. - */ - NS_IMETHOD Init(nsIWidget* aParentWidget, - nsIDeviceContext* aDeviceContext, - const nsRect& aBounds)=0; - - NS_IMETHOD BindToDocument(nsISupports* aDoc, const char* aCommand) = 0; - - NS_IMETHOD SetContainer(nsISupports* aContainer) = 0; - - NS_IMETHOD GetContainer(nsISupports** aContainerResult) = 0; - - NS_IMETHOD LoadComplete(nsresult aStatus) = 0; - NS_IMETHOD Destroy(void) = 0; - NS_IMETHOD Stop(void) = 0; - - NS_IMETHOD GetDOMDocument(nsIDOMDocument **aResult) = 0; - NS_IMETHOD SetDOMDocument(nsIDOMDocument *aDocument) = 0; - - NS_IMETHOD GetBounds(nsRect& aBounds) = 0; - - NS_IMETHOD SetBounds(const nsRect& aBounds) = 0; - - NS_IMETHOD Move(PRInt32 aX, PRInt32 aY) = 0; - - NS_IMETHOD Show(void) = 0; - - NS_IMETHOD Hide(void) = 0; - - NS_IMETHOD SetEnableRendering(PRBool aOn) = 0; - - NS_IMETHOD GetEnableRendering(PRBool* aResult) = 0; -}; - -#endif /* nsIContentViewer_h___ */ diff --git a/webshell/public/nsILinkHandler.h b/webshell/public/nsILinkHandler.h index 31a2f49ee78..9fdeae463ba 100644 --- a/webshell/public/nsILinkHandler.h +++ b/webshell/public/nsILinkHandler.h @@ -22,7 +22,6 @@ #ifndef nsILinkHandler_h___ #define nsILinkHandler_h___ -#include "nsweb.h" #include "nsISupports.h" class nsIInputStream; diff --git a/webshell/public/nsIWebShell.h b/webshell/public/nsIWebShell.h index b4f67186b1f..2fa7466116c 100644 --- a/webshell/public/nsIWebShell.h +++ b/webshell/public/nsIWebShell.h @@ -22,14 +22,12 @@ #ifndef nsIWebShell_h___ #define nsIWebShell_h___ -#include "nsweb.h" #include "nsIWidget.h" #include "nsIParser.h" #include "nsIScrollableView.h" #include "nsIContentViewerContainer.h" #include "nsIChannel.h" #include "nsIScrollableView.h" -#include "nsIUrlDispatcher.h" class nsIDOMElement; class nsIDOMWindow; @@ -156,13 +154,4 @@ public: NS_IMETHOD FireUnloadEvent(void) = 0; }; -extern "C" NS_WEB nsresult -NS_NewWebShellFactory(nsIFactory** aFactory); - -#ifdef DETECT_WEBSHELL_LEAKS -extern "C" NS_WEB -unsigned long -NS_TotalWebShellsInExistence(); -#endif - #endif /* nsIWebShell_h___ */ diff --git a/webshell/public/nsIWebShellServices.h b/webshell/public/nsIWebShellServices.h index b134ff3fd45..72dfbd30a7e 100644 --- a/webshell/public/nsIWebShellServices.h +++ b/webshell/public/nsIWebShellServices.h @@ -45,7 +45,13 @@ public: nsCharsetSource aSource = kCharsetUninitialized) = 0; NS_IMETHOD StopDocumentLoad(void) = 0; NS_IMETHOD SetRendering(PRBool aRender) = 0; - }; +/* Use this macro when declaring classes that implement this interface. */ +#define NS_DECL_NSIWEBSHELLSERVICES \ + NS_IMETHOD LoadDocument(const char *aURL, const char *aCharset=nsnull, nsCharsetSource aSource=kCharsetUninitialized); \ + NS_IMETHOD ReloadDocument(const char *aCharset=nsnull, nsCharsetSource aSource=kCharsetUninitialized); \ + NS_IMETHOD StopDocumentLoad(void); \ + NS_IMETHOD SetRendering(PRBool aRender); + #endif /* nsIWebShellServices_h___ */ diff --git a/webshell/src/makefile.win b/webshell/src/makefile.win index 95bd401f9df..87f63dfb64e 100644 --- a/webshell/src/makefile.win +++ b/webshell/src/makefile.win @@ -42,11 +42,7 @@ CPP_OBJS= \ LINCS=-I..\public -I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor \ -I$(PUBLIC)\dom -I$(PUBLIC)\js \ -!ifdef NECKO -I$(PUBLIC)\necko \ -!else - -I$(PUBLIC)\netlib \ -!endif -I$(PUBLIC)\plugin -I$(PUBLIC)\java -I$(PUBLIC)\pref -I$(PUBLIC)\profile \ -I$(PUBLIC)\js -I$(DEPTH)\include -I$(PUBLIC)\jsurl \ -I$(PUBLIC)\editor -I$(PUBLIC)\rdf \ diff --git a/webshell/tests/imgtest/makefile.win b/webshell/tests/imgtest/makefile.win index 08e380bbd81..492e2d0ee27 100644 --- a/webshell/tests/imgtest/makefile.win +++ b/webshell/tests/imgtest/makefile.win @@ -35,7 +35,6 @@ OBJS = \ LLIBS= \ $(DIST)\lib\gkgfxwin.lib \ - $(DIST)\lib\gkweb.lib \ $(DIST)\lib\xpcom.lib \ $(LIBNSPR) \ $(DIST)\lib\img32$(VERSION_NUMBER).lib \ diff --git a/webshell/tests/viewer/nsMacMain.cpp b/webshell/tests/viewer/nsMacMain.cpp index ec825498877..71e9ff34d27 100644 --- a/webshell/tests/viewer/nsMacMain.cpp +++ b/webshell/tests/viewer/nsMacMain.cpp @@ -453,11 +453,6 @@ int main(int argc, char **argv) #ifdef RHAPSODY #undef DETECT_WEBSHELL_LEAKS -#endif -#ifdef DETECT_WEBSHELL_LEAKS - if ( unsigned long count = NS_TotalWebShellsInExistence() ) { - printf("XXX WARNING: Number of webshells being leaked: %d \n", count); - } #endif // Shutdown XPCOM? diff --git a/webshell/tests/viewer/nsThrobber.h b/webshell/tests/viewer/nsThrobber.h index 17875fcdd4a..fd61bb8874d 100644 --- a/webshell/tests/viewer/nsThrobber.h +++ b/webshell/tests/viewer/nsThrobber.h @@ -22,7 +22,6 @@ #ifndef nsThrobber_h___ #define nsThrobber_h___ -#include "nsweb.h" #include "nsIImageObserver.h" #include "nsIWidget.h" #include "nsVoidArray.h" diff --git a/webshell/tests/viewer/public/nsIXPBaseWindow.h b/webshell/tests/viewer/public/nsIXPBaseWindow.h index e2553fd2fc1..322bbae2753 100644 --- a/webshell/tests/viewer/public/nsIXPBaseWindow.h +++ b/webshell/tests/viewer/public/nsIXPBaseWindow.h @@ -22,7 +22,6 @@ #ifndef nsIXPBaseWindow_h___ #define nsIXPBaseWindow_h___ -#include "nsweb.h" #include "nsISupports.h" class nsIAppShell; diff --git a/xpfe/bootstrap/makefile.win b/xpfe/bootstrap/makefile.win index ac2c746f717..2343d874db4 100644 --- a/xpfe/bootstrap/makefile.win +++ b/xpfe/bootstrap/makefile.win @@ -100,9 +100,6 @@ LLIBS= \ $(DIST)\lib\xpcom.lib \ $(DIST)\lib\js3250.lib \ $(DIST)\lib\gkgfxwin.lib \ -!ifdef DETECT_WEBSHELL_LEAKS - $(DIST)\lib\gkweb.lib \ -!endif !ifdef GC_LEAK_DETECTOR $(DIST)\lib\boehm.lib \ !endif diff --git a/xpfe/bootstrap/nsAppRunner.cpp b/xpfe/bootstrap/nsAppRunner.cpp index 4a377e09cfa..4be23ba3e9a 100644 --- a/xpfe/bootstrap/nsAppRunner.cpp +++ b/xpfe/bootstrap/nsAppRunner.cpp @@ -1098,14 +1098,6 @@ int main(int argc, char* argv[]) rv = NS_ShutdownXPCOM( NULL ); NS_ASSERTION(NS_SUCCEEDED(rv), "NS_ShutdownXPCOM failed"); -#ifdef DETECT_WEBSHELL_LEAKS - unsigned long count; - count = NS_TotalWebShellsInExistence(); - if (count) { - printf("XXX WARNING: Number of webshells being leaked: %d \n", (int)count); - } -#endif - return TranslateReturnValue(mainResult); }