зеркало из https://github.com/mozilla/pjs.git
Create a new xpcom obsolete library (and component library).
Moved nsFileSpec and related classes into this obsolete library. Moved nsRegistry and related libreg functionality into the obsolete library. Updated many callers using the obsolete nsFile spec to use nsIFile and Necko to do file IO. Combined the following DLLs (source -> dest) uriloader -> docshell shistory -> docshell jsurl -> jsdom gkview -> gklayout Moved nsAdapterEnumerator out of xpcom/ds and into mailnews, since they're the only consumer Modifed the xpt_link tool so that you can specify a �only include� cid list that can mask CID�s that you are not interested in. Added build options: Prevent the building of xpinstall (--disable-xpinstall) Prevent the building js component loader (--disable-jsloader) A build option to only build a single profile (--enable-single-profile) A build flag to only built the required xpfe components (--disable-xpfe-components). Removal or hiding of unused functions and classes including nsEscape*, nsDequeIterator, nsRecyclingAllocatorImpl, nsDiscriminatedUnion, nsOpaqueKey, nsCRT::strlen, NS_NewCommandLineService Bug 194240, r/sr = darin, alec.
This commit is contained in:
Родитель
8d96a3f128
Коммит
be629223b6
|
@ -128,6 +128,7 @@ tier_2_dirs += \
|
|||
modules/libreg \
|
||||
string \
|
||||
xpcom \
|
||||
xpcom/obsolete \
|
||||
$(NULL)
|
||||
|
||||
ifdef NS_TRACE_MALLOC
|
||||
|
@ -184,6 +185,7 @@ tier_9_dirs += \
|
|||
content \
|
||||
layout \
|
||||
db \
|
||||
xpfe/components/shistory \
|
||||
docshell \
|
||||
webshell \
|
||||
profile \
|
||||
|
@ -206,7 +208,11 @@ ifdef MOZ_JPROF
|
|||
tier_9_dirs += tools/jprof
|
||||
endif
|
||||
|
||||
tier_9_dirs += xpfe xpinstall
|
||||
tier_9_dirs += xpfe
|
||||
|
||||
ifdef MOZ_XPINSTALL
|
||||
tier_9_dirs += xpinstall
|
||||
endif
|
||||
|
||||
ifdef MOZ_LEAKY
|
||||
tier_9_dirs += tools/leaky
|
||||
|
|
|
@ -177,6 +177,7 @@ intl/uconv/ucvtw/Makefile
|
|||
intl/uconv/ucvtw2/Makefile
|
||||
intl/uconv/ucvko/Makefile
|
||||
intl/uconv/ucvibm/Makefile
|
||||
intl/uconv/native/Makefile
|
||||
intl/locale/Makefile
|
||||
intl/locale/public/Makefile
|
||||
intl/locale/idl/Makefile
|
||||
|
@ -337,6 +338,7 @@ MAKEFILES_libreg="
|
|||
modules/libreg/Makefile
|
||||
modules/libreg/include/Makefile
|
||||
modules/libreg/src/Makefile
|
||||
modules/libreg/standalone/Makefile
|
||||
"
|
||||
|
||||
MAKEFILES_libpref="
|
||||
|
@ -585,6 +587,8 @@ xpcom/reflect/xptinfo/Makefile
|
|||
xpcom/reflect/xptinfo/public/Makefile
|
||||
xpcom/reflect/xptinfo/src/Makefile
|
||||
xpcom/reflect/xptinfo/tests/Makefile
|
||||
xpcom/obsolete/Makefile
|
||||
xpcom/obsolete/component/Makefile
|
||||
xpcom/proxy/Makefile
|
||||
xpcom/proxy/public/Makefile
|
||||
xpcom/proxy/src/Makefile
|
||||
|
|
|
@ -851,6 +851,8 @@ sub BuildClientDist()
|
|||
|
||||
#LIBREG
|
||||
InstallFromManifest(":mozilla:modules:libreg:include:MANIFEST", "$distdirectory:libreg:");
|
||||
InstallFromManifest(":mozilla:modules:libreg:xpcom:MANIFEST", "$distdirectory:mozreg:");
|
||||
InstallFromManifest(":mozilla:modules:libreg:xpcom:MANIFEST_IDL", "$distdirectory:idl:");
|
||||
|
||||
#STRING
|
||||
InstallFromManifest(":mozilla:string:public:MANIFEST", "$distdirectory:string:");
|
||||
|
@ -1427,6 +1429,7 @@ sub BuildIDLProjects()
|
|||
BuildIDLProject(":mozilla:security:manager:boot:macbuild:pipbootIDL.xml", "pipboot");
|
||||
}
|
||||
|
||||
BuildIDLProject(":mozilla:modules:libreg:xpcom:macbuild:mozregIDL.xml", "mozreg");
|
||||
BuildIDLProject(":mozilla:modules:libpref:macbuild:libprefIDL.xml", "libpref");
|
||||
BuildIDLProject(":mozilla:modules:libutil:macbuild:libutilIDL.xml", "libutil");
|
||||
BuildIDLProject(":mozilla:modules:libjar:macbuild:libjarIDL.xml", "libjar");
|
||||
|
@ -1701,6 +1704,7 @@ sub BuildCommonProjects()
|
|||
|
||||
BuildOneProject(":mozilla:modules:libreg:macbuild:libreg.xml", "libreg$D.shlb", 1, $main::ALIAS_SYM_FILES, 0);
|
||||
BuildOneProject(":mozilla:xpcom:macbuild:xpcomPPC.xml", "xpcom$D.shlb", 1, $main::ALIAS_SYM_FILES, 0);
|
||||
BuildOneProject(":mozilla:modules:libreg:xpcom:macbuild:mozreg.xml", "mozreg$D.shlb", 1, $main::ALIAS_SYM_FILES, 1);
|
||||
BuildOneProject(":mozilla:js:macbuild:JavaScript.xml", "JavaScript$D.shlb", 1, $main::ALIAS_SYM_FILES, 0);
|
||||
BuildOneProject(":mozilla:js:macbuild:LiveConnect.xml", "LiveConnect$D.$S", 1, $main::ALIAS_SYM_FILES, 0);
|
||||
|
||||
|
|
|
@ -44,8 +44,6 @@
|
|||
|
||||
#include <string.h>
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIFileSpec.h"
|
||||
#include "nsSpecialSystemDirectory.h"
|
||||
#include "nsIChromeRegistry.h"
|
||||
#include "nsChromeRegistry.h"
|
||||
#include "nsChromeUIDataSource.h"
|
||||
|
|
|
@ -87,6 +87,10 @@ ENABLE_TESTS = @ENABLE_TESTS@
|
|||
IBMBIDI = @IBMBIDI@
|
||||
SUNCTL = @SUNCTL@
|
||||
ACCESSIBILITY = @ACCESSIBILITY@
|
||||
MOZ_XPINSTALL = @MOZ_XPINSTALL@
|
||||
MOZ_JSLOADER = @MOZ_JSLOADER@
|
||||
MOZ_USE_NATIVE_UCONV = @MOZ_USE_NATIVE_UCONV@
|
||||
MOZ_SINGLE_PROFILE = @MOZ_SINGLE_PROFILE@
|
||||
MOZ_LDAP_XPCOM = @MOZ_LDAP_XPCOM@
|
||||
MOZ_LDAP_XPCOM_EXPERIMENTAL = @MOZ_LDAP_XPCOM_EXPERIMENTAL@
|
||||
XPCOM_USE_LEA = @XPCOM_USE_LEA@
|
||||
|
@ -96,6 +100,9 @@ MOZ_INSTALLER = @MOZ_INSTALLER@
|
|||
MOZ_NO_ACTIVEX_SUPPORT = @MOZ_NO_ACTIVEX_SUPPORT@
|
||||
MOZ_ACTIVEX_SCRIPTING_SUPPORT = @MOZ_ACTIVEX_SCRIPTING_SUPPORT@
|
||||
XPC_IDISPATCH_SUPPORT = @MOZ_ACTIVEX_SCRIPTING_SUPPORT@
|
||||
MOZ_JSLOADER = @MOZ_JSLOADER@
|
||||
MOZ_XPINSTALL = @MOZ_XPINSTALL@
|
||||
MOZ_XPFE_COMPONENTS = @MOZ_XPFE_COMPONENTS@
|
||||
|
||||
MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS = @MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS@
|
||||
MOZ_COMPONENT_NSPR_LIBS=@MOZ_COMPONENT_NSPR_LIBS@
|
||||
|
@ -289,6 +296,7 @@ NSPR_LIBS = @NSPR_LIBS@
|
|||
LDAP_CFLAGS = @LDAP_CFLAGS@
|
||||
LDAP_LIBS = @LDAP_LIBS@
|
||||
XPCOM_GLUE_LIBS = @XPCOM_GLUE_LIBS@
|
||||
MOZ_XPCOM_OBSOLETE_LIBS = @MOZ_XPCOM_OBSOLETE_LIBS@
|
||||
|
||||
|
||||
# UNIX98 iconv support
|
||||
|
|
63
configure.in
63
configure.in
|
@ -498,6 +498,7 @@ XPCOM_LIBS='-L$(DIST)/bin -lxpcom'
|
|||
|
||||
MOZ_COMPONENT_NSPR_LIBS='-L$(DIST)/bin $(NSPR_LIBS)'
|
||||
MOZ_COMPONENT_XPCOM_LIBS='$(XPCOM_LIBS)'
|
||||
MOZ_XPCOM_OBSOLETE_LIBS='-L$(DIST)/lib -lxpcom_compat'
|
||||
|
||||
_PLATFORM_DEFAULT_TOOLKIT=gtk
|
||||
MOZ_WIDGET_TOOLKIT_LDFLAGS='-lwidget_$(MOZ_WIDGET_TOOLKIT)'
|
||||
|
@ -1034,6 +1035,7 @@ case "$target" in
|
|||
XPCOM_LIBS='$(DIST)/lib/xpcom.lib'
|
||||
MOZ_COMPONENT_NSPR_LIBS='$(NSPR_LIBS)'
|
||||
MOZ_COMPONENT_XPCOM_LIBS='$(XPCOM_LIBS)'
|
||||
MOZ_XPCOM_OBSOLETE_LIBS='$(DIST)/lib/xpcom_compat.lib'
|
||||
fi
|
||||
AC_DEFINE(HAVE_SNPRINTF)
|
||||
AC_DEFINE(_WINDOWS)
|
||||
|
@ -1259,6 +1261,7 @@ case "$target" in
|
|||
AC_DEFINE(OS2EMX_PLAIN_CHAR)
|
||||
MOZ_COMPONENT_NSPR_LIBS='-L$(DIST)/lib $(NSPR_LIBS)'
|
||||
MOZ_COMPONENT_XPCOM_LIBS='-L$(DIST)/lib $(DIST)/lib/xpcom.lib'
|
||||
MOZ_XPCOM_OBSOLETE_LIBS='-L$(DIST)/lib $(DIST)/lib/xpcom_compat.lib'
|
||||
XPCOM_LIBS='-L$(DIST)/lib -lxpcom'
|
||||
MOZ_JS_LIBS='$(DIST)/lib/libmozjs.lib'
|
||||
MOZ_COMPONENT_XPCOM_LIBS='$(DIST)/lib/libxpcom.lib'
|
||||
|
@ -1305,6 +1308,7 @@ case "$target" in
|
|||
MKCSHLIB='$(LD) $(DSO_LDOPTS)'
|
||||
MOZ_JS_LIBS='$(DIST)/lib/mozjs.lib'
|
||||
MOZ_COMPONENT_XPCOM_LIBS='$(DIST)/lib/xpcom.lib'
|
||||
MOZ_XPCOM_OBSOLETE_LIBS='$(DIST)/lib/xpcom_compat.lib'
|
||||
XPCOM_LIBS='$(DIST)/lib/xpcom.lib'
|
||||
MOZ_JPEG_LIBS='$(DIST)/lib/mozjpeg.$(LIB_SUFFIX)'
|
||||
MOZ_ZLIB_LIBS='$(DIST)/lib/mozz.$(LIB_SUFFIX)'
|
||||
|
@ -3372,6 +3376,57 @@ if test "$ACCESSIBILITY"; then
|
|||
AC_DEFINE(ACCESSIBILITY)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl xpfe/components on by default
|
||||
dnl ========================================================
|
||||
MOZ_XPFE_COMPONENTS=1
|
||||
MOZ_ARG_DISABLE_BOOL(xpfe-components,
|
||||
[ --disable-xpfe-components Disable xpfe components],
|
||||
MOZ_XPFE_COMPONENTS= )
|
||||
|
||||
dnl ========================================================
|
||||
dnl xpinstall support on by default
|
||||
dnl ========================================================
|
||||
MOZ_XPINSTALL=1
|
||||
MOZ_ARG_DISABLE_BOOL(xpinstall,
|
||||
[ --disable-xpinstall Disable xpinstall support],
|
||||
MOZ_XPINSTALL= )
|
||||
if test "$MOZ_XPINSTALL"; then
|
||||
AC_DEFINE(MOZ_XPINSTALL)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl Single profile support off by default
|
||||
dnl ========================================================
|
||||
MOZ_SINGLE_PROFILE=
|
||||
MOZ_ARG_ENABLE_BOOL(single-profile,
|
||||
[ --enable-single-profile Enable single profile support ],
|
||||
MOZ_SINGLE_PROFILE=1,
|
||||
MOZ_SINGLE_PROFILE= )
|
||||
|
||||
dnl ========================================================
|
||||
dnl xpcom js loader support on by default
|
||||
dnl ========================================================
|
||||
MOZ_JSLOADER=1
|
||||
MOZ_ARG_DISABLE_BOOL(jsloader,
|
||||
[ --disable-jsloader Disable xpcom js loader support],
|
||||
MOZ_JSLOADER= )
|
||||
if test "$MOZ_JSLOADER"; then
|
||||
AC_DEFINE(MOZ_JSLOADER)
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
dnl use native unicode converters
|
||||
dnl ========================================================
|
||||
MOZ_USE_NATIVE_UCONV=
|
||||
MOZ_ARG_ENABLE_BOOL(native-uconv,
|
||||
[ --enable-native-uconv enable iconv support],
|
||||
MOZ_USE_NATIVE_UCONV=1 )
|
||||
if test "$MOZ_USE_NATIVE_UCONV"; then
|
||||
AC_DEFINE(MOZ_USE_NATIVE_UCONV)
|
||||
fi
|
||||
|
||||
|
||||
dnl ========================================================
|
||||
dnl Libeditor can be build as plaintext-only,
|
||||
dnl or as a full html and text editing component.
|
||||
|
@ -4590,8 +4645,10 @@ dnl = Cleanup section for misc ordering snafus
|
|||
dnl =
|
||||
if test "$OS_ARCH" = "WINNT" -a -z "$GNU_CC"; then
|
||||
XPCOM_GLUE_LIBS='$(DIST)/lib/$(LIB_PREFIX)xpcomglue.$(LIB_SUFFIX) $(DIST)/lib/$(LIB_PREFIX)string_s.$(LIB_SUFFIX) $(DIST)/lib/$(LIB_PREFIX)string_obsolete_s.$(LIB_SUFFIX)'
|
||||
MOZ_XPCOM_OBSOLETE_LIBS='$(DIST)/lib/$(LIB_PREFIX)xpcom_compat.$(LIB_SUFFIX)'
|
||||
else
|
||||
XPCOM_GLUE_LIBS='-L${DIST}/bin -L${DIST}/lib -lxpcomglue -lstring_s -lstring_obsolete_s'
|
||||
MOZ_XPCOM_OBSOLETE_LIBS='-L${DIST}/bin -L${DIST}/lib -lxpcom_compat'
|
||||
fi
|
||||
|
||||
dnl ========================================================
|
||||
|
@ -4685,6 +4742,8 @@ AC_SUBST(MOZ_LOG_REFCNT)
|
|||
AC_SUBST(MOZ_LEAKY)
|
||||
AC_SUBST(MOZ_JPROF)
|
||||
AC_SUBST(MOZ_XPCTOOLS)
|
||||
AC_SUBST(MOZ_JSLOADER)
|
||||
AC_SUBST(MOZ_USE_NATIVE_UCONV)
|
||||
AC_SUBST(MOZ_INSURE)
|
||||
AC_SUBST(MOZ_INSURE_DIRS)
|
||||
AC_SUBST(MOZ_INSURE_EXCLUDE_DIRS)
|
||||
|
@ -4714,6 +4773,9 @@ AC_SUBST(ENABLE_TESTS)
|
|||
AC_SUBST(IBMBIDI)
|
||||
AC_SUBST(SUNCTL)
|
||||
AC_SUBST(ACCESSIBILITY)
|
||||
AC_SUBST(MOZ_XPINSTALL)
|
||||
AC_SUBST(MOZ_SINGLE_PROFILE)
|
||||
AC_SUBST(MOZ_XPFE_COMPONENTS)
|
||||
AC_SUBST(MOZ_USER_DIR)
|
||||
|
||||
AC_SUBST(ENABLE_STRIP)
|
||||
|
@ -4722,6 +4784,7 @@ AC_SUBST(USE_PREBINDING)
|
|||
AC_SUBST(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
|
||||
AC_SUBST(MOZ_COMPONENT_NSPR_LIBS)
|
||||
AC_SUBST(MOZ_COMPONENT_XPCOM_LIBS)
|
||||
AC_SUBST(MOZ_XPCOM_OBSOLETE_LIBS)
|
||||
AC_SUBST(XPCOM_LIBS)
|
||||
|
||||
AC_SUBST(MOZ_BUILD_ROOT)
|
||||
|
|
|
@ -39,15 +39,12 @@
|
|||
|
||||
// JBK added for submit move from content frame
|
||||
#include "nsIFile.h"
|
||||
#include "nsIFileStreams.h"
|
||||
#include "nsIFileSpec.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsIFormProcessor.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsIPrefBranch.h"
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsSpecialSystemDirectory.h"
|
||||
#include "nsLinebreakConverter.h"
|
||||
#include "nsICharsetConverterManager.h"
|
||||
#include "xp_path.h"
|
||||
|
|
|
@ -57,6 +57,7 @@
|
|||
#include "nsIDOMEvent.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsHTMLAtoms.h"
|
||||
#include "nsXULAtoms.h"
|
||||
#include "nsINameSpaceManager.h"
|
||||
#include "nsIXBLDocumentInfo.h"
|
||||
#include "nsIDocument.h"
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
#include "nsContentPolicyUtils.h" // NS_CheckContentLoadPolicy(...)
|
||||
#include "nsICategoryManager.h"
|
||||
#include "nsXPCOMCID.h"
|
||||
#include "nsISeekableStream.h"
|
||||
|
||||
// we want to explore making the document own the load group
|
||||
// so we can associate the document URI with the load group.
|
||||
|
@ -83,7 +84,6 @@
|
|||
#include "nsIWebProgress.h"
|
||||
#include "nsILayoutHistoryState.h"
|
||||
#include "nsITimer.h"
|
||||
#include "nsIFileStream.h"
|
||||
#include "nsISHistoryInternal.h"
|
||||
#include "nsIPrincipal.h"
|
||||
#include "nsIHistoryEntry.h"
|
||||
|
|
|
@ -113,11 +113,11 @@ typedef unsigned long HMTX;
|
|||
#include "nsIController.h"
|
||||
#include "nsIFocusController.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIFileStream.h"
|
||||
#include "nsISHistoryInternal.h"
|
||||
|
||||
#include "nsIHttpChannel.h"
|
||||
#include "nsIUploadChannel.h"
|
||||
#include "nsISeekableStream.h"
|
||||
|
||||
#include "nsILocaleService.h"
|
||||
#include "nsIStringBundle.h"
|
||||
|
|
|
@ -40,7 +40,6 @@ REQUIRES = xpcom \
|
|||
necko \
|
||||
gfx \
|
||||
layout \
|
||||
uriloader \
|
||||
webshell \
|
||||
widget \
|
||||
pref \
|
||||
|
@ -54,6 +53,15 @@ REQUIRES = xpcom \
|
|||
commandhandler \
|
||||
$(NULL)
|
||||
|
||||
REQUIRES += \
|
||||
uriloader \
|
||||
exthandler \
|
||||
helperAppDlg \
|
||||
mimetype \
|
||||
rdf \
|
||||
prefetch \
|
||||
$(NULL)
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
EXTRA_DSO_LIBS = gkgfx
|
||||
endif
|
||||
|
@ -70,12 +78,17 @@ CPPSRCS = \
|
|||
|
||||
SHARED_LIBRARY_LIBS= \
|
||||
$(DIST)/lib/$(LIB_PREFIX)basedocshell_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)uriloaderbase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)exthandler_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)prefetch_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)shistory_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DSO_LDOPTS= \
|
||||
$(LIBS_DIR) \
|
||||
$(EXTRA_DSO_LIBS) \
|
||||
$(MOZ_JS_LIBS) \
|
||||
$(MOZ_UNICHARUTIL_LIBS) \
|
||||
$(MOZ_COMPONENT_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
|
@ -84,5 +97,20 @@ include $(topsrcdir)/config/rules.mk
|
|||
LOCAL_INCLUDES = \
|
||||
-I$(srcdir) \
|
||||
-I$(srcdir)/../base \
|
||||
-I$(topsrcdir)/uriloader/base \
|
||||
-I$(topsrcdir)/uriloader/prefetch \
|
||||
-I$(topsrcdir)/uriloader/exthandler \
|
||||
-I$(topsrcdir)/xpfe/components/shistory/src \
|
||||
$(NULL)
|
||||
|
||||
ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
|
||||
LOCAL_INCLUDES += -I$(topsrcdir)/uriloader/exthandler/mac
|
||||
EXTRA_DSO_LDOPTS += \
|
||||
$(TK_LIBS) \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
OS_LIBS += shell32.lib
|
||||
endif
|
||||
|
||||
|
|
|
@ -25,9 +25,39 @@
|
|||
#include "nsWebShell.h"
|
||||
#include "nsDefaultURIFixup.h"
|
||||
|
||||
// uriloader
|
||||
#include "nsURILoader.h"
|
||||
#include "nsDocLoader.h"
|
||||
#include "nsOSHelperAppService.h"
|
||||
#include "nsExternalProtocolHandler.h"
|
||||
#include "nsPrefetchService.h"
|
||||
|
||||
// session history
|
||||
#include "nsSHEntry.h"
|
||||
#include "nsSHistory.h"
|
||||
#include "nsSHTransaction.h"
|
||||
|
||||
// docshell
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsWebShell);
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDefaultURIFixup);
|
||||
|
||||
// uriloader
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsURILoader)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsDocLoaderImpl, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsOSHelperAppService, Init)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsExternalProtocolHandler)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrefetchService, Init)
|
||||
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
#include "nsInternetConfigService.h"
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsInternetConfigService);
|
||||
#endif
|
||||
|
||||
// session history
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSHEntry)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSHTransaction)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSHistory, Init)
|
||||
|
||||
// Currently no-one is instantiating 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
|
||||
|
@ -36,6 +66,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDefaultURIFixup);
|
|||
//NS_GENERIC_FACTORY_CONSTRUCTOR(nsDocShell);
|
||||
|
||||
static const nsModuleComponentInfo gDocShellModuleInfo[] = {
|
||||
// docshell
|
||||
{ "WebShell",
|
||||
NS_WEB_SHELL_CID,
|
||||
"@mozilla.org/webshell;1",
|
||||
|
@ -45,7 +76,39 @@ static const nsModuleComponentInfo gDocShellModuleInfo[] = {
|
|||
NS_DEFAULTURIFIXUP_CID,
|
||||
NS_URIFIXUP_CONTRACTID,
|
||||
nsDefaultURIFixupConstructor
|
||||
}
|
||||
},
|
||||
|
||||
// uriloader
|
||||
{ "Netscape URI Loader Service", NS_URI_LOADER_CID, NS_URI_LOADER_CONTRACTID, nsURILoaderConstructor, },
|
||||
{ "Netscape Doc Loader", NS_DOCUMENTLOADER_CID, NS_DOCUMENTLOADER_CONTRACTID, nsDocLoaderImplConstructor, },
|
||||
{ "Netscape Doc Loader Service", NS_DOCUMENTLOADER_SERVICE_CID, NS_DOCUMENTLOADER_SERVICE_CONTRACTID,
|
||||
nsDocLoaderImplConstructor, },
|
||||
{ "Netscape External Helper App Service", NS_EXTERNALHELPERAPPSERVICE_CID, NS_EXTERNALHELPERAPPSERVICE_CONTRACTID,
|
||||
nsOSHelperAppServiceConstructor, },
|
||||
{ "Netscape External Helper App Service", NS_EXTERNALHELPERAPPSERVICE_CID, NS_EXTERNALPROTOCOLSERVICE_CONTRACTID,
|
||||
nsOSHelperAppServiceConstructor, },
|
||||
{ "Netscape Mime Mapping Service", NS_EXTERNALHELPERAPPSERVICE_CID, NS_MIMESERVICE_CONTRACTID,
|
||||
nsOSHelperAppServiceConstructor, },
|
||||
{ "Netscape Default Protocol Handler", NS_EXTERNALPROTOCOLHANDLER_CID, NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX"default",
|
||||
nsExternalProtocolHandlerConstructor, },
|
||||
{ NS_PREFETCHSERVICE_CLASSNAME, NS_PREFETCHSERVICE_CID, NS_PREFETCHSERVICE_CONTRACTID,
|
||||
nsPrefetchServiceConstructor, },
|
||||
#if defined(XP_MAC) || defined(XP_MACOSX)
|
||||
{ "Internet Config Service", NS_INTERNETCONFIGSERVICE_CID, NS_INTERNETCONFIGSERVICE_CONTRACTID,
|
||||
nsInternetConfigServiceConstructor, },
|
||||
#endif
|
||||
|
||||
// session history
|
||||
{ "nsSHEntry", NS_SHENTRY_CID,
|
||||
NS_SHENTRY_CONTRACTID, nsSHEntryConstructor },
|
||||
{ "nsSHEntry", NS_HISTORYENTRY_CID,
|
||||
NS_HISTORYENTRY_CONTRACTID, nsSHEntryConstructor },
|
||||
{ "nsSHTransaction", NS_SHTRANSACTION_CID,
|
||||
NS_SHTRANSACTION_CONTRACTID, nsSHTransactionConstructor },
|
||||
{ "nsSHistory", NS_SHISTORY_CID,
|
||||
NS_SHISTORY_CONTRACTID, nsSHistoryConstructor },
|
||||
{ "nsSHistory", NS_SHISTORY_INTERNAL_CID,
|
||||
NS_SHISTORY_INTERNAL_CONTRACTID, nsSHistoryConstructor }
|
||||
};
|
||||
|
||||
// "docshell provider" to illustrate that this thing really *should*
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
#include "nsXPIDLString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsDOMClassInfo.h"
|
||||
|
||||
//
|
||||
// History class implementation
|
||||
//
|
||||
|
|
|
@ -44,8 +44,11 @@ REQUIRES = xpcom \
|
|||
sidebar \
|
||||
plugin \
|
||||
necko \
|
||||
jsurl \
|
||||
uconv \
|
||||
$(NULL)
|
||||
IS_COMPONENT = 1
|
||||
|
||||
IS_COMPONENT=1
|
||||
MODULE_NAME = DOM_components
|
||||
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
|
@ -64,6 +67,7 @@ CPPSRCS = \
|
|||
SHARED_LIBRARY_LIBS = \
|
||||
$(DIST)/lib/$(LIB_PREFIX)jsdombase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)jsdomevents_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)jsurl_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DSO_LDOPTS = \
|
||||
|
|
|
@ -52,6 +52,8 @@
|
|||
#include "nsScriptNameSpaceManager.h"
|
||||
#include "nsDOMException.h"
|
||||
|
||||
#include "nsJSProtocolHandler.h"
|
||||
|
||||
extern nsresult NS_CreateScriptContext(nsIScriptGlobalObject *aGlobal,
|
||||
nsIScriptContext **aContext);
|
||||
|
||||
|
@ -289,7 +291,11 @@ static const nsModuleComponentInfo gDOMModuleInfo[] = {
|
|||
NS_BASE_DOM_EXCEPTION_CID,
|
||||
nsnull,
|
||||
nsBaseDOMExceptionConstructor
|
||||
}
|
||||
},
|
||||
{ "JavaScript Protocol Handler",
|
||||
NS_JSPROTOCOLHANDLER_CID,
|
||||
NS_JSPROTOCOLHANDLER_CONTRACTID,
|
||||
nsJSProtocolHandler::Create },
|
||||
};
|
||||
|
||||
void PR_CALLBACK
|
||||
|
|
|
@ -27,9 +27,9 @@ VPATH = @srcdir@
|
|||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = jsurl
|
||||
LIBRARY_NAME = jsurl
|
||||
LIBRARY_NAME = jsurl_s
|
||||
EXPORT_LIBRARY = 1
|
||||
IS_COMPONENT = 1
|
||||
FORCE_STATIC_LIB = 1
|
||||
MODULE_NAME = javascript__protocol
|
||||
GRE_MODULE = 1
|
||||
|
||||
|
|
|
@ -780,16 +780,3 @@ nsJSProtocolHandler::AllowPort(PRInt32 port, const char *scheme, PRBool *_retval
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static const nsModuleComponentInfo gJSModuleInfo[] = {
|
||||
{ "JavaScript Protocol Handler",
|
||||
NS_JSPROTOCOLHANDLER_CID,
|
||||
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "javascript",
|
||||
nsJSProtocolHandler::Create }
|
||||
};
|
||||
|
||||
NS_IMPL_NSGETMODULE(javascript__protocol, gJSModuleInfo)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -50,6 +50,10 @@
|
|||
{0x8c, 0xd3, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3} \
|
||||
}
|
||||
|
||||
#define NS_JSPROTOCOLHANDLER_CONTRACTID \
|
||||
NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "javascript"
|
||||
|
||||
|
||||
class nsJSProtocolHandler : public nsIProtocolHandler
|
||||
{
|
||||
public:
|
||||
|
|
|
@ -38,6 +38,8 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsEditorService.h"
|
||||
#include "nsString.h"
|
||||
#include "plstr.h"
|
||||
|
||||
nsEditorService::nsEditorService()
|
||||
{
|
||||
|
|
|
@ -84,7 +84,6 @@
|
|||
#include "nsISupportsArray.h"
|
||||
#include "nsCOMArray.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsIFile.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIComponentManager.h"
|
||||
|
@ -805,7 +804,7 @@ FindPositiveIntegerAfterString(const char *aLeadingString, nsCString &aCStr)
|
|||
PRInt32 numFront = aCStr.Find(aLeadingString);
|
||||
if (numFront == -1)
|
||||
return -1;
|
||||
numFront += nsCRT::strlen(aLeadingString);
|
||||
numFront += strlen(aLeadingString);
|
||||
|
||||
PRInt32 numBack = aCStr.FindCharInSet(CRLF, numFront);
|
||||
if (numBack == -1)
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#include "nsICaret.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
|
@ -95,7 +96,6 @@
|
|||
#include "nsIDOMNSRange.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
|
|
@ -77,7 +77,6 @@
|
|||
#include "nsIDOMNSRange.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
|
|
@ -62,6 +62,7 @@
|
|||
#include "nsISelectionController.h"
|
||||
#include "nsGUIEvent.h"
|
||||
#include "nsIDOMEventGroup.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
#include "nsIIndependentSelection.h" //domselections answer to frameselection
|
||||
|
||||
|
@ -77,7 +78,6 @@
|
|||
#include "nsIDOMNSRange.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIComponentManager.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
|
|
@ -106,7 +106,7 @@ nsTransactionStack::Peek(nsTransactionItem **aTransaction)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
*aTransaction = (nsTransactionItem *)(mQue.End().GetCurrent());
|
||||
*aTransaction = (nsTransactionItem *)(mQue.Last());
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -35,19 +35,24 @@ ifdef NS_TRACE_MALLOC
|
|||
REQUIRES += tracemalloc
|
||||
endif
|
||||
|
||||
CPPSRCS = \
|
||||
TestGtkEmbed.cpp \
|
||||
CPPSRCS = TestGtkEmbed.cpp
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
CPPSRCS += \
|
||||
TestGtkEmbedNotebook.cpp \
|
||||
TestGtkEmbedSocket.cpp \
|
||||
TestGtkEmbedChild.cpp
|
||||
endif
|
||||
|
||||
SIMPLE_PROGRAMS = $(CPPSRCS:.cpp=)
|
||||
|
||||
# ENABLE_GNOME=1
|
||||
|
||||
ifdef ENABLE_GNOME
|
||||
ifdef ENABLE_TESTS
|
||||
CPPSRCS += TestGtkEmbedMDI.cpp
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef MOZ_ENABLE_GTK
|
||||
LIBS += \
|
||||
|
@ -85,6 +90,9 @@ ifdef NS_TRACE_MALLOC
|
|||
EXTRA_LIBS += -ltracemalloc
|
||||
endif
|
||||
|
||||
ifdef MOZ_PERF_METRICS
|
||||
EXTRA_LIBS += -lmozutil_s
|
||||
endif
|
||||
|
||||
EXTRA_LIBS += $(MOZ_JS_LIBS)
|
||||
EXTRA_LIBS += $(MOZ_COMPONENT_LIBS)
|
||||
|
|
|
@ -886,7 +886,7 @@ ShowNativePrintDialog(HWND aHWnd,
|
|||
char* dbStr = GetACPString(nsString(printerName));
|
||||
NS_ENSURE_TRUE(dbStr, NS_ERROR_FAILURE);
|
||||
|
||||
PRUint32 len = nsCRT::strlen(dbStr);
|
||||
PRUint32 len = strlen(dbStr);
|
||||
hDevNames = (HGLOBAL)::GlobalAlloc(GHND, len+sizeof(DEVNAMES)+1);
|
||||
DEVNAMES* pDevNames = (DEVNAMES*)::GlobalLock(hDevNames);
|
||||
pDevNames->wDriverOffset = sizeof(DEVNAMES);
|
||||
|
|
|
@ -23,10 +23,6 @@
|
|||
|
||||
#include "nspr.h"
|
||||
|
||||
#define NO_XPCOM_FILE_STREAMS
|
||||
#include "nsIFileStream.h" // Old XPCOM file streams
|
||||
#undef NO_XPCOM_FILE_STREAMS
|
||||
|
||||
#include "nsIFileStreams.h" // New Necko file streams
|
||||
|
||||
#ifdef XP_MAC
|
||||
|
@ -36,6 +32,7 @@
|
|||
#include "nsNetUtil.h"
|
||||
#include "nsComponentManagerUtils.h"
|
||||
#include "nsIStorageStream.h"
|
||||
#include "nsISeekableStream.h"
|
||||
#include "nsIHttpChannel.h"
|
||||
#include "nsIEncodedChannel.h"
|
||||
#include "nsIUploadChannel.h"
|
||||
|
|
|
@ -67,6 +67,9 @@ else
|
|||
endif
|
||||
|
||||
embed_copy::
|
||||
-mkdir $(DIST)/Embed/defaults/
|
||||
-mkdir $(DIST)/Embed/defaults/pref
|
||||
-cp $(srcdir)/all.js $(DIST)/Embed/defaults/pref
|
||||
$(PERL) $(topsrcdir)/xpinstall/packager/pkgcp.pl -s $(DIST)/bin -d $(DIST) --f $(srcdir)/$(BASEBROWSER) -o $(_PLATFORM) -v
|
||||
ifeq ($(OS_ARCH),WINNT)
|
||||
$(PERL) $(topsrcdir)/xpinstall/packager/pkgcp.pl -s $(DIST)/bin -d $(DIST) --f $(srcdir)/$(BASEBROWSER_SUPP) -o $(_PLATFORM) -v
|
||||
|
|
|
@ -48,8 +48,6 @@ plugins\npmozax.dll
|
|||
components\xpcom_base.xpt
|
||||
components\xpcom_components.xpt
|
||||
components\xpcom_ds.xpt
|
||||
components\xpcom_eventloop_windows.xpt
|
||||
components\xpcom_eventloop_xp.xpt
|
||||
components\xpcom_io.xpt
|
||||
components\xpcom_nativeapp.xpt
|
||||
components\xpcom_thread.xpt
|
||||
|
@ -67,7 +65,6 @@ components\gkgfxwin.dll
|
|||
components\gkwidget.dll
|
||||
components\widget.xpt
|
||||
components\gfx.xpt
|
||||
components\gkview.dll
|
||||
|
||||
; layout
|
||||
moz_art_lgpl.dll
|
||||
|
@ -107,7 +104,6 @@ components\appshell.dll
|
|||
components\appshell.xpt
|
||||
components\docshell.dll
|
||||
components\docshell_base.xpt
|
||||
components\urildr.dll
|
||||
components\uriloader.xpt
|
||||
components\chrome.dll
|
||||
components\chrome.xpt
|
||||
|
@ -130,7 +126,6 @@ components\profile.dll
|
|||
components\profile.xpt
|
||||
|
||||
; session history
|
||||
components\shistory.dll
|
||||
components\shistory.xpt
|
||||
|
||||
; optional typeaheadfind
|
||||
|
@ -166,7 +161,6 @@ components\dom_xbl.xpt
|
|||
components\dom_xul.xpt
|
||||
|
||||
; "javascript:" URLs
|
||||
components\jsurl.dll
|
||||
components\jsurl.xpt
|
||||
|
||||
; editor
|
||||
|
|
|
@ -104,7 +104,6 @@ Essential Files:gfx.shlb
|
|||
Components:gfxComponent.shlb
|
||||
|
||||
; javascript
|
||||
Components:JSUrl.shlb
|
||||
Components:jsurl.xpt
|
||||
|
||||
; layout
|
||||
|
@ -112,7 +111,6 @@ res:dtd:xhtml11.dtd
|
|||
Components:layout.shlb
|
||||
Components:htmlparser.shlb
|
||||
Components:htmlparser.xpt
|
||||
Components:view.shlb
|
||||
Components:content.xpt
|
||||
Components:layout.xpt
|
||||
|
||||
|
@ -146,6 +144,8 @@ Components:oji.xpt
|
|||
; profile
|
||||
Components:profile.shlb
|
||||
Components:profileservices.xpt
|
||||
Components:mozreg.shlb
|
||||
Components:mozreg.xpt
|
||||
|
||||
; wallet
|
||||
; Optional - only if you need password persistence
|
||||
|
@ -185,7 +185,6 @@ Components:RDFLibrary.shlb
|
|||
Components:rdf.xpt
|
||||
|
||||
; session history
|
||||
Components:shistory.shlb
|
||||
Components:shistory.xpt
|
||||
|
||||
; optional typeaheadfind
|
||||
|
@ -222,7 +221,6 @@ defaults:Profile:mimeTypes.rdf
|
|||
defaults:Profile:US:mimeTypes.rdf
|
||||
|
||||
; uriloader
|
||||
Components:uriLoader.shlb
|
||||
Components:uriLoader.xpt
|
||||
|
||||
; widget
|
||||
|
|
|
@ -1,289 +0,0 @@
|
|||
; Base Embedding Package File for MacOS CFM (built with CodeWarrior)
|
||||
;
|
||||
;
|
||||
;
|
||||
|
||||
[Embed]
|
||||
|
||||
|
||||
|
||||
;
|
||||
; NSPR:
|
||||
;
|
||||
Essential Files:NSPR20Debug.shlb
|
||||
Essential Files:NSRuntimeDebug.shlb
|
||||
Essential Files:NSStdLibDebug.shlb
|
||||
|
||||
;
|
||||
; Javascript:
|
||||
;
|
||||
Essential Files:JavaScriptDebug.shlb
|
||||
Essential Files:LiveConnectDebug.shlb
|
||||
Components:JSLoaderDebug.shlb
|
||||
|
||||
;
|
||||
; DOM:
|
||||
;
|
||||
Components:domDebug.shlb
|
||||
|
||||
;
|
||||
; XPCOM:
|
||||
;
|
||||
Essential Files:xpcomDebug.shlb
|
||||
Essential Files:libregDebug.shlb
|
||||
|
||||
;
|
||||
; Imaging:
|
||||
;
|
||||
Essential Files:zlibDebug.shlb
|
||||
|
||||
;
|
||||
; Components: (need to trim fat)
|
||||
;
|
||||
|
||||
; accessibility (out of process API support)
|
||||
; see http:::www.mozilla.org:projects:ui:accessibility:vendors-win.html
|
||||
; Components:accessibilityDebug.dll
|
||||
; Components:accessibility.xpt
|
||||
|
||||
; appshell
|
||||
Components:AppShellDebug.shlb
|
||||
Components:appshell.xpt
|
||||
|
||||
; caps
|
||||
Components:CapsDebug.shlb
|
||||
Components:caps.xpt
|
||||
|
||||
; chrome
|
||||
Components:ChomeRegistryDebug.shlb
|
||||
Components:chrome.xpt
|
||||
|
||||
; cookies
|
||||
Components:CookieDebug.shlb
|
||||
Components:cookie.xpt
|
||||
|
||||
; docshell
|
||||
Components:docshellDebug.shlb
|
||||
Components:docshell.xpt
|
||||
|
||||
; dom
|
||||
Components:domDebug.shlb
|
||||
Components:dom.xpt
|
||||
Components:dom_base.xpt
|
||||
Components:dom_core.xpt
|
||||
Components:dom_css.xpt
|
||||
Components:dom_events.xpt
|
||||
Components:dom_html.xpt
|
||||
Components:dom_range.xpt
|
||||
Components:dom_stylesheets.xpt
|
||||
Components:dom_traversal.xpt
|
||||
Components:dom_views.xpt
|
||||
Components:dom_xbl.xpt
|
||||
Components:dom_xul.xpt
|
||||
|
||||
; editor
|
||||
Components:ComposerDebug.shlb
|
||||
; Components:EditorCoreDebug.shlb ; why not?
|
||||
Components:editor.xpt
|
||||
Components:htmleditorDebug.shlb
|
||||
|
||||
; embedding
|
||||
Components:webBrowserDebug.shlb
|
||||
Components:embeddingbrowser.xpt
|
||||
Components:EmbedComponentsDebug.shlb
|
||||
Components:EmbedComponents.xpt
|
||||
Components:EmbedBase.xpt
|
||||
Components:webshell.xpt
|
||||
|
||||
; find functionality
|
||||
; Optional - only if your code uses nsIWebBrowserFind
|
||||
Components:txtsvc.xpt
|
||||
|
||||
; gfx
|
||||
Essential Files:gfxDebug.shlb
|
||||
Components:gfxComponentDebug.shlb
|
||||
|
||||
; javascript
|
||||
Components:JSUrlDebug.shlb
|
||||
Components:jsurl.xpt
|
||||
|
||||
; layout
|
||||
res:dtd:xhtml11.dtd
|
||||
Components:layoutDebug.shlb
|
||||
Components:htmlparserDebug.shlb
|
||||
Components:htmlparser.xpt
|
||||
Components:viewDebug.shlb
|
||||
Components:content.xpt
|
||||
Components:layout.xpt
|
||||
|
||||
; netwerk
|
||||
|
||||
Components:NeckoDebug.shlb
|
||||
Components:necko.xpt
|
||||
Components:Necko2Debug.shlb
|
||||
Components:cache.xpt
|
||||
|
||||
; imagelib
|
||||
Components:libimg2Debug.shlb
|
||||
Components:libimg2.xpt
|
||||
Components:mngdecoderDebug.shlb
|
||||
|
||||
; jar
|
||||
Components:libjarDebug.shlb
|
||||
Components:libjar.xpt
|
||||
|
||||
; prefs
|
||||
Components:libprefDebug.shlb
|
||||
Components:libpref.xpt
|
||||
|
||||
; plugins
|
||||
; Optional - only if you need plugin support
|
||||
Components:pluginDebug.shlb
|
||||
Components:pluginClassicDebug.shlb
|
||||
Components:plugin.xpt
|
||||
Components:ojiDebug.shlb
|
||||
Components:oji.xpt
|
||||
|
||||
; profile
|
||||
Components:profileDebug.shlb
|
||||
Components:profileservices.xpt
|
||||
|
||||
; wallet
|
||||
; Optional - only if you need password persistence
|
||||
Components:WalletDebug.shlb
|
||||
Components:wallet.xpt
|
||||
|
||||
; psm2
|
||||
; Optional - only if you need PSM2 support
|
||||
Components:pipbootDebug.shlb
|
||||
Components:pipboot.xpt
|
||||
Components:PIPNSSDebug.shlb
|
||||
Components:pipnss.xpt
|
||||
defaults:pref:security-prefs.js
|
||||
Essential Files:NSS3Debug.shlb
|
||||
Essential Files:SMIME3Debug.shlb
|
||||
Essential Files:Softoken3Debug.shlb
|
||||
Essential Files:SSL3Debug.shlb
|
||||
Essential Files:NSSckbiDebug.shlb
|
||||
|
||||
; appcomps
|
||||
; Optional - only if you want global history (requires mork) or
|
||||
; directory viewer (off by default for ftp view)
|
||||
Components:appcompsDebug.shlb
|
||||
Components:mozcomps.xpt
|
||||
Components:morkDebug.shlb
|
||||
|
||||
; download progress
|
||||
; Optional - you can implement your own download progress dialog
|
||||
; then this is no longer required
|
||||
Components:nsProgressDialog.js
|
||||
Components:nsHelperAppDlg.js
|
||||
Components:nsDownloadProgressListener.js
|
||||
Components:downloadmanager.xpt
|
||||
|
||||
; rdf
|
||||
Components:RDFLibraryDebug.shlb
|
||||
Components:rdf.xpt
|
||||
|
||||
; session history
|
||||
Components:shistoryDebug.shlb
|
||||
Components:shistory.xpt
|
||||
|
||||
; optional typeaheadfind
|
||||
; (docs at http://www.mozilla.org/projects/ui/accessibility/typeaheadfind.html)
|
||||
;Components:typeaheadfind.shlb
|
||||
;Components:typeaheadfind.xpt
|
||||
|
||||
; required i18n libraries
|
||||
|
||||
Components:i18nDebug.shlb
|
||||
Components:unicharutil.xpt
|
||||
Components:uconvDebug.shlb
|
||||
Components:uconv.xpt
|
||||
Components:nslocale.xpt
|
||||
Components:chardet.xpt
|
||||
Components:UniversalchardetDebug.shlb
|
||||
|
||||
|
||||
res:language.properties
|
||||
res:langGroups.properties
|
||||
res:charsetData.properties
|
||||
res:charsetalias.properties
|
||||
res:maccharset.properties
|
||||
|
||||
; required i18n libs
|
||||
Components:nsIStringBundle.xpt
|
||||
|
||||
; required prefs files
|
||||
defaults:pref:all.js
|
||||
defaults:pref:macprefs.js
|
||||
|
||||
; required if using nsHelperAppDlg.js component
|
||||
defaults:Profile:mimeTypes.rdf
|
||||
defaults:Profile:US:mimeTypes.rdf
|
||||
|
||||
; uriloader
|
||||
Components:uriLoaderDebug.shlb
|
||||
Components:uriLoader.xpt
|
||||
|
||||
; widget
|
||||
Essential Files:WidgetSupportDebug.shlb
|
||||
Components:widgetDebug.shlb
|
||||
Components:widget.xpt
|
||||
|
||||
; xmlextras, optional for XMLHttpRequest support
|
||||
Components:xmlextrasDebug.shlb
|
||||
Components:xmlextras.xpt
|
||||
|
||||
; xpconnect
|
||||
Components:XPConnectDebug.shlb
|
||||
Components:xpconnect.xpt
|
||||
|
||||
; xpcom
|
||||
Components:xpcom.xpt
|
||||
|
||||
;
|
||||
; The build scripts move embed.jar manually because of how and where
|
||||
; it is generated.
|
||||
;
|
||||
; Chrome:embed.jar
|
||||
|
||||
|
||||
;
|
||||
; res:
|
||||
;
|
||||
res:html.css
|
||||
res:quirk.css
|
||||
res:viewsource.css
|
||||
res:ua.css
|
||||
res:forms.css
|
||||
res:arrow.gif
|
||||
res:loading-image.gif
|
||||
res:broken-image.gif
|
||||
res:builtin:htmlBindings.xml
|
||||
res:builtin:platformHTMLBindings.xml
|
||||
res:entityTables:html40Special.properties
|
||||
res:entityTables:htmlEntityVersion.properties
|
||||
res:entityTables:html40Latin1.properties
|
||||
res:entityTables:html40Symbols.properties
|
||||
res:entityTables:transliterate.properties
|
||||
res:fonts:fontEncoding.properties
|
||||
|
||||
|
||||
;
|
||||
; Optional for MathML
|
||||
;
|
||||
;res:mathml.css
|
||||
;res:dtd:mathml.dtd
|
||||
;res:entityTables:mathml20.properties
|
||||
;res:fonts:mathfont.properties
|
||||
;res:fonts:mathfontCMEX10.properties
|
||||
;res:fonts:mathfontCMSY10.properties
|
||||
;res:fonts:mathfontMath1.properties
|
||||
;res:fonts:mathfontMath2.properties
|
||||
;res:fonts:mathfontMath4.properties
|
||||
;res:fonts:mathfontMTExtra.properties
|
||||
;res:fonts:mathfontPUA.properties
|
||||
;res:fonts:mathfontSymbol.properties
|
||||
;Components:ucvmathDebug.shlb
|
||||
|
|
@ -99,15 +99,12 @@ components/libjar50.dylib
|
|||
components/jar.xpt
|
||||
|
||||
; javascript
|
||||
components/libjsurl.dylib
|
||||
components/jsurl.xpt
|
||||
|
||||
; layout
|
||||
res/dtd/xhtml11.dtd
|
||||
components/libgklayout.dylib
|
||||
components/libhtmlpars.dylib
|
||||
components/libgkview.dylib
|
||||
components/layout_base.xpt
|
||||
components/layout_xul.xpt
|
||||
components/content_base.xpt
|
||||
|
||||
|
@ -138,6 +135,8 @@ components/libpref.dylib
|
|||
; profile
|
||||
components/libprofile.dylib
|
||||
components/profile.xpt
|
||||
components/mozreg.dylib
|
||||
components/mozreg.xpt
|
||||
|
||||
; wallet
|
||||
; Optional - only if you need password persistence
|
||||
|
@ -171,7 +170,6 @@ components/librdf.dylib
|
|||
components/rdf.xpt
|
||||
|
||||
; session history
|
||||
components/libshistory.dylib
|
||||
components/shistory.xpt
|
||||
|
||||
; optional typeaheadfind
|
||||
|
@ -199,7 +197,6 @@ defaults/pref/all.js
|
|||
defaults/pref/macprefs.js
|
||||
|
||||
; uriloader
|
||||
components/liburiloader.dylib
|
||||
components/uriloader.xpt
|
||||
|
||||
; widget
|
||||
|
|
|
@ -52,6 +52,7 @@ components/libgfxps.so
|
|||
components/libgfxxprint.so
|
||||
components/gfx.xpt
|
||||
components/libwidget_gtk.so
|
||||
components/libwidget_gtk2.so
|
||||
components/widget.xpt
|
||||
|
||||
; layout
|
||||
|
@ -59,7 +60,6 @@ libmoz_art_lgpl.so
|
|||
res/dtd/xhtml11.dtd
|
||||
components/libgklayout.so
|
||||
components/libhtmlpars.so
|
||||
components/libgkview.so
|
||||
components/layout_base.xpt
|
||||
components/layout_xul.xpt
|
||||
components/content_base.xpt
|
||||
|
@ -91,7 +91,6 @@ components/libcookie.so
|
|||
; appshell, docshell, uriloader, chrome, components
|
||||
components/libdocshell.so
|
||||
components/docshell.xpt
|
||||
components/liburiloader.so
|
||||
components/uriloader.xpt
|
||||
components/libchrome.so
|
||||
components/chrome.xpt
|
||||
|
@ -113,7 +112,6 @@ components/libprofile.so
|
|||
components/profile.xpt
|
||||
|
||||
; session history
|
||||
components/libshistory.so
|
||||
components/shistory.xpt
|
||||
|
||||
; optional typeaheadfind
|
||||
|
@ -152,7 +150,6 @@ components/dom_xbl.xpt
|
|||
components/dom_xul.xpt
|
||||
|
||||
; "javascript:" URLs
|
||||
components/libjsurl.so
|
||||
components/jsurl.xpt
|
||||
|
||||
; editor
|
||||
|
@ -224,7 +221,7 @@ res/unixcharset.properties
|
|||
; res/strres.properties
|
||||
|
||||
; required prefs files
|
||||
defaults/pref/all.js
|
||||
;defaults/pref/all.js
|
||||
defaults/pref/unix.js
|
||||
|
||||
|
||||
|
|
|
@ -48,8 +48,6 @@ xpcom.dll
|
|||
components\xpcom_base.xpt
|
||||
components\xpcom_components.xpt
|
||||
components\xpcom_ds.xpt
|
||||
components\xpcom_eventloop_windows.xpt
|
||||
components\xpcom_eventloop_xp.xpt
|
||||
components\xpcom_io.xpt
|
||||
components\xpcom_nativeapp.xpt
|
||||
components\xpcom_thread.xpt
|
||||
|
@ -69,7 +67,6 @@ components\gkgfxwin.dll
|
|||
components\gkwidget.dll
|
||||
components\widget.xpt
|
||||
components\gfx.xpt
|
||||
components\gkview.dll
|
||||
|
||||
; layout
|
||||
moz_art_lgpl.dll
|
||||
|
@ -107,7 +104,6 @@ components\appshell.dll
|
|||
components\appshell.xpt
|
||||
components\docshell.dll
|
||||
components\docshell_base.xpt
|
||||
components\urildr.dll
|
||||
components\uriloader.xpt
|
||||
components\chrome.dll
|
||||
components\chrome.xpt
|
||||
|
@ -129,7 +125,6 @@ components\profile.dll
|
|||
components\profile.xpt
|
||||
|
||||
; session history
|
||||
components\shistory.dll
|
||||
components\shistory.xpt
|
||||
|
||||
; optional typeaheadfind
|
||||
|
@ -165,7 +160,6 @@ components\dom_xbl.xpt
|
|||
components\dom_xul.xpt
|
||||
|
||||
; "javascript:" URLs
|
||||
components\jsurl.dll
|
||||
components\jsurl.xpt
|
||||
|
||||
; editor
|
||||
|
|
|
@ -41,6 +41,7 @@ RESFILE = testembed.res
|
|||
MODULE = testEmbed
|
||||
|
||||
REQUIRES = \
|
||||
xpcom_obsolete \
|
||||
xpcom \
|
||||
string \
|
||||
necko \
|
||||
|
|
|
@ -39,6 +39,7 @@ RESFILE = MfcEmbed.res
|
|||
|
||||
MODULE = mfcEmbed
|
||||
REQUIRES = \
|
||||
xpcom_obsolete \
|
||||
xpcom \
|
||||
string \
|
||||
necko \
|
||||
|
|
|
@ -38,7 +38,8 @@ LIBRARY_NAME = accessproxy
|
|||
ifneq ($(OS_ARCH),WINNT)
|
||||
SHORT_LIBNAME = accproxy
|
||||
endif
|
||||
REQUIRES = xpcom \
|
||||
REQUIRES = xpcom_obsolete \
|
||||
xpcom \
|
||||
string \
|
||||
docshell \
|
||||
dom \
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "nsCookies.h"
|
||||
#include "nsPermissions.h"
|
||||
#include "nsUtils.h"
|
||||
#include "nsIFileSpec.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "prprf.h"
|
||||
#include "prmem.h"
|
||||
|
@ -56,6 +55,9 @@
|
|||
#include "nsComObsolete.h"
|
||||
#include <time.h>
|
||||
|
||||
#include "nsCRT.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
||||
// we want to explore making the document own the load group
|
||||
// so we can associate the document URI with the load group.
|
||||
// until this point, we have an evil hack:
|
||||
|
@ -104,7 +106,7 @@ PRLogModuleInfo* gCookieLog = nsnull;
|
|||
#define MAX_EXPIRE 0
|
||||
#endif
|
||||
|
||||
static const char *kCookiesFileName = "cookies.txt";
|
||||
static const char kCookiesFileName[] = "cookies.txt";
|
||||
|
||||
MODULE_PRIVATE nsresult
|
||||
cookie_ParseDate(const nsAFlatCString &date_string, time_t & date);
|
||||
|
@ -290,7 +292,7 @@ COOKIE_DeletePersistentUserData(void)
|
|||
nsCOMPtr<nsIFile> cookiesFile;
|
||||
res = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(cookiesFile));
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
res = cookiesFile->AppendNative(nsDependentCString(kCookiesFileName));
|
||||
res = cookiesFile->AppendNative(NS_LITERAL_CSTRING(kCookiesFileName));
|
||||
if (NS_SUCCEEDED(res))
|
||||
(void) cookiesFile->Remove(PR_FALSE);
|
||||
}
|
||||
|
@ -1707,30 +1709,31 @@ COOKIE_Write() {
|
|||
cookie_CookieStruct * cookie_s;
|
||||
time_t cur_date = get_current_time();
|
||||
char date_string[36];
|
||||
nsFileSpec dirSpec;
|
||||
|
||||
nsCOMPtr<nsIFile> dirSpec;
|
||||
|
||||
nsresult rv;
|
||||
rv = CKutil_ProfileDirectory(dirSpec);
|
||||
rv = CKutil_ProfileDirectory(getter_AddRefs(dirSpec));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
dirSpec += kCookiesFileName;
|
||||
PRBool ignored;
|
||||
dirSpec.ResolveSymlink(ignored);
|
||||
nsOutputFileStream strm(dirSpec);
|
||||
if (!strm.is_open()) {
|
||||
/* file doesn't exist -- that's not an error */
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
dirSpec->AppendNative(NS_LITERAL_CSTRING(kCookiesFileName));
|
||||
|
||||
nsCOMPtr<nsIOutputStream> strm;
|
||||
NS_NewLocalFileOutputStream(getter_AddRefs(strm),
|
||||
dirSpec);
|
||||
|
||||
#define COOKIEFILE_LINE1 "# HTTP Cookie File\n"
|
||||
#define COOKIEFILE_LINE2 "# http://www.netscape.com/newsref/std/cookie_spec.html\n"
|
||||
#define COOKIEFILE_LINE3 "# This is a generated file! Do not edit.\n"
|
||||
#define COOKIEFILE_LINE4 "# To delete cookies, use the Cookie Manager.\n\n"
|
||||
|
||||
strm.write(COOKIEFILE_LINE1, PL_strlen(COOKIEFILE_LINE1));
|
||||
strm.write(COOKIEFILE_LINE2, PL_strlen(COOKIEFILE_LINE2));
|
||||
strm.write(COOKIEFILE_LINE3, PL_strlen(COOKIEFILE_LINE3));
|
||||
strm.write(COOKIEFILE_LINE4, PL_strlen(COOKIEFILE_LINE4));
|
||||
PRUint32 ignore;
|
||||
strm->Write(COOKIEFILE_LINE1, sizeof(COOKIEFILE_LINE1)-1, &ignore);
|
||||
strm->Write(COOKIEFILE_LINE2, sizeof(COOKIEFILE_LINE2)-1, &ignore);
|
||||
strm->Write(COOKIEFILE_LINE3, sizeof(COOKIEFILE_LINE3)-1, &ignore);
|
||||
strm->Write(COOKIEFILE_LINE4, sizeof(COOKIEFILE_LINE4)-1, &ignore);
|
||||
|
||||
/* format shall be:
|
||||
*
|
||||
|
@ -1750,36 +1753,33 @@ COOKIE_Write() {
|
|||
continue;
|
||||
}
|
||||
|
||||
strm.write(cookie_s->host.get(), cookie_s->host.Length());
|
||||
strm->Write(cookie_s->host.get(), cookie_s->host.Length(), &ignore);
|
||||
|
||||
if (cookie_s->isDomain) {
|
||||
strm.write("\tTRUE\t", 6);
|
||||
strm->Write("\tTRUE\t", 6, &ignore);
|
||||
} else {
|
||||
strm.write("\tFALSE\t", 7);
|
||||
strm->Write("\tFALSE\t", 7, &ignore);
|
||||
}
|
||||
|
||||
strm.write(cookie_s->path.get(), cookie_s->path.Length());
|
||||
strm->Write(cookie_s->path.get(), cookie_s->path.Length(), &ignore);
|
||||
|
||||
if (cookie_s->isSecure) {
|
||||
strm.write("\tTRUE\t", 6);
|
||||
strm->Write("\tTRUE\t", 6, &ignore);
|
||||
} else {
|
||||
strm.write("\tFALSE\t", 7);
|
||||
strm->Write("\tFALSE\t", 7, &ignore);
|
||||
}
|
||||
|
||||
PR_snprintf(date_string, sizeof(date_string), "%lu", NS_STATIC_CAST(unsigned long, cookie_s->expires));
|
||||
|
||||
strm.write(date_string, strlen(date_string));
|
||||
strm.write("\t", 1);
|
||||
strm.write(cookie_s->name.get(), cookie_s->name.Length());
|
||||
strm.write("\t", 1);
|
||||
strm.write(cookie_s->cookie.get(), cookie_s->cookie.Length());
|
||||
strm.write("\n", 1);
|
||||
strm->Write(date_string, strlen(date_string), &ignore);
|
||||
strm->Write("\t", 1, &ignore);
|
||||
strm->Write(cookie_s->name.get(), cookie_s->name.Length(), &ignore);
|
||||
strm->Write("\t", 1, &ignore);
|
||||
strm->Write(cookie_s->cookie.get(), cookie_s->cookie.Length(), &ignore);
|
||||
strm->Write("\n", 1, &ignore);
|
||||
}
|
||||
|
||||
cookie_changed = PR_FALSE;
|
||||
strm.flush();
|
||||
strm.close();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -1802,13 +1802,21 @@ COOKIE_Read() {
|
|||
cookie_CookieStruct *new_cookie, *tmp_cookie_ptr;
|
||||
nsCAutoString buffer;
|
||||
PRBool added_to_list;
|
||||
nsFileSpec dirSpec;
|
||||
nsresult rv = CKutil_ProfileDirectory(dirSpec);
|
||||
|
||||
nsCOMPtr<nsIFile> dirSpec;
|
||||
nsresult rv = CKutil_ProfileDirectory(getter_AddRefs(dirSpec));
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
nsInputFileStream strm(dirSpec + kCookiesFileName);
|
||||
if (!strm.is_open()) {
|
||||
|
||||
dirSpec->AppendNative(NS_LITERAL_CSTRING(kCookiesFileName));
|
||||
|
||||
nsCOMPtr<nsIInputStream> strm;
|
||||
NS_NewLocalFileInputStream(getter_AddRefs(strm),
|
||||
dirSpec);
|
||||
|
||||
PRBool exists = PR_FALSE;;
|
||||
if (NS_FAILED(dirSpec->Exists(&exists)) || !exists) {
|
||||
/* file doesn't exist -- that's not an error */
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -1858,7 +1866,6 @@ COOKIE_Read() {
|
|||
/* create a new cookie_struct and fill it in */
|
||||
new_cookie = new cookie_CookieStruct;
|
||||
if (!new_cookie) {
|
||||
strm.close();
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
new_cookie->name = name;
|
||||
|
@ -1899,8 +1906,7 @@ COOKIE_Read() {
|
|||
if (!cookie_list) {
|
||||
cookie_list = new nsVoidArray();
|
||||
if (!cookie_list) {
|
||||
delete new_cookie;
|
||||
strm.close();
|
||||
deleteCookie((void*)new_cookie, nsnull);
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
}
|
||||
|
@ -1923,7 +1929,6 @@ COOKIE_Read() {
|
|||
}
|
||||
}
|
||||
|
||||
strm.close();
|
||||
cookie_changed = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -1,817 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* 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.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Pierre Phaneuf <pp@ludusdesign.com>
|
||||
* Henrik Gemal <mozilla@gemal.dk>
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#define alphabetize 1
|
||||
|
||||
#include "nsPermissions.h"
|
||||
#include "nsUtils.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsIFileSpec.h"
|
||||
#include "nsIPrompt.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "prmem.h"
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsNetCID.h"
|
||||
#include "nsTextFormatter.h"
|
||||
#include "nsIObserverService.h"
|
||||
#include "nsComObsolete.h"
|
||||
#include "nsIWindowWatcher.h"
|
||||
|
||||
#include "nsICookieAcceptDialog.h"
|
||||
#include "nsCookiePromptService.h"
|
||||
|
||||
static const char *kCookiesPermFileName = "cookperm.txt";
|
||||
|
||||
typedef struct _permission_HostStruct {
|
||||
char * host;
|
||||
nsVoidArray * permissionList;
|
||||
} permission_HostStruct;
|
||||
|
||||
typedef struct _permission_TypeStruct {
|
||||
PRInt32 type;
|
||||
PRBool permission;
|
||||
} permission_TypeStruct;
|
||||
|
||||
PRIVATE PRBool permission_changed = PR_FALSE;
|
||||
|
||||
PRIVATE PRBool cookie_rememberChecked;
|
||||
PRIVATE PRBool image_rememberChecked;
|
||||
PRIVATE PRBool window_rememberChecked;
|
||||
|
||||
PRIVATE nsVoidArray * permission_list=0;
|
||||
|
||||
PRBool
|
||||
permission_CheckConfirmYN(nsIPrompt *aPrompter,
|
||||
nsICookie *aCookie,
|
||||
const char *aHostname,
|
||||
int aCookiesFromHost,
|
||||
PRBool aChangingCookie,
|
||||
PRBool* aCheckValue) {
|
||||
|
||||
nsresult rv;
|
||||
PRBool acceptThis = PR_TRUE;
|
||||
|
||||
if (aCookie) {
|
||||
nsCOMPtr<nsICookiePromptService> cookiePromptService = do_GetService(NS_COOKIEPROMPTSERVICE_CONTRACTID,&rv);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
rv = cookiePromptService->
|
||||
CookieDialog(nsnull, aCookie, nsDependentCString(aHostname),
|
||||
aCookiesFromHost, aChangingCookie, aCheckValue,
|
||||
&acceptThis);
|
||||
if (NS_FAILED(rv)) {
|
||||
*aCheckValue = PR_FALSE;
|
||||
}
|
||||
}
|
||||
else {
|
||||
nsCOMPtr<nsIPrompt> dialog;
|
||||
PRInt32 buttonPressed = 1; /* In case the user closed the dialog using a window manager feature */
|
||||
|
||||
if (aPrompter)
|
||||
dialog = aPrompter;
|
||||
else {
|
||||
nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1"));
|
||||
if (wwatch)
|
||||
wwatch->GetNewPrompter(0, getter_AddRefs(dialog));
|
||||
}
|
||||
if (!dialog) {
|
||||
*aCheckValue = PR_FALSE;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRUnichar * confirm_string = CKutil_Localize(NS_LITERAL_STRING("Confirm").get());
|
||||
PRUnichar * message_fmt = CKutil_Localize(NS_LITERAL_STRING("PermissionToAcceptImage").get());
|
||||
PRUnichar * message = nsTextFormatter::smprintf(message_fmt,
|
||||
aHostname ? aHostname : "", aCookiesFromHost);
|
||||
PRUnichar * remember_string = CKutil_Localize(NS_LITERAL_STRING("RememberThisDecision").get());
|
||||
|
||||
rv = dialog->ConfirmEx(confirm_string, message,
|
||||
(nsIPrompt::BUTTON_TITLE_YES * nsIPrompt::BUTTON_POS_0) +
|
||||
(nsIPrompt::BUTTON_TITLE_NO * nsIPrompt::BUTTON_POS_1),
|
||||
nsnull, nsnull, nsnull, remember_string, aCheckValue, &buttonPressed);
|
||||
|
||||
nsTextFormatter::smprintf_free(message);
|
||||
nsMemory::Free(confirm_string);
|
||||
nsMemory::Free(remember_string);
|
||||
nsMemory::Free(message_fmt);
|
||||
|
||||
if (NS_FAILED(rv)) {
|
||||
*aCheckValue = PR_FALSE;
|
||||
}
|
||||
|
||||
acceptThis = (buttonPressed == 1);
|
||||
}
|
||||
|
||||
return acceptThis;
|
||||
}
|
||||
|
||||
/*
|
||||
* search if permission already exists
|
||||
*/
|
||||
nsresult
|
||||
permission_CheckFromList(const char * hostname, PRBool &permission, PRInt32 type) {
|
||||
permission_HostStruct * hostStruct;
|
||||
permission_TypeStruct * typeStruct;
|
||||
|
||||
/* ignore leading period in host name */
|
||||
while (hostname && (*hostname == '.')) {
|
||||
hostname++;
|
||||
}
|
||||
|
||||
/* return if permission_list does not exist */
|
||||
if (permission_list == nsnull) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* find host name within list */
|
||||
PRInt32 hostCount = permission_list->Count();
|
||||
for (PRInt32 i = 0; i < hostCount; ++i) {
|
||||
hostStruct = NS_STATIC_CAST(permission_HostStruct*, permission_list->ElementAt(i));
|
||||
if (hostStruct) {
|
||||
if(hostname && hostStruct->host && !PL_strcasecmp(hostname, hostStruct->host)) {
|
||||
|
||||
/* search for type in the permission list for this host */
|
||||
PRInt32 typeCount = hostStruct->permissionList->Count();
|
||||
for (PRInt32 typeIndex=0; typeIndex<typeCount; typeIndex++) {
|
||||
typeStruct = NS_STATIC_CAST
|
||||
(permission_TypeStruct*, hostStruct->permissionList->ElementAt(typeIndex));
|
||||
if (typeStruct->type == type) {
|
||||
|
||||
/* type found. Obtain the corresponding permission */
|
||||
permission = typeStruct->permission;
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
/* type not found, return failure */
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* not found, return failure */
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
permission_GetRememberChecked(PRInt32 type) {
|
||||
if (type == COOKIEPERMISSION)
|
||||
return cookie_rememberChecked;
|
||||
if (type == IMAGEPERMISSION)
|
||||
return image_rememberChecked;
|
||||
if (type == WINDOWPERMISSION)
|
||||
return window_rememberChecked;
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
permission_SetRememberChecked(PRInt32 type, PRBool value) {
|
||||
if (type == COOKIEPERMISSION) {
|
||||
cookie_rememberChecked = value;
|
||||
} else if (type == IMAGEPERMISSION) {
|
||||
image_rememberChecked = value;
|
||||
} else if (type == WINDOWPERMISSION) {
|
||||
window_rememberChecked = value;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC PRBool
|
||||
Permission_Check(
|
||||
nsIPrompt *aPrompter,
|
||||
const char *aHostname,
|
||||
PRInt32 aType,
|
||||
PRBool aWarningPref,
|
||||
nsICookie *aCookie,
|
||||
int aCookiesFromHost,
|
||||
PRBool aChangingCookie)
|
||||
{
|
||||
PRBool permission;
|
||||
|
||||
/* try to make decision based on saved permissions */
|
||||
if (NS_SUCCEEDED(permission_CheckFromList(aHostname, permission, aType))) {
|
||||
return permission;
|
||||
}
|
||||
|
||||
/* see if we need to prompt */
|
||||
if(!aWarningPref) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
/* we need to prompt */
|
||||
PRBool rememberChecked = permission_GetRememberChecked(aType);
|
||||
permission = permission_CheckConfirmYN(aPrompter, aCookie, aHostname, aCookiesFromHost, aChangingCookie, &rememberChecked);
|
||||
|
||||
/* see if we need to remember this decision */
|
||||
if (rememberChecked) {
|
||||
/* ignore leading periods in host name */
|
||||
const char * hostnameAfterDot = aHostname;
|
||||
while (hostnameAfterDot && (*hostnameAfterDot == '.')) {
|
||||
hostnameAfterDot++;
|
||||
}
|
||||
Permission_AddHost(nsDependentCString(hostnameAfterDot), permission, aType, PR_TRUE);
|
||||
}
|
||||
if (rememberChecked != permission_GetRememberChecked(aType)) {
|
||||
permission_SetRememberChecked(aType, rememberChecked);
|
||||
permission_changed = PR_TRUE;
|
||||
Permission_Save(PR_TRUE);
|
||||
}
|
||||
return permission;
|
||||
}
|
||||
|
||||
PUBLIC nsresult
|
||||
Permission_AddHost(const nsAFlatCString & host, PRBool permission, PRInt32 type, PRBool save) {
|
||||
/* create permission list if it does not yet exist */
|
||||
if(!permission_list) {
|
||||
permission_list = new nsVoidArray();
|
||||
if(!permission_list)
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
|
||||
/* find existing entry for host */
|
||||
permission_HostStruct * hostStruct = nsnull; // initialized only to avoid warning message
|
||||
PRBool HostFound = PR_FALSE;
|
||||
PRInt32 hostCount = permission_list->Count();
|
||||
PRInt32 i;
|
||||
for (i = 0; i < hostCount; ++i) {
|
||||
hostStruct = NS_STATIC_CAST(permission_HostStruct*, permission_list->ElementAt(i));
|
||||
if (hostStruct) {
|
||||
if (PL_strcasecmp(host.get(),hostStruct->host)==0) {
|
||||
|
||||
/* host found in list */
|
||||
HostFound = PR_TRUE;
|
||||
break;
|
||||
#ifdef alphabetize
|
||||
} else if (PL_strcasecmp(host.get(), hostStruct->host) < 0) {
|
||||
|
||||
/* need to insert new entry here */
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!HostFound) {
|
||||
|
||||
/* create a host structure for the host */
|
||||
hostStruct = PR_NEW(permission_HostStruct);
|
||||
if (!hostStruct)
|
||||
return NS_ERROR_FAILURE;
|
||||
hostStruct->host = ToNewCString(host);
|
||||
hostStruct->permissionList = new nsVoidArray();
|
||||
if(!hostStruct->permissionList) {
|
||||
PR_Free(hostStruct);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
/* insert host structure into the list */
|
||||
if (i == permission_list->Count()) {
|
||||
permission_list->AppendElement(hostStruct);
|
||||
} else {
|
||||
permission_list->InsertElementAt(hostStruct, i);
|
||||
}
|
||||
}
|
||||
|
||||
/* see if host already has an entry for this type */
|
||||
permission_TypeStruct * typeStruct;
|
||||
PRBool typeFound = PR_FALSE;
|
||||
PRInt32 typeCount = hostStruct->permissionList->Count();
|
||||
for (PRInt32 typeIndex=0; typeIndex<typeCount; typeIndex++) {
|
||||
typeStruct = NS_STATIC_CAST
|
||||
(permission_TypeStruct*, hostStruct->permissionList->ElementAt(typeIndex));
|
||||
if (typeStruct->type == type) {
|
||||
/* type found. Modify the corresponding permission */
|
||||
typeStruct->permission = permission;
|
||||
typeFound = PR_TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* create a type structure and attach it to the host structure */
|
||||
if (!typeFound) {
|
||||
typeStruct = PR_NEW(permission_TypeStruct);
|
||||
typeStruct->type = type;
|
||||
typeStruct->permission = permission;
|
||||
hostStruct->permissionList->AppendElement(typeStruct);
|
||||
}
|
||||
|
||||
/* write the changes out to a file */
|
||||
if (save) {
|
||||
permission_changed = PR_TRUE;
|
||||
Permission_Save(PR_TRUE);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRIVATE void
|
||||
permission_Unblock(const char * host, PRInt32 type) {
|
||||
|
||||
/* nothing to do if permission list does not exist */
|
||||
if(!permission_list) {
|
||||
return;
|
||||
}
|
||||
|
||||
/* find existing entry for host */
|
||||
permission_HostStruct * hostStruct;
|
||||
PRInt32 hostCount = permission_list->Count();
|
||||
for (PRInt32 hostIndex = 0; hostIndex < hostCount; ++hostIndex) {
|
||||
hostStruct = NS_STATIC_CAST(permission_HostStruct*, permission_list->ElementAt(hostIndex));
|
||||
if (hostStruct && PL_strcasecmp(host, hostStruct->host)==0) {
|
||||
/* host found in list, see if it has an entry for this type */
|
||||
permission_TypeStruct * typeStruct;
|
||||
PRInt32 typeCount = hostStruct->permissionList->Count();
|
||||
for (PRInt32 typeIndex=0; typeIndex<typeCount; typeIndex++) {
|
||||
typeStruct = NS_STATIC_CAST
|
||||
(permission_TypeStruct*, hostStruct->permissionList->ElementAt(typeIndex));
|
||||
if (typeStruct && typeStruct->type == type) {
|
||||
/* type found. Remove the permission if it is PR_FALSE */
|
||||
if (typeStruct->permission == PR_FALSE) {
|
||||
hostStruct->permissionList->RemoveElementAt(typeIndex);
|
||||
/* if no more types are present, remove the entry */
|
||||
typeCount = hostStruct->permissionList->Count();
|
||||
if (typeCount == 0) {
|
||||
PR_FREEIF(hostStruct->permissionList);
|
||||
permission_list->RemoveElementAt(hostIndex);
|
||||
PR_FREEIF(hostStruct->host);
|
||||
PR_Free(hostStruct);
|
||||
}
|
||||
permission_changed = PR_TRUE;
|
||||
Permission_Save(PR_TRUE);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* saves the permissions to disk */
|
||||
PUBLIC void
|
||||
Permission_Save(PRBool notify) {
|
||||
permission_HostStruct * hostStruct;
|
||||
permission_TypeStruct * typeStruct;
|
||||
|
||||
if (!permission_changed) {
|
||||
return;
|
||||
}
|
||||
if (permission_list == nsnull) {
|
||||
return;
|
||||
}
|
||||
nsFileSpec dirSpec;
|
||||
nsresult rval = CKutil_ProfileDirectory(dirSpec);
|
||||
if (NS_FAILED(rval)) {
|
||||
return;
|
||||
}
|
||||
dirSpec += kCookiesPermFileName;
|
||||
PRBool ignored;
|
||||
dirSpec.ResolveSymlink(ignored);
|
||||
nsOutputFileStream strm(dirSpec);
|
||||
if (!strm.is_open()) {
|
||||
return;
|
||||
}
|
||||
|
||||
#define PERMISSIONFILE_LINE1 "# HTTP Permission File\n"
|
||||
#define PERMISSIONFILE_LINE2 "# http://www.netscape.com/newsref/std/cookie_spec.html\n"
|
||||
#define PERMISSIONFILE_LINE3 "# This is a generated file! Do not edit.\n\n"
|
||||
|
||||
strm.write(PERMISSIONFILE_LINE1, PL_strlen(PERMISSIONFILE_LINE1));
|
||||
strm.write(PERMISSIONFILE_LINE2, PL_strlen(PERMISSIONFILE_LINE2));
|
||||
strm.write(PERMISSIONFILE_LINE3, PL_strlen(PERMISSIONFILE_LINE3));
|
||||
|
||||
/* format shall be:
|
||||
* host \t permission \t permission ... \n
|
||||
*/
|
||||
|
||||
PRInt32 hostCount = permission_list->Count();
|
||||
for (PRInt32 i = 0; i < hostCount; ++i) {
|
||||
hostStruct = NS_STATIC_CAST(permission_HostStruct*, permission_list->ElementAt(i));
|
||||
if (hostStruct) {
|
||||
strm.write(hostStruct->host, strlen(hostStruct->host));
|
||||
|
||||
PRInt32 typeCount = hostStruct->permissionList->Count();
|
||||
for (PRInt32 typeIndex=0; typeIndex<typeCount; typeIndex++) {
|
||||
typeStruct = NS_STATIC_CAST
|
||||
(permission_TypeStruct*, hostStruct->permissionList->ElementAt(typeIndex));
|
||||
strm.write("\t", 1);
|
||||
nsCAutoString tmp; tmp.AppendInt(typeStruct->type);
|
||||
strm.write(tmp.get(), tmp.Length());
|
||||
if (typeStruct->permission) {
|
||||
strm.write("T", 1);
|
||||
} else {
|
||||
strm.write("F", 1);
|
||||
}
|
||||
}
|
||||
strm.write("\n", 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* save current state of nag boxs' checkmarks */
|
||||
strm.write("@@@@", 4);
|
||||
for (PRInt32 type = 0; type < NUMBER_OF_PERMISSIONS; type++) {
|
||||
strm.write("\t", 1);
|
||||
nsCAutoString tmp; tmp.AppendInt(type);
|
||||
strm.write(tmp.get(), tmp.Length());
|
||||
if (permission_GetRememberChecked(type)) {
|
||||
strm.write("T", 1);
|
||||
} else {
|
||||
strm.write("F", 1);
|
||||
}
|
||||
}
|
||||
|
||||
strm.write("\n", 1);
|
||||
|
||||
permission_changed = PR_FALSE;
|
||||
strm.flush();
|
||||
strm.close();
|
||||
|
||||
/* Notify cookie manager dialog to update its display */
|
||||
if (notify) {
|
||||
nsCOMPtr<nsIObserverService> os(do_GetService("@mozilla.org/observer-service;1"));
|
||||
if (os) {
|
||||
os->NotifyObservers(nsnull, "cookieChanged", NS_LITERAL_STRING("permissions").get());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* reads the permissions from disk */
|
||||
PUBLIC nsresult
|
||||
PERMISSION_Read() {
|
||||
if (permission_list) {
|
||||
return NS_OK;
|
||||
}
|
||||
// create permission list to avoid continually attempting to re-read
|
||||
// cookperm.txt if it doesn't exist
|
||||
permission_list = new nsVoidArray();
|
||||
if(!permission_list) {
|
||||
return NS_ERROR_OUT_OF_MEMORY;
|
||||
}
|
||||
nsCAutoString buffer;
|
||||
nsFileSpec dirSpec;
|
||||
nsresult rv = CKutil_ProfileDirectory(dirSpec);
|
||||
if (NS_FAILED(rv)) {
|
||||
return rv;
|
||||
}
|
||||
nsInputFileStream strm(dirSpec + kCookiesPermFileName);
|
||||
if (!strm.is_open()) {
|
||||
/* file doesn't exist -- that's not an error */
|
||||
for (PRInt32 type=0; type<NUMBER_OF_PERMISSIONS; type++) {
|
||||
permission_SetRememberChecked(type, PR_FALSE);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* format is:
|
||||
* host \t number permission \t number permission ... \n
|
||||
* if this format isn't respected we move onto the next line in the file.
|
||||
*/
|
||||
|
||||
#define BUFSIZE 4096
|
||||
char readbuffer[BUFSIZE];
|
||||
PRInt32 next = BUFSIZE, count = BUFSIZE;
|
||||
while(CKutil_GetLine(strm, readbuffer, BUFSIZE, next, count, buffer) != -1) {
|
||||
if ( !buffer.IsEmpty() ) {
|
||||
char firstChar = buffer.CharAt(0);
|
||||
if (firstChar == '#' || firstChar == nsCRT::CR ||
|
||||
firstChar == nsCRT::LF || firstChar == 0) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
int hostIndex, permissionIndex;
|
||||
PRUint32 nextPermissionIndex = 0;
|
||||
hostIndex = 0;
|
||||
|
||||
if ((permissionIndex=buffer.FindChar('\t', hostIndex)+1) == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
/* ignore leading periods in host name */
|
||||
while (hostIndex < permissionIndex && (buffer.CharAt(hostIndex) == '.')) {
|
||||
hostIndex++;
|
||||
}
|
||||
|
||||
nsDependentCSubstring host(buffer, hostIndex, permissionIndex-hostIndex-1);
|
||||
|
||||
nsCAutoString permissionString;
|
||||
for (;;) {
|
||||
if (nextPermissionIndex == buffer.Length()+1) {
|
||||
break;
|
||||
}
|
||||
if ((nextPermissionIndex=buffer.FindChar('\t', permissionIndex)+1) == 0) {
|
||||
nextPermissionIndex = buffer.Length()+1;
|
||||
}
|
||||
// XXX would like to use nsDependentCSubstring to avoid this allocation,
|
||||
// but it unfortunately doesn't provide the CharAt method.
|
||||
buffer.Mid(permissionString, permissionIndex, nextPermissionIndex-permissionIndex-1);
|
||||
permissionIndex = nextPermissionIndex;
|
||||
|
||||
PRInt32 type = 0;
|
||||
PRUint32 index = 0;
|
||||
|
||||
if (permissionString.IsEmpty()) {
|
||||
continue; /* empty permission entry -- should never happen */
|
||||
}
|
||||
char c = (char)permissionString.CharAt(index);
|
||||
while (index < permissionString.Length() && c >= '0' && c <= '9') {
|
||||
type = 10*type + (c-'0');
|
||||
c = (char)permissionString.CharAt(++index);
|
||||
}
|
||||
if (index >= permissionString.Length()) {
|
||||
continue; /* bad format for this permission entry */
|
||||
}
|
||||
PRBool permission = (permissionString.CharAt(index) == 'T');
|
||||
|
||||
/*
|
||||
* a host value of "@@@@" is a special code designating the
|
||||
* state of the nag-box's checkmark
|
||||
*/
|
||||
if (host.Equals(NS_LITERAL_CSTRING("@@@@"))) {
|
||||
if (!permissionString.IsEmpty()) {
|
||||
permission_SetRememberChecked(type, permission);
|
||||
}
|
||||
} else {
|
||||
if (!permissionString.IsEmpty()) {
|
||||
rv = Permission_AddHost(PromiseFlatCString(host), permission, type, PR_FALSE);
|
||||
if (NS_FAILED(rv)) {
|
||||
strm.close();
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
strm.close();
|
||||
permission_changed = PR_FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PUBLIC PRInt32
|
||||
PERMISSION_HostCount() {
|
||||
if (!permission_list) {
|
||||
return 0;
|
||||
}
|
||||
return permission_list->Count();
|
||||
}
|
||||
|
||||
PUBLIC PRInt32
|
||||
PERMISSION_HostCountForType(PRInt32 type) {
|
||||
if (!permission_list) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
permission_HostStruct * hostStruct;
|
||||
permission_TypeStruct * typeStruct;
|
||||
PRInt32 hostCount = permission_list->Count();
|
||||
PRInt32 hostCountForType = 0;
|
||||
for (PRInt32 i = 0; i < hostCount; ++i) {
|
||||
hostStruct = NS_STATIC_CAST(permission_HostStruct*, permission_list->ElementAt(i));
|
||||
PRInt32 typeCount = hostStruct->permissionList->Count();
|
||||
for (PRInt32 j = 0; j < typeCount; ++j) {
|
||||
typeStruct = NS_STATIC_CAST(permission_TypeStruct *, hostStruct->permissionList->ElementAt(j));
|
||||
if (typeStruct && typeStruct->type == type)
|
||||
hostCountForType++;
|
||||
}
|
||||
}
|
||||
|
||||
return hostCountForType;
|
||||
}
|
||||
|
||||
PUBLIC PRInt32
|
||||
PERMISSION_TypeCount(PRInt32 host) {
|
||||
if (!permission_list) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
permission_HostStruct *hostStruct;
|
||||
if (host >= PERMISSION_HostCount()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
hostStruct = NS_STATIC_CAST(permission_HostStruct*, permission_list->ElementAt(host));
|
||||
NS_ASSERTION(hostStruct, "corrupt permission list");
|
||||
return hostStruct->permissionList->Count();
|
||||
}
|
||||
|
||||
PUBLIC nsresult
|
||||
PERMISSION_Enumerate
|
||||
(PRInt32 hostNumber, PRInt32 typeNumber, char **host, PRInt32 *type, PRBool *capability) {
|
||||
if (hostNumber >= PERMISSION_HostCount() || typeNumber >= PERMISSION_TypeCount(hostNumber)) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
permission_HostStruct *hostStruct;
|
||||
permission_TypeStruct * typeStruct;
|
||||
|
||||
hostStruct = NS_STATIC_CAST(permission_HostStruct*, permission_list->ElementAt(hostNumber));
|
||||
NS_ASSERTION(hostStruct, "corrupt permission list");
|
||||
char * copyOfHost = NULL;
|
||||
CKutil_StrAllocCopy(copyOfHost, hostStruct->host);
|
||||
*host = copyOfHost;
|
||||
|
||||
typeStruct = NS_STATIC_CAST
|
||||
(permission_TypeStruct*, hostStruct->permissionList->ElementAt(typeNumber));
|
||||
*capability = typeStruct->permission;
|
||||
*type = typeStruct->type;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
PRIVATE void
|
||||
permission_remove (PRInt32 hostNumber, PRInt32 type) {
|
||||
if (!permission_list) {
|
||||
return;
|
||||
}
|
||||
if (hostNumber >= PERMISSION_HostCount() || type >= PERMISSION_TypeCount(hostNumber)) {
|
||||
return;
|
||||
}
|
||||
permission_HostStruct * hostStruct;
|
||||
hostStruct =
|
||||
NS_STATIC_CAST(permission_HostStruct*, permission_list->ElementAt(hostNumber));
|
||||
if (!hostStruct) {
|
||||
return;
|
||||
}
|
||||
permission_TypeStruct * typeStruct;
|
||||
typeStruct =
|
||||
NS_STATIC_CAST(permission_TypeStruct*, hostStruct->permissionList->ElementAt(type));
|
||||
if (!typeStruct) {
|
||||
return;
|
||||
}
|
||||
hostStruct->permissionList->RemoveElementAt(type);
|
||||
permission_changed = PR_TRUE;
|
||||
|
||||
/* if no types are present, remove the entry */
|
||||
PRInt32 typeCount = hostStruct->permissionList->Count();
|
||||
if (typeCount == 0) {
|
||||
PR_FREEIF(hostStruct->permissionList);
|
||||
permission_list->RemoveElementAt(hostNumber);
|
||||
PR_FREEIF(hostStruct->host);
|
||||
PR_Free(hostStruct);
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void
|
||||
PERMISSION_Remove(const nsACString & host, PRInt32 type) {
|
||||
|
||||
/* get to the indicated host in the list */
|
||||
if (permission_list) {
|
||||
PRInt32 hostCount = permission_list->Count();
|
||||
permission_HostStruct * hostStruct;
|
||||
while (hostCount>0) {
|
||||
hostCount--;
|
||||
hostStruct =
|
||||
NS_STATIC_CAST(permission_HostStruct*, permission_list->ElementAt(hostCount));
|
||||
NS_ASSERTION(hostStruct, "corrupt permission list");
|
||||
if (host.Equals(hostStruct->host)) {
|
||||
|
||||
/* get to the indicated permission in the list */
|
||||
PRInt32 typeCount = hostStruct->permissionList->Count();
|
||||
permission_TypeStruct * typeStruct;
|
||||
while (typeCount>0) {
|
||||
typeCount--;
|
||||
typeStruct =
|
||||
NS_STATIC_CAST
|
||||
(permission_TypeStruct*, hostStruct->permissionList->ElementAt(typeCount));
|
||||
NS_ASSERTION(typeStruct, "corrupt permission list");
|
||||
if (typeStruct->type == type) {
|
||||
permission_remove(hostCount, typeCount);
|
||||
permission_changed = PR_TRUE;
|
||||
Permission_Save(PR_FALSE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* blows away all permissions currently in the list */
|
||||
PUBLIC void
|
||||
PERMISSION_RemoveAll() {
|
||||
|
||||
if (permission_list) {
|
||||
permission_HostStruct * hostStruct;
|
||||
PRInt32 hostCount = permission_list->Count();
|
||||
for (PRInt32 i = hostCount-1; i >=0; i--) {
|
||||
hostStruct = NS_STATIC_CAST(permission_HostStruct*, permission_list->ElementAt(i));
|
||||
PRInt32 typeCount = hostStruct->permissionList->Count();
|
||||
for (PRInt32 typeIndex = typeCount-1; typeIndex >=0; typeIndex--) {
|
||||
permission_remove(hostCount, typeCount);
|
||||
}
|
||||
}
|
||||
delete permission_list;
|
||||
permission_list = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void
|
||||
PERMISSION_DeletePersistentUserData(void)
|
||||
{
|
||||
nsresult res;
|
||||
|
||||
nsCOMPtr<nsIFile> cookiesPermFile;
|
||||
res = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(cookiesPermFile));
|
||||
if (NS_SUCCEEDED(res)) {
|
||||
res = cookiesPermFile->AppendNative(nsDependentCString(kCookiesPermFileName));
|
||||
if (NS_SUCCEEDED(res))
|
||||
(void) cookiesPermFile->Remove(PR_FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
PUBLIC void
|
||||
PERMISSION_Add(nsIURI * objectURI, PRBool permission, PRInt32 type) {
|
||||
if (!objectURI) {
|
||||
return;
|
||||
}
|
||||
nsCAutoString hostPort;
|
||||
objectURI->GetHostPort(hostPort);
|
||||
if (hostPort.IsEmpty())
|
||||
return;
|
||||
|
||||
/*
|
||||
* if permission is false, it will be added to the permission list
|
||||
* if permission is true, any false permissions will be removed rather than a
|
||||
* true permission being added
|
||||
*/
|
||||
if (permission) {
|
||||
const char * hostPtr = hostPort.get();
|
||||
while (PR_TRUE) {
|
||||
permission_Unblock(hostPtr, type);
|
||||
hostPtr = PL_strchr(hostPtr, '.');
|
||||
if (!hostPtr) {
|
||||
break;
|
||||
}
|
||||
hostPtr++; /* get past the period */
|
||||
}
|
||||
return;
|
||||
}
|
||||
Permission_AddHost(hostPort, permission, type, PR_TRUE);
|
||||
}
|
||||
|
||||
PUBLIC void
|
||||
PERMISSION_TestForBlocking(nsIURI * objectURI, PRBool* blocked, PRInt32 type) {
|
||||
if (!objectURI) {
|
||||
return;
|
||||
}
|
||||
nsresult rv = NS_OK;
|
||||
nsCAutoString hostPort;
|
||||
objectURI->GetHostPort(hostPort);
|
||||
if (hostPort.IsEmpty())
|
||||
return;
|
||||
|
||||
const char * hostPtr = hostPort.get();
|
||||
while (PR_TRUE) {
|
||||
PRBool permission;
|
||||
rv = permission_CheckFromList(hostPtr, permission, type);
|
||||
if (NS_SUCCEEDED(rv) && !permission) {
|
||||
*blocked = PR_TRUE;
|
||||
return;
|
||||
}
|
||||
hostPtr = PL_strchr(hostPtr, '.');
|
||||
if (!hostPtr) {
|
||||
break;
|
||||
}
|
||||
hostPtr++; /* get past the period */
|
||||
}
|
||||
*blocked = PR_FALSE;
|
||||
return;
|
||||
}
|
|
@ -1,166 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* 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.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#include "nsUtils.h"
|
||||
#include "nsXPIDLString.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsIPref.h"
|
||||
#include "nsIFileSpec.h"
|
||||
#include "nsILocalFile.h"
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "prmem.h"
|
||||
#include "nsComObsolete.h"
|
||||
|
||||
static NS_DEFINE_IID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
|
||||
|
||||
#define LOCALIZATION "chrome://cookie/locale/cookie.properties"
|
||||
|
||||
nsresult
|
||||
ckutil_getChar(nsInputFileStream& strm,
|
||||
char *buffer, PRInt32 bufsize,
|
||||
PRInt32& next, PRInt32& count,
|
||||
char& c) {
|
||||
|
||||
if (next == count) {
|
||||
if (bufsize > count) { // never say "count < ..." vc6.0 thinks this is a template beginning and crashes
|
||||
next = bufsize;
|
||||
count = bufsize;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
count = strm.read(buffer, bufsize);
|
||||
next = 0;
|
||||
if (count == 0) {
|
||||
next = bufsize;
|
||||
count = bufsize;
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
c = buffer[next++];
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
* get a line from a file
|
||||
* return -1 if end of file reached
|
||||
* strip carriage returns and line feeds from end of line
|
||||
*/
|
||||
PUBLIC PRInt32
|
||||
CKutil_GetLine(nsInputFileStream& strm, char *buffer, PRInt32 bufsize,
|
||||
PRInt32& next, PRInt32& count, nsACString& aLine) {
|
||||
|
||||
/* read the line */
|
||||
aLine.Truncate();
|
||||
char c;
|
||||
for (;;) {
|
||||
if NS_FAILED(ckutil_getChar(strm, buffer, bufsize, next, count, c)) {
|
||||
return -1;
|
||||
}
|
||||
if (c == '\n') {
|
||||
break;
|
||||
}
|
||||
|
||||
if (c != '\r') {
|
||||
aLine.Append(c);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
PRUnichar *
|
||||
CKutil_Localize(const PRUnichar *genericString) {
|
||||
nsresult ret;
|
||||
PRUnichar *ptrv = nsnull;
|
||||
nsCOMPtr<nsIStringBundleService> pStringService =
|
||||
do_GetService(kStringBundleServiceCID, &ret);
|
||||
if (NS_SUCCEEDED(ret) && (nsnull != pStringService)) {
|
||||
nsCOMPtr<nsIStringBundle> bundle;
|
||||
ret = pStringService->CreateBundle(LOCALIZATION, getter_AddRefs(bundle));
|
||||
if (NS_SUCCEEDED(ret) && bundle) {
|
||||
ret = bundle->GetStringFromName(genericString, &ptrv);
|
||||
if ( NS_SUCCEEDED(ret) && (ptrv) ) {
|
||||
return ptrv;
|
||||
}
|
||||
}
|
||||
}
|
||||
return nsCRT::strdup(genericString);
|
||||
}
|
||||
|
||||
PUBLIC nsresult
|
||||
CKutil_ProfileDirectory(nsFileSpec& dirSpec) {
|
||||
nsresult res;
|
||||
nsCOMPtr<nsIFile> aFile;
|
||||
nsCOMPtr<nsIFileSpec> tempSpec;
|
||||
|
||||
res = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(aFile));
|
||||
if (NS_FAILED(res)) return res;
|
||||
|
||||
// TODO: When the calling code can take an nsIFile,
|
||||
// this conversion to nsFileSpec can be avoided.
|
||||
res = NS_NewFileSpecFromIFile(aFile, getter_AddRefs(tempSpec));
|
||||
if (NS_FAILED(res)) return res;
|
||||
res = tempSpec->GetFileSpec(&dirSpec);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
PUBLIC char *
|
||||
CKutil_StrAllocCopy(char *&destination, const char *source) {
|
||||
if(destination) {
|
||||
PL_strfree(destination);
|
||||
destination = 0;
|
||||
}
|
||||
destination = PL_strdup(source);
|
||||
return destination;
|
||||
}
|
||||
|
||||
PUBLIC char *
|
||||
CKutil_StrAllocCat(char *&destination, const char *source) {
|
||||
if (source && *source) {
|
||||
if (destination) {
|
||||
int length = PL_strlen (destination);
|
||||
destination = (char *) PR_Realloc(destination, length + PL_strlen(source) + 1);
|
||||
if (destination == NULL) {
|
||||
return(NULL);
|
||||
}
|
||||
PL_strcpy (destination + length, source);
|
||||
} else {
|
||||
destination = PL_strdup(source);
|
||||
}
|
||||
}
|
||||
return destination;
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* 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.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is
|
||||
* Netscape Communications Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 1998
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the NPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the NPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsFileStream.h"
|
||||
|
||||
extern PRInt32 CKutil_GetLine(nsInputFileStream& strm, char *aBuf, PRInt32 sz,
|
||||
PRInt32& next, PRInt32& count, nsACString& aLine);
|
||||
extern PRUnichar* CKutil_Localize(const PRUnichar *genericString);
|
||||
extern nsresult CKutil_ProfileDirectory(nsFileSpec& dirSpec);
|
||||
extern char * CKutil_StrAllocCopy(char *&destination, const char *source);
|
||||
extern char * CKutil_StrAllocCat(char *&destination, const char *source);
|
||||
|
||||
#endif /* UTILS_H */
|
|
@ -49,7 +49,7 @@ include $(DEPTH)/config/autoconf.mk
|
|||
|
||||
LIBRARY_NAME = pyloader
|
||||
IS_COMPONENT = 1
|
||||
REQUIRES = xpcom string $(NULL)
|
||||
REQUIRES = xpcom string xpcom_obsolete $(NULL)
|
||||
|
||||
LOCAL_INCLUDES = $(PYTHON_INCLUDES)
|
||||
EXTRA_LIBS += $(PYTHON_LIBS)
|
||||
|
|
|
@ -40,7 +40,6 @@
|
|||
#include "nsIGenericFactory.h"
|
||||
#include "nsTypeAheadFind.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIRegistry.h"
|
||||
#include "prprf.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsICategoryManager.h"
|
||||
|
|
|
@ -34,6 +34,7 @@ MODULE_NAME = nsWalletModule
|
|||
GRE_MODULE = 1
|
||||
|
||||
REQUIRES = xpcom \
|
||||
xpcom_obsolete \
|
||||
string \
|
||||
necko \
|
||||
dom \
|
||||
|
@ -74,6 +75,7 @@ EXTRA_DSO_LDOPTS = \
|
|||
$(LIBS_DIRS) \
|
||||
$(MOZ_UNICHARUTIL_LIBS) \
|
||||
$(MOZ_COMPONENT_LIBS) \
|
||||
$(MOZ_XPCOM_OBSOLETE_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -52,7 +52,6 @@ PRUint32 gFontDebug = 0 | NS_FONT_DEBUG_FONT_SCAN;
|
|||
#include <sys/stat.h>
|
||||
#include <sys/time.h>
|
||||
#include <dirent.h>
|
||||
#include "nsIFileSpec.h"
|
||||
#include "nsAppDirectoryServiceDefs.h"
|
||||
#include "nsLocalFileUnix.h"
|
||||
#include "nsIEnumerator.h"
|
||||
|
|
|
@ -128,9 +128,7 @@ class CStartToken: public CHTMLToken {
|
|||
|
||||
virtual PRBool IsEmpty(void);
|
||||
virtual void SetEmpty(PRBool aValue);
|
||||
#ifdef DEBUG
|
||||
virtual void DebugDumpSource(nsOutputStream& out);
|
||||
#endif
|
||||
|
||||
virtual const nsAString& GetStringValue();
|
||||
virtual void GetSource(nsString& anOutputString);
|
||||
virtual void AppendSourceTo(nsAString& anOutputString);
|
||||
|
@ -180,9 +178,7 @@ class CEndToken: public CHTMLToken {
|
|||
virtual PRInt32 GetTypeID(void);
|
||||
virtual const char* GetClassName(void);
|
||||
virtual PRInt32 GetTokenType(void);
|
||||
#ifdef DEBUG
|
||||
virtual void DebugDumpSource(nsOutputStream& out);
|
||||
#endif
|
||||
|
||||
virtual const nsAString& GetStringValue();
|
||||
virtual void GetSource(nsString& anOutputString);
|
||||
virtual void AppendSourceTo(nsAString& anOutputString);
|
||||
|
@ -240,9 +236,7 @@ class CEntityToken : public CHTMLToken {
|
|||
virtual nsresult Consume(PRUnichar aChar,nsScanner& aScanner,PRInt32 aMode);
|
||||
static nsresult ConsumeEntity(PRUnichar aChar,nsString& aString,nsScanner& aScanner);
|
||||
static PRInt32 TranslateToUnicodeStr(PRInt32 aValue,nsString& aString);
|
||||
#ifdef DEBUG
|
||||
virtual void DebugDumpSource(nsOutputStream& out);
|
||||
#endif
|
||||
|
||||
virtual const nsAString& GetStringValue(void);
|
||||
virtual void GetSource(nsString& anOutputString);
|
||||
virtual void AppendSourceTo(nsAString& anOutputString);
|
||||
|
@ -372,15 +366,9 @@ class CAttributeToken: public CHTMLToken {
|
|||
virtual void BindKey(nsScanner* aScanner, nsReadingIterator<PRUnichar>& aStart, nsReadingIterator<PRUnichar>& aEnd);
|
||||
virtual const nsAString& GetValue(void) {return mTextValue;}
|
||||
virtual void SanitizeKey();
|
||||
#ifdef DEBUG
|
||||
virtual void DebugDumpToken(nsOutputStream& out);
|
||||
#endif
|
||||
virtual const nsAString& GetStringValue(void);
|
||||
virtual void GetSource(nsString& anOutputString);
|
||||
virtual void AppendSourceTo(nsAString& anOutputString);
|
||||
#ifdef DEBUG
|
||||
virtual void DebugDumpSource(nsOutputStream& out);
|
||||
#endif
|
||||
|
||||
PRPackedBool mHasEqualWithoutValue;
|
||||
protected:
|
||||
|
|
|
@ -232,7 +232,7 @@ class nsIParser : public nsISupports {
|
|||
virtual PRBool IsComplete() =0;
|
||||
|
||||
virtual nsresult Parse(nsIURI* aURL,nsIRequestObserver* aListener = nsnull,PRBool aEnableVerify=PR_FALSE, void* aKey=0,nsDTDMode aMode=eDTDMode_autodetect) = 0;
|
||||
virtual nsresult Parse(nsIInputStream& aStream, const nsACString& aMimeType,PRBool aEnableVerify=PR_FALSE, void* aKey=0,nsDTDMode aMode=eDTDMode_autodetect) = 0;
|
||||
virtual nsresult Parse(nsIInputStream* aStream, const nsACString& aMimeType,PRBool aEnableVerify=PR_FALSE, void* aKey=0,nsDTDMode aMode=eDTDMode_autodetect) = 0;
|
||||
virtual nsresult Parse(const nsAString& aSourceBuffer,void* aKey,const nsACString& aMimeType,PRBool aEnableVerify,PRBool aLastCall,nsDTDMode aMode=eDTDMode_autodetect) = 0;
|
||||
|
||||
virtual nsresult Terminate(void) = 0;
|
||||
|
|
|
@ -72,7 +72,6 @@
|
|||
#include "prtypes.h"
|
||||
#include "nsString.h"
|
||||
#include "nsError.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsFixedSizeAllocator.h"
|
||||
|
||||
#define NS_HTMLTOKENS_NOT_AN_ENTITY \
|
||||
|
@ -221,22 +220,6 @@ class CToken {
|
|||
*/
|
||||
virtual nsresult Consume(PRUnichar aChar,nsScanner& aScanner,PRInt32 aMode);
|
||||
|
||||
#ifdef DEBUG
|
||||
/**
|
||||
* Causes token to dump itself in debug form to given output stream
|
||||
* @update gess5/11/98
|
||||
* @param out is the output stream where token should write itself
|
||||
*/
|
||||
virtual void DebugDumpToken(nsOutputStream& out);
|
||||
|
||||
/**
|
||||
* Causes token to dump itself in source form to given output stream
|
||||
* @update gess5/11/98
|
||||
* @param out is the output stream where token should write itself
|
||||
*/
|
||||
virtual void DebugDumpSource(nsOutputStream& out);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Getter which retrieves type of token
|
||||
* @update gess5/11/98
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
//#define ENABLE_CRC
|
||||
//#define RICKG_DEBUG
|
||||
//#define ALLOW_TR_AS_CHILD_OF_TABLE //by setting this to true, TR is allowable directly in TABLE.
|
||||
|
||||
#define ENABLE_RESIDUALSTYLE
|
||||
|
@ -69,6 +68,7 @@
|
|||
#include "nsReadableUtils.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
#include "prmem.h"
|
||||
#include "nsIServiceManager.h"
|
||||
|
||||
#ifdef NS_DEBUG
|
||||
#include "nsLoggingSink.h"
|
||||
|
@ -190,13 +190,6 @@ CNavDTD::CNavDTD() : nsIDTD(),
|
|||
#endif
|
||||
{
|
||||
mBodyContext=new nsDTDContext();
|
||||
|
||||
#ifdef RICKG_DEBUG
|
||||
//DebugDumpContainmentRules2(*this,"c:/temp/DTDRules.new","New CNavDTD Containment Rules");
|
||||
nsHTMLElement::DebugDumpContainment("c:/temp/contain.new","ElementTable Rules");
|
||||
nsHTMLElement::DebugDumpMembership("c:/temp/membership.out");
|
||||
nsHTMLElement::DebugDumpContainType("c:/temp/ctnrules.out");
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1393,16 +1386,6 @@ nsresult CNavDTD::HandleDefaultStartToken(CToken* aToken,eHTMLTags aChildTag,nsC
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#ifdef RICKG_DEBUG
|
||||
void WriteTokenToLog(CToken* aToken) {
|
||||
|
||||
static nsFileSpec fileSpec("c:\\temp\\tokenlog.html");
|
||||
static nsOutputFileStream outputStream(fileSpec);
|
||||
aToken->DebugDumpSource(outputStream); //write token without close bracket...
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This gets called before we've handled a given start tag.
|
||||
|
@ -1689,10 +1672,6 @@ nsresult CNavDTD::HandleKeyGen(nsIParserNode* aNode) {
|
|||
nsresult CNavDTD::HandleStartToken(CToken* aToken) {
|
||||
NS_PRECONDITION(0!=aToken,kNullToken);
|
||||
|
||||
#ifdef RICKG_DEBUG
|
||||
WriteTokenToLog(aToken);
|
||||
#endif
|
||||
|
||||
//Begin by gathering up attributes...
|
||||
|
||||
nsCParserNode* theNode=mNodeAllocator.CreateNode(aToken, mTokenAllocator);
|
||||
|
@ -1947,10 +1926,6 @@ nsresult CNavDTD::HandleEndToken(CToken* aToken) {
|
|||
nsresult result=NS_OK;
|
||||
eHTMLTags theChildTag=(eHTMLTags)aToken->GetTypeID();
|
||||
|
||||
#ifdef RICKG_DEBUG
|
||||
WriteTokenToLog(aToken);
|
||||
#endif
|
||||
|
||||
switch(theChildTag) {
|
||||
|
||||
case eHTMLTag_script:
|
||||
|
@ -2198,9 +2173,6 @@ nsresult CNavDTD::HandleEntityToken(CToken* aToken) {
|
|||
result=HandleOmittedTag(aToken,theCurrTag,theParentTag,theNode);
|
||||
}
|
||||
else {
|
||||
#ifdef RICKG_DEBUG
|
||||
WriteTokenToLog(aToken);
|
||||
#endif
|
||||
result=AddLeaf(theNode);
|
||||
}
|
||||
IF_FREE(theNode, &mNodeAllocator);
|
||||
|
@ -2227,10 +2199,6 @@ nsresult CNavDTD::HandleCommentToken(CToken* aToken) {
|
|||
|
||||
if(theNode) {
|
||||
|
||||
#ifdef RICKG_DEBUG
|
||||
WriteTokenToLog(aToken);
|
||||
#endif
|
||||
|
||||
STOP_TIMER();
|
||||
MOZ_TIMER_DEBUGLOG(("Stop: Parse Time: CNavDTD::HandleCommentToken(), this=%p\n", this));
|
||||
|
||||
|
@ -2304,10 +2272,6 @@ nsresult CNavDTD::HandleProcessingInstructionToken(CToken* aToken){
|
|||
nsCParserNode* theNode=mNodeAllocator.CreateNode(aToken, mTokenAllocator);
|
||||
if(theNode) {
|
||||
|
||||
#ifdef RICKG_DEBUG
|
||||
WriteTokenToLog(aToken);
|
||||
#endif
|
||||
|
||||
STOP_TIMER();
|
||||
MOZ_TIMER_DEBUGLOG(("Stop: Parse Time: CNavDTD::HandleProcessingInstructionToken(), this=%p\n", this));
|
||||
|
||||
|
@ -2335,10 +2299,6 @@ nsresult CNavDTD::HandleDocTypeDeclToken(CToken* aToken){
|
|||
|
||||
nsresult result=NS_OK;
|
||||
|
||||
#ifdef RICKG_DEBUG
|
||||
WriteTokenToLog(aToken);
|
||||
#endif
|
||||
|
||||
CDoctypeDeclToken* theToken = NS_STATIC_CAST(CDoctypeDeclToken*,aToken);
|
||||
nsAutoString docTypeStr(theToken->GetStringValue());
|
||||
mLineNumber += docTypeStr.CountChar(kNewLine);
|
||||
|
@ -2406,10 +2366,6 @@ nsresult CNavDTD::CollectAttributes(nsIParserNode& aNode,eHTMLTags aTag,PRInt32
|
|||
((CAttributeToken*)theToken)->SanitizeKey();
|
||||
mLineNumber += theToken->GetNewlineCount();
|
||||
|
||||
#ifdef RICKG_DEBUG
|
||||
WriteTokenToLog(theToken);
|
||||
#endif
|
||||
|
||||
aNode.AddAttribute(theToken);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,8 +38,6 @@
|
|||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
//#define ENABLE_CRC
|
||||
//#define RICKG_DEBUG
|
||||
|
||||
|
||||
#include "nsDebug.h"
|
||||
#include "nsIAtom.h"
|
||||
|
@ -176,14 +174,6 @@ COtherDTD::COtherDTD() : nsIDTD() {
|
|||
if(!gElementTable) {
|
||||
gElementTable = new CElementTable();
|
||||
}
|
||||
|
||||
#ifdef RICKG_DEBUG
|
||||
//DebugDumpContainmentRules2(*this,"c:/temp/DTDRules.new","New COtherDTD Containment Rules");
|
||||
nsHTMLElement::DebugDumpContainment("c:/temp/contain.new","ElementTable Rules");
|
||||
nsHTMLElement::DebugDumpMembership("c:/temp/membership.out");
|
||||
nsHTMLElement::DebugDumpContainType("c:/temp/ctnrules.out");
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -628,16 +618,6 @@ nsresult COtherDTD::DidHandleStartTag(nsIParserNode& aNode,eHTMLTags aChildTag){
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
#ifdef RICKG_DEBUG
|
||||
void WriteTokenToLog(CToken* aToken) {
|
||||
|
||||
static nsFileSpec fileSpec("c:\\temp\\tokenlog.html");
|
||||
static nsOutputFileStream outputStream(fileSpec);
|
||||
aToken->DebugDumpSource(outputStream); //write token without close bracket...
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* This gets called before we've handled a given start tag.
|
||||
* It's a generic hook to let us do pre processing.
|
||||
|
@ -694,9 +674,6 @@ nsresult COtherDTD::WillHandleStartTag(CToken* aToken,eHTMLTags aTag,nsIParserNo
|
|||
* @return PR_TRUE if all went well; PR_FALSE if error occured
|
||||
*/
|
||||
nsresult COtherDTD::HandleStartToken(CToken* aToken) {
|
||||
#ifdef RICKG_DEBUG
|
||||
WriteTokenToLog(aToken);
|
||||
#endif
|
||||
|
||||
//Begin by gathering up attributes...
|
||||
|
||||
|
@ -767,10 +744,6 @@ nsresult COtherDTD::HandleEndToken(CToken* aToken) {
|
|||
nsresult result=NS_OK;
|
||||
eHTMLTags theChildTag=(eHTMLTags)aToken->GetTypeID();
|
||||
|
||||
#ifdef RICKG_DEBUG
|
||||
WriteTokenToLog(aToken);
|
||||
#endif
|
||||
|
||||
switch(theChildTag) {
|
||||
|
||||
case eHTMLTag_body: //we intentionally don't let the user close HTML or BODY
|
||||
|
@ -826,10 +799,6 @@ nsresult COtherDTD::CollectAttributes(nsIParserNode& aNode,eHTMLTags aTag,PRInt3
|
|||
// a legitimate "SELECTED" key.
|
||||
((CAttributeToken*)theToken)->SanitizeKey();
|
||||
|
||||
#ifdef RICKG_DEBUG
|
||||
WriteTokenToLog(theToken);
|
||||
#endif
|
||||
|
||||
aNode.AddAttribute(theToken);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1489,40 +1489,6 @@ nsCParserNode* nsNodeAllocator::CreateNode(CToken* aToken,
|
|||
|
||||
#ifdef DEBUG
|
||||
void DebugDumpContainmentRules(nsIDTD& theDTD,const char* aFilename,const char* aTitle) {
|
||||
#ifdef RICKG_DEBUG
|
||||
|
||||
#include <fstream.h>
|
||||
|
||||
const char* prefix=" ";
|
||||
fstream out(aFilename,ios::out);
|
||||
out << "==================================================" << endl;
|
||||
out << aTitle << endl;
|
||||
out << "==================================================";
|
||||
int i,j=0;
|
||||
int written;
|
||||
for(i=1;i<eHTMLTag_text;++i){
|
||||
const char* tag=nsHTMLTags::GetCStringValue((eHTMLTags)i);
|
||||
out << endl << endl << "Tag: <" << tag << ">" << endl;
|
||||
out << prefix;
|
||||
written=0;
|
||||
if(theDTD.IsContainer(i)) {
|
||||
for(j=1;j<eHTMLTag_text;++j){
|
||||
if(15==written) {
|
||||
out << endl << prefix;
|
||||
written=0;
|
||||
}
|
||||
if(theDTD.CanContain(i,j)){
|
||||
tag=nsHTMLTags::GetCStringValue((eHTMLTags)j);
|
||||
if(tag) {
|
||||
out<< tag << ", ";
|
||||
++written;
|
||||
}
|
||||
}
|
||||
}//for
|
||||
}
|
||||
else out<<"(not container)" << endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
#include "nsFixedSizeAllocator.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsIParserService.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
||||
#define IF_HOLD(_ptr) \
|
||||
PR_BEGIN_MACRO \
|
||||
|
|
|
@ -2295,168 +2295,13 @@ PRBool nsHTMLElement::CanContain(eHTMLTags aChild) const{
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
//#define RICKG_DEBUG
|
||||
#ifdef RICKG_DEBUG
|
||||
#include <fstream.h>
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG
|
||||
void nsHTMLElement::DebugDumpContainment(const char* aFilename,const char* aTitle){
|
||||
#ifdef RICKG_DEBUG
|
||||
|
||||
PRBool t=CanContain(eHTMLTag_address,eHTMLTag_object);
|
||||
|
||||
const char* prefix=" ";
|
||||
fstream out(aFilename,ios::out);
|
||||
out << "==================================================" << endl;
|
||||
out << aTitle << endl;
|
||||
out << "==================================================";
|
||||
int i,j=0;
|
||||
int written;
|
||||
int linenum=5;
|
||||
for(i=1;i<eHTMLTag_text;++i){
|
||||
|
||||
const char* tag=nsHTMLTags::GetStringValue((eHTMLTags)i);
|
||||
out << endl << endl << "Tag: <" << tag << ">" << endl;
|
||||
out << prefix;
|
||||
linenum+=3;
|
||||
written=0;
|
||||
char startChar=0;
|
||||
if(IsContainer((eHTMLTags)i)) {
|
||||
for(j=1;j<eHTMLTag_text;++j){
|
||||
tag=nsHTMLTags::GetStringValue((eHTMLTags)j);
|
||||
if(tag) {
|
||||
if(!startChar)
|
||||
startChar=tag[0];
|
||||
if(12==written){
|
||||
out << endl << prefix;
|
||||
++linenum;
|
||||
written=0;
|
||||
}
|
||||
if(CanContain((eHTMLTags)i,(eHTMLTags)j)){
|
||||
if(tag[0]!=startChar){
|
||||
out << endl << prefix;
|
||||
++linenum;
|
||||
written=0;
|
||||
startChar=tag[0];
|
||||
}
|
||||
out<< tag << ", ";
|
||||
++written;
|
||||
}
|
||||
|
||||
}//if
|
||||
}//for
|
||||
}
|
||||
else {
|
||||
out<<"(not container)" << endl;
|
||||
++linenum;
|
||||
}
|
||||
} //for
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void nsHTMLElement::DebugDumpMembership(const char* aFilename){
|
||||
#ifdef RICKG_DEBUG
|
||||
|
||||
const char* prefix=" ";
|
||||
const char* suffix=" ";
|
||||
const char* shortSuffix=" ";
|
||||
fstream out(aFilename,ios::out);
|
||||
int i,j=0;
|
||||
int written=0;
|
||||
|
||||
out << "============================================================================================================" << endl;
|
||||
out << "Membership..." << endl;
|
||||
out << "============================================================================================================" << endl;
|
||||
out << prefix << "Block Block Inline Flow Font Phrase Special Head List Form Pre" << endl;
|
||||
out << prefix << "Element Entity Entity Entity Element Element Element Element Element Element Element" << endl;
|
||||
out << "============================================================================================================" << endl;
|
||||
|
||||
char* answer[]={".","Y"};
|
||||
char startChar=0;
|
||||
for(i=1;i<eHTMLTag_text;++i){
|
||||
const char* tag=nsHTMLTags::GetStringValue((eHTMLTags)i);
|
||||
out << tag;
|
||||
int len=strlen(tag);
|
||||
|
||||
while(len++<15){
|
||||
out<<" ";
|
||||
}
|
||||
|
||||
int b=kBlock;
|
||||
b=kBlockEntity;
|
||||
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].mParentBits==kBlock] << suffix ;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].IsMemberOf(kBlockEntity)] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].IsMemberOf(kInlineEntity)] << suffix ;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].IsMemberOf(kFlowEntity)] << suffix ;
|
||||
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].IsMemberOf(kFontStyle)] << suffix ;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].IsMemberOf(kPhrase)] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].IsMemberOf(kSpecial)] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].IsMemberOf(kHeading)] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].IsMemberOf(kList)] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].IsMemberOf(kFormControl)] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].IsMemberOf(kPreformatted)] << suffix << endl;
|
||||
|
||||
/*
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].mParentBits==kFontStyle] << suffix ;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].mParentBits==kPhrase] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].mParentBits==kSpecial] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].mParentBits==kHeading] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].mParentBits==kList] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].mParentBits==kFormControl] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].mParentBits==kPreformatted] << suffix << endl;
|
||||
*/
|
||||
} //for
|
||||
out<<endl<<endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
void nsHTMLElement::DebugDumpContainType(const char* aFilename){
|
||||
//#define RICKG_DEBUG
|
||||
#ifdef RICKG_DEBUG
|
||||
|
||||
const char* prefix=" ";
|
||||
const char* suffix=" ";
|
||||
const char* shortSuffix=" ";
|
||||
fstream out(aFilename,ios::out);
|
||||
int i,j=0;
|
||||
int written=0;
|
||||
|
||||
out << "============================================================================================================" << endl;
|
||||
out << "ContainType..."<<endl;
|
||||
out << "============================================================================================================" << endl;
|
||||
out << prefix << "Block Block Inline Flow Font Phrase Special Head List Form Pre" << endl;
|
||||
out << prefix << "Element Entity Entity Entity Element Element Element Element Element Element Element" << endl;
|
||||
out << "============================================================================================================" << endl;
|
||||
|
||||
char* answer[]={".","Y"};
|
||||
char startChar=0;
|
||||
for(i=1;i<eHTMLTag_text;++i){
|
||||
const char* tag=nsHTMLTags::GetStringValue((eHTMLTags)i);
|
||||
out << tag;
|
||||
int len=strlen(tag);
|
||||
|
||||
while(len++<15){
|
||||
out<<" ";
|
||||
}
|
||||
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].CanContainType(kBlock)] << suffix ;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].CanContainType(kBlockEntity)] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].CanContainType(kInlineEntity)] << suffix ;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].CanContainType(kFlowEntity)] << suffix ;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].CanContainType(kFontStyle)] << suffix ;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].CanContainType(kPhrase)] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].CanContainType(kSpecial)] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].CanContainType(kHeading)] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].CanContainType(kList)] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].CanContainType(kFormControl)] << suffix;
|
||||
out << answer[gHTMLElements[eHTMLTags(i)].CanContainType(kPreformatted)] << suffix << endl;
|
||||
|
||||
} //for
|
||||
out<<endl<<endl;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -43,16 +43,17 @@
|
|||
#include "nsIExpatSink.h"
|
||||
#include "nsIContentSink.h"
|
||||
#include "nsParserMsgUtils.h"
|
||||
#include "nsSpecialSystemDirectory.h"
|
||||
#include "nsIURL.h"
|
||||
#include "nsIUnicharInputStream.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "prprf.h"
|
||||
#include "prmem.h"
|
||||
#include "nsTextFormatter.h"
|
||||
#include "nsDirectoryServiceDefs.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
static const char* kWhitespace = " \r\n\t"; // Optimized for typical cases
|
||||
static const char* kDTDDirectory = "res/dtd/";
|
||||
static const char kDTDDirectory[] = "res/dtd/";
|
||||
|
||||
/***************************** EXPAT CALL BACKS *******************************/
|
||||
|
||||
|
@ -267,14 +268,29 @@ IsLoadableDTD(const nsCatalogData* aCatalogData, nsCOMPtr<nsIURI>* aDTD)
|
|||
return PR_FALSE;
|
||||
}
|
||||
}
|
||||
nsSpecialSystemDirectory dtdPath(nsSpecialSystemDirectory::OS_CurrentProcessDirectory);
|
||||
dtdPath += PromiseFlatCString(nsDependentCString(kDTDDirectory) + fileName).get();
|
||||
if (dtdPath.Exists()) {
|
||||
|
||||
nsCOMPtr<nsIFile> dtdPath;
|
||||
NS_GetSpecialDirectory(NS_OS_CURRENT_PROCESS_DIR,
|
||||
getter_AddRefs(dtdPath));
|
||||
|
||||
if (!dtdPath)
|
||||
return PR_FALSE;
|
||||
|
||||
nsCOMPtr<nsILocalFile> lfile = do_QueryInterface(dtdPath);
|
||||
|
||||
nsCAutoString path;
|
||||
path = NS_LITERAL_CSTRING(kDTDDirectory) + fileName;
|
||||
lfile->AppendRelativeNativePath(path);
|
||||
|
||||
PRBool exists;
|
||||
dtdPath->Exists(&exists);
|
||||
|
||||
if (exists) {
|
||||
// The DTD was found in the local DTD directory.
|
||||
// Set aDTD to a file: url pointing to the local DTD
|
||||
nsFileURL dtdFile(dtdPath);
|
||||
// Set aDTD to a file: url pointing to the local DT
|
||||
nsCOMPtr<nsIURI> dtdURI;
|
||||
NS_NewURI(getter_AddRefs(dtdURI), dtdFile.GetURLString());
|
||||
NS_NewFileURI(getter_AddRefs(dtdURI), dtdPath);
|
||||
|
||||
if (dtdURI) {
|
||||
*aDTD = dtdURI;
|
||||
isLoadable = PR_TRUE;
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include "nsString.h"
|
||||
#include "nsIDTD.h"
|
||||
#include "nsITokenizer.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsIInputStream.h"
|
||||
|
||||
class nsIExpatSink;
|
||||
struct nsCatalogData;
|
||||
|
|
|
@ -236,21 +236,6 @@ nsresult CStartToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 aFlag
|
|||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
* Dump contents of this token to givne output stream
|
||||
*
|
||||
* @update gess 3/25/98
|
||||
* @param out -- ostream to output content
|
||||
* @return
|
||||
*/
|
||||
void CStartToken::DebugDumpSource(nsOutputStream& out) {
|
||||
out << "<" << NS_LossyConvertUCS2toASCII(mTextValue).get();
|
||||
if(!mAttributed)
|
||||
out << ">";
|
||||
}
|
||||
#endif
|
||||
|
||||
const nsAString& CStartToken::GetStringValue()
|
||||
{
|
||||
if((eHTMLTag_unknown<mTypeID) && (mTypeID<eHTMLTag_text)) {
|
||||
|
@ -409,19 +394,6 @@ PRInt32 CEndToken::GetTokenType(void) {
|
|||
return eToken_end;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
* Dump contents of this token to givne output stream
|
||||
*
|
||||
* @update gess 3/25/98
|
||||
* @param out -- ostream to output content
|
||||
* @return
|
||||
*/
|
||||
void CEndToken::DebugDumpSource(nsOutputStream& out) {
|
||||
out << "</" << NS_LossyConvertUCS2toASCII(mTextValue).get() << ">";
|
||||
}
|
||||
#endif
|
||||
|
||||
const nsAString& CEndToken::GetStringValue()
|
||||
{
|
||||
if((eHTMLTag_unknown<mTypeID) && (mTypeID<eHTMLTag_text)) {
|
||||
|
@ -1496,22 +1468,6 @@ void CAttributeToken::SanitizeKey() {
|
|||
return;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
* Dump contents of this token to given output stream
|
||||
*
|
||||
* @update gess 3/25/98
|
||||
* @param out -- ostream to output content
|
||||
* @return
|
||||
*/
|
||||
void CAttributeToken::DebugDumpToken(nsOutputStream& out) {
|
||||
out << "[" << GetClassName() << "] "
|
||||
<< NS_LossyConvertUCS2toASCII(mTextKey).get() << "="
|
||||
<< NS_LossyConvertUCS2toASCII(mTextValue).get() << ": " << mTypeID
|
||||
<< nsEndl;
|
||||
}
|
||||
#endif
|
||||
|
||||
const nsAString& CAttributeToken::GetStringValue(void)
|
||||
{
|
||||
return mTextValue;
|
||||
|
@ -1837,24 +1793,6 @@ nsresult CAttributeToken::Consume(PRUnichar aChar, nsScanner& aScanner,PRInt32 a
|
|||
return result;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
* Dump contents of this token to givne output stream
|
||||
*
|
||||
* @update gess 3/25/98
|
||||
* @param out -- ostream to output content
|
||||
* @return
|
||||
*/
|
||||
void CAttributeToken::DebugDumpSource(nsOutputStream& out) {
|
||||
out << " " << NS_LossyConvertUCS2toASCII(mTextKey).get();
|
||||
if (!mTextValue.IsEmpty()) {
|
||||
out << "=" << NS_LossyConvertUCS2toASCII(mTextValue).get();
|
||||
}
|
||||
if(mLastAttribute)
|
||||
out << ">";
|
||||
}
|
||||
#endif
|
||||
|
||||
void CAttributeToken::SetKey(const nsAString& aKey)
|
||||
{
|
||||
mTextKey.Rebind(aKey);
|
||||
|
@ -2201,20 +2139,6 @@ PRInt32 CEntityToken::TranslateToUnicodeStr(nsString& aString) {
|
|||
return value;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
/*
|
||||
* Dump contents of this token to givne output stream
|
||||
*
|
||||
* @update gess 3/25/98
|
||||
* @param out -- ostream to output content
|
||||
* @return
|
||||
*/
|
||||
void CEntityToken::DebugDumpSource(nsOutputStream& out) {
|
||||
char* cp = ToNewCString(mTextValue);
|
||||
out << "&" << *cp;
|
||||
delete[] cp;
|
||||
}
|
||||
#endif
|
||||
|
||||
const nsAString& CEntityToken::GetStringValue(void)
|
||||
{
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
#include "nsIEventQueue.h"
|
||||
#include "nsIEventQueueService.h"
|
||||
#include "nsExpatDriver.h"
|
||||
#include "nsIServiceManager.h"
|
||||
//#define rickgdebug
|
||||
|
||||
#define NS_PARSER_FLAG_DTD_VERIFICATION 0x00000001
|
||||
|
@ -1517,8 +1518,7 @@ nsresult nsParser::Parse(nsIURI* aURL,nsIRequestObserver* aListener,PRBool aVeri
|
|||
* @param aStream is the i/o source
|
||||
* @return error code -- 0 if ok, non-zero if error.
|
||||
*/
|
||||
nsresult nsParser::Parse(nsIInputStream& aStream,const nsACString& aMimeType,PRBool aVerifyEnabled, void* aKey,nsDTDMode aMode){
|
||||
|
||||
nsresult nsParser::Parse(nsIInputStream* aStream,const nsACString& aMimeType,PRBool aVerifyEnabled, void* aKey,nsDTDMode aMode){
|
||||
if (aVerifyEnabled) {
|
||||
mFlags |= NS_PARSER_FLAG_DTD_VERIFICATION;
|
||||
}
|
||||
|
@ -1531,9 +1531,9 @@ nsresult nsParser::Parse(nsIInputStream& aStream,const nsACString& aMimeType,PRB
|
|||
//ok, time to create our tokenizer and begin the process
|
||||
nsAutoString theUnknownFilename(NS_LITERAL_STRING("unknown"));
|
||||
|
||||
nsInputStream input(&aStream);
|
||||
// references
|
||||
nsScanner* theScanner=new nsScanner(theUnknownFilename,aStream,mCharset,mCharsetSource);
|
||||
|
||||
nsScanner* theScanner=new nsScanner(theUnknownFilename,input,mCharset,mCharsetSource);
|
||||
CParserContext* pc=new CParserContext(theScanner,aKey,mCommand,0);
|
||||
if(pc && theScanner) {
|
||||
PushContext(*pc);
|
||||
|
@ -2606,23 +2606,6 @@ PRBool nsParser::DidTokenize(PRBool aIsFinalChunk){
|
|||
return result;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
void nsParser::DebugDumpSource(nsOutputStream& aStream) {
|
||||
PRInt32 theIndex=-1;
|
||||
|
||||
nsITokenizer* theTokenizer=0;
|
||||
PRInt32 type = mParserContext && mParserContext->mDTD ?
|
||||
mParserContext->mDTD->GetType() : NS_IPARSER_FLAG_HTML;
|
||||
if(NS_SUCCEEDED(mParserContext->GetTokenizer(type, theTokenizer))){
|
||||
CToken* theToken;
|
||||
while(nsnull != (theToken=theTokenizer->GetTokenAt(++theIndex))) {
|
||||
// theToken->DebugDumpToken(out);
|
||||
theToken->DebugDumpSource(aStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Get the channel associated with this parser
|
||||
* @update harishd,gagan 07/17/01
|
||||
|
|
|
@ -204,7 +204,7 @@ class nsParser : public nsIParser,
|
|||
* @param aStream is the i/o source
|
||||
* @return TRUE if all went well -- FALSE otherwise
|
||||
*/
|
||||
virtual nsresult Parse(nsIInputStream& aStream,const nsACString& aMimeType,PRBool aEnableVerify=PR_FALSE,void* aKey=0,nsDTDMode aMode=eDTDMode_autodetect);
|
||||
virtual nsresult Parse(nsIInputStream* aStream,const nsACString& aMimeType,PRBool aEnableVerify=PR_FALSE,void* aKey=0,nsDTDMode aMode=eDTDMode_autodetect);
|
||||
|
||||
/**
|
||||
* @update gess5/11/98
|
||||
|
@ -273,10 +273,6 @@ class nsParser : public nsIParser,
|
|||
PRBool aIsFinalChunk = PR_FALSE,
|
||||
PRBool aCanInterrupt = PR_TRUE);
|
||||
|
||||
#ifdef DEBUG
|
||||
void DebugDumpSource(nsOutputStream& anOutput);
|
||||
#endif
|
||||
|
||||
//*********************************************
|
||||
// These methods are callback methods used by
|
||||
// net lib to let us know about our inputstream.
|
||||
|
|
|
@ -43,8 +43,10 @@
|
|||
#include "nsIServiceManager.h"
|
||||
#include "nsICharsetConverterManager.h"
|
||||
#include "nsICharsetAlias.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsIInputStream.h"
|
||||
#include "nsILocalFile.h"
|
||||
#include "nsNetUtil.h"
|
||||
|
||||
static NS_DEFINE_CID(kCharsetAliasCID, NS_CHARSETALIAS_CID);
|
||||
|
||||
|
@ -118,8 +120,6 @@ nsScanner::nsScanner(const nsAString& anHTMLString, const nsString& aCharset, PR
|
|||
mSlidingBuffer->BeginReading(mCurrentPosition);
|
||||
mMarkPosition = mCurrentPosition;
|
||||
mIncremental=PR_FALSE;
|
||||
mOwnsStream=PR_FALSE;
|
||||
mInputStream=0;
|
||||
mUnicodeDecoder = 0;
|
||||
mCharsetSource = kCharsetUninitialized;
|
||||
SetDocumentCharset(aCharset, aSource);
|
||||
|
@ -149,10 +149,15 @@ nsScanner::nsScanner(nsString& aFilename,PRBool aCreateStream, const nsString& a
|
|||
mIncremental=PR_TRUE;
|
||||
mCountRemaining = 0;
|
||||
mTotalRead=0;
|
||||
mOwnsStream=aCreateStream;
|
||||
mInputStream=0;
|
||||
|
||||
if(aCreateStream) {
|
||||
mInputStream = new nsInputFileStream(nsFileSpec(aFilename));
|
||||
nsCOMPtr<nsILocalFile> file;
|
||||
nsCOMPtr<nsIInputStream> fileStream;
|
||||
|
||||
NS_NewLocalFile(aFilename, PR_TRUE, getter_AddRefs(file));
|
||||
if (file)
|
||||
NS_NewLocalFileInputStream(getter_AddRefs(mInputStream), file);
|
||||
|
||||
} //if
|
||||
mUnicodeDecoder = 0;
|
||||
mCharsetSource = kCharsetUninitialized;
|
||||
|
@ -168,7 +173,7 @@ nsScanner::nsScanner(nsString& aFilename,PRBool aCreateStream, const nsString& a
|
|||
* @param aFilename --
|
||||
* @return
|
||||
*/
|
||||
nsScanner::nsScanner(const nsAString& aFilename,nsInputStream& aStream,const nsString& aCharset, PRInt32 aSource) :
|
||||
nsScanner::nsScanner(const nsAString& aFilename,nsIInputStream* aStream,const nsString& aCharset, PRInt32 aSource) :
|
||||
mFilename(aFilename)
|
||||
{
|
||||
MOZ_COUNT_CTOR(nsScanner);
|
||||
|
@ -183,8 +188,7 @@ nsScanner::nsScanner(const nsAString& aFilename,nsInputStream& aStream,const nsS
|
|||
mIncremental=PR_FALSE;
|
||||
mCountRemaining = 0;
|
||||
mTotalRead=0;
|
||||
mOwnsStream=PR_FALSE;
|
||||
mInputStream=&aStream;
|
||||
mInputStream=aStream;
|
||||
mUnicodeDecoder = 0;
|
||||
mCharsetSource = kCharsetUninitialized;
|
||||
SetDocumentCharset(aCharset, aSource);
|
||||
|
@ -254,11 +258,10 @@ nsScanner::~nsScanner() {
|
|||
MOZ_COUNT_DTOR(nsScanner);
|
||||
|
||||
if(mInputStream) {
|
||||
mInputStream->close();
|
||||
if(mOwnsStream)
|
||||
delete mInputStream;
|
||||
mInputStream->Close();
|
||||
mInputStream = 0;
|
||||
}
|
||||
mInputStream=0;
|
||||
|
||||
NS_IF_RELEASE(mUnicodeDecoder);
|
||||
}
|
||||
|
||||
|
@ -424,14 +427,13 @@ nsresult nsScanner::FillBuffer(void) {
|
|||
result=kEOF;
|
||||
}
|
||||
else {
|
||||
PRInt32 numread=0;
|
||||
char* buf = new char[kBufsize+1];
|
||||
PRUint32 numread=0;
|
||||
char buf[kBufsize+1];
|
||||
buf[kBufsize]=0;
|
||||
|
||||
if(mInputStream) {
|
||||
numread = mInputStream->read(buf, kBufsize);
|
||||
result = mInputStream->Read(buf, kBufsize, &numread);
|
||||
if (0 == numread) {
|
||||
delete [] buf;
|
||||
return kEOF;
|
||||
}
|
||||
}
|
||||
|
@ -441,7 +443,6 @@ nsresult nsScanner::FillBuffer(void) {
|
|||
PRUnichar* unichars = ToNewUnicode(str);
|
||||
AppendToBuffer(unichars, unichars+numread, unichars+kBufsize+1);
|
||||
}
|
||||
delete [] buf;
|
||||
mTotalRead+=numread;
|
||||
}
|
||||
|
||||
|
|
|
@ -52,12 +52,13 @@
|
|||
#ifndef SCANNER
|
||||
#define SCANNER
|
||||
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIParser.h"
|
||||
#include "prtypes.h"
|
||||
#include "nsIUnicodeDecoder.h"
|
||||
#include "nsFileStream.h"
|
||||
#include "nsSlidingString.h"
|
||||
#include "nsIInputStream.h"
|
||||
|
||||
class nsScannerString : public nsSlidingString {
|
||||
public:
|
||||
|
@ -117,7 +118,7 @@ class nsScanner {
|
|||
* @param aMode represents the parser mode (nav, other)
|
||||
* @return
|
||||
*/
|
||||
nsScanner(const nsAString& aFilename, nsInputStream& aStream, const nsString& aCharset, PRInt32 aSource);
|
||||
nsScanner(const nsAString& aFilename, nsIInputStream* aStream, const nsString& aCharset, PRInt32 aSource);
|
||||
|
||||
|
||||
~nsScanner();
|
||||
|
@ -382,7 +383,7 @@ class nsScanner {
|
|||
PRUnichar* aDataEnd,
|
||||
PRUnichar* aStorageEnd);
|
||||
|
||||
nsInputStream* mInputStream;
|
||||
nsCOMPtr<nsIInputStream> mInputStream;
|
||||
nsScannerString* mSlidingBuffer;
|
||||
nsReadingIterator<PRUnichar> mCurrentPosition; // The position we will next read from in the scanner buffer
|
||||
nsReadingIterator<PRUnichar> mMarkPosition; // The position last marked (we may rewind to here)
|
||||
|
@ -391,7 +392,6 @@ class nsScanner {
|
|||
PRUint32 mCountRemaining; // The number of bytes still to be read
|
||||
// from the scanner buffer
|
||||
PRUint32 mTotalRead;
|
||||
PRPackedBool mOwnsStream;
|
||||
PRPackedBool mIncremental;
|
||||
PRInt32 mCharsetSource;
|
||||
nsString mCharset;
|
||||
|
|
|
@ -111,38 +111,6 @@ nsresult CToken::Consume(PRUnichar aChar,nsScanner& aScanner,PRInt32 aMode) {
|
|||
return result;
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
/**
|
||||
* This debug method causes the token to dump its content
|
||||
* to the given stream (formated for debugging).
|
||||
*
|
||||
* @update gess 3/25/98
|
||||
* @param ostream -- output stream to accept output data
|
||||
*/
|
||||
void CToken::DebugDumpToken(nsOutputStream& anOutputStream) {
|
||||
anOutputStream << "[" << GetClassName() << "] ";
|
||||
PRUint32 i=0;
|
||||
PRUint32 theLen=GetStringValue().Length();
|
||||
for(i=0;i<theLen;++i){
|
||||
anOutputStream << NS_ConvertUCS2toUTF8(GetStringValue()).get();
|
||||
}
|
||||
anOutputStream << " TypeID: " << mTypeID << " AttrCount: " << mAttrCount << nsEndl;
|
||||
}
|
||||
|
||||
/**
|
||||
* This debug method causes the token to dump its content
|
||||
* to the given stream, formated as text.
|
||||
*
|
||||
* @update gess 3/25/98
|
||||
* @param ostream -- output stream to accept output data
|
||||
*/
|
||||
void CToken::DebugDumpSource(nsOutputStream& anOutputStream) {
|
||||
anOutputStream << NS_ConvertUCS2toUTF8(GetStringValue()).get();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Get string of full contents, suitable for debug dump.
|
||||
* It should look exactly like the input source.
|
||||
|
|
|
@ -83,6 +83,8 @@
|
|||
#include "nsIPrefBranch.h"
|
||||
#include "nsUnicharUtils.h"
|
||||
|
||||
#include "nsIServiceManager.h"
|
||||
|
||||
#include "COtherDTD.h"
|
||||
#include "nsElementTable.h"
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "nsIComponentManager.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIFactory.h"
|
||||
#include "nsIGenericFactory.h"
|
||||
#include "nsIModule.h"
|
||||
|
@ -49,7 +50,6 @@
|
|||
#include "nsII18nCompatibility.h"
|
||||
#include "nsI18nCompatibility.h"
|
||||
#include "nsIFile.h"
|
||||
#include "nsFileSpec.h"
|
||||
|
||||
static NS_DEFINE_CID(kComponentManagerCID, NS_COMPONENTMANAGER_CID);
|
||||
static NS_DEFINE_CID(kI18nCompatibilityCID, NS_I18NCOMPATIBILITY_CID);
|
||||
|
|
|
@ -31,10 +31,11 @@ include $(DEPTH)/config/autoconf.mk
|
|||
|
||||
MODULE = ctl
|
||||
LIBRARY_NAME = ctl
|
||||
EXPORT_LIBRARY = 1
|
||||
Expcom_obsolete_LIBRARY = 1
|
||||
IS_COMPONENT = 1
|
||||
|
||||
REQUIRES = xpcom \
|
||||
REQUIRES = xpobsolete \
|
||||
xpcom \
|
||||
string \
|
||||
uconv \
|
||||
locale \
|
||||
|
|
|
@ -38,8 +38,7 @@
|
|||
#include "nsIPlatformCharset.h"
|
||||
#include "nsIOS2Locale.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsFileSpec.h" /* for nsAutoString */
|
||||
|
||||
#include "nsString.h"
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsCollationOS2, nsICollation)
|
||||
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
#include "nsOS2Locale.h"
|
||||
#include "nsLocaleCID.h"
|
||||
#include "prprf.h"
|
||||
#include "nsFileSpec.h"
|
||||
|
||||
NS_DEFINE_IID(kOS2LocaleCID, NS_OS2LOCALE_CID);
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ nsresult nsCollationUnix::GetSortKeyLen(const nsCollationStrength strength,
|
|||
res = mCollation->UnicodeToChar(stringNormalized, &str, mCharset);
|
||||
if (NS_SUCCEEDED(res) && str != NULL) {
|
||||
if (mUseCodePointOrder) {
|
||||
*outLen = nsCRT::strlen(str);
|
||||
*outLen = strlen(str);
|
||||
}
|
||||
else {
|
||||
DoSetLocale();
|
||||
|
@ -239,7 +239,7 @@ nsresult nsCollationUnix::CreateRawSortKey(const nsCollationStrength strength,
|
|||
res = mCollation->UnicodeToChar(stringNormalized, &str, mCharset);
|
||||
if (NS_SUCCEEDED(res) && str != NULL) {
|
||||
if (mUseCodePointOrder) {
|
||||
*outLen = nsCRT::strlen(str);
|
||||
*outLen = strlen(str);
|
||||
memcpy(key, str, *outLen);
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
#include "nsPosixLocale.h"
|
||||
#include "nsLocaleCID.h"
|
||||
#include "prprf.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "plstr.h"
|
||||
|
||||
/* nsPosixLocale ISupports */
|
||||
NS_IMPL_ISUPPORTS1(nsPosixLocale, nsIPosixLocale)
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
|
||||
#include "nsStringBundle.h"
|
||||
#include "nsID.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsString.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsIStringBundle.h"
|
||||
|
@ -80,6 +79,7 @@
|
|||
#include "nsIEventQueueService.h"
|
||||
|
||||
#include "prenv.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
static NS_DEFINE_CID(kErrorServiceCID, NS_ERRORSERVICE_CID);
|
||||
static NS_DEFINE_CID(kPersistentPropertiesCID, NS_IPERSISTENTPROPERTIES_CID);
|
||||
|
|
|
@ -47,12 +47,12 @@
|
|||
#include "nsIComponentRegistrar.h"
|
||||
#include "nsNetCID.h"
|
||||
|
||||
#include "nsString.h"
|
||||
|
||||
#include "nsXPCOM.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIComponentManager.h"
|
||||
//
|
||||
#include "nsIFileSpec.h"
|
||||
|
||||
#define TEST_URL "resource:/res/strres.properties"
|
||||
|
||||
static NS_DEFINE_CID(kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID);
|
||||
|
|
|
@ -28,7 +28,7 @@ include $(DEPTH)/config/autoconf.mk
|
|||
|
||||
MODULE = uconv
|
||||
LIBRARY_NAME = uconv
|
||||
EXPORT_LIBRARY = 1
|
||||
Expcom_obsolete_LIBRARY = 1
|
||||
IS_COMPONENT = 1
|
||||
MODULE_NAME = nsUConvModule
|
||||
GRE_MODULE = 1
|
||||
|
@ -38,6 +38,7 @@ ifneq ($(OS_ARCH),WINNT)
|
|||
SHORT_LIBNAME = mozuconv
|
||||
endif
|
||||
REQUIRES = xpcom \
|
||||
xpcom_obsolete \
|
||||
string \
|
||||
intl \
|
||||
locale \
|
||||
|
|
|
@ -42,7 +42,6 @@
|
|||
#include "nsICharsetConverterManager.h"
|
||||
#include "nsIStringBundle.h"
|
||||
#include "nsISupportsArray.h"
|
||||
#include "nsIRegistry.h"
|
||||
|
||||
class nsCharsetConverterManager : public nsICharsetConverterManager,
|
||||
public nsICharsetConverterManager2
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCRT.h"
|
||||
#include "nsIModule.h"
|
||||
#include "nsIGenericFactory.h"
|
||||
#include "nsIComponentManager.h"
|
||||
|
@ -53,7 +54,6 @@
|
|||
#include "nsITextToSubURI.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsUConvDll.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsIFile.h"
|
||||
#include "nsIScriptableUConv.h"
|
||||
#include "nsConverterInputStream.h"
|
||||
|
|
|
@ -28,12 +28,13 @@ include $(DEPTH)/config/autoconf.mk
|
|||
|
||||
MODULE = ucvmath
|
||||
LIBRARY_NAME = ucvmath
|
||||
EXPORT_LIBRARY = 1
|
||||
Expcom_obsolete_LIBRARY = 1
|
||||
IS_COMPONENT = 1
|
||||
MODULE_NAME = nsUCvMathModule
|
||||
GRE_MODULE = 1
|
||||
|
||||
REQUIRES = xpcom \
|
||||
xpcom_obsolete \
|
||||
string \
|
||||
uconv \
|
||||
$(NULL)
|
||||
|
|
|
@ -47,7 +47,6 @@
|
|||
#include "nsEntityConverter.h"
|
||||
#include "nsSaveAsCharset.h"
|
||||
#include "nsUUDll.h"
|
||||
#include "nsFileSpec.h"
|
||||
#include "nsIFile.h"
|
||||
#include "nsUnicodeNormalizer.h"
|
||||
|
||||
|
|
|
@ -38,7 +38,13 @@ VPATH = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS = public idl loader src shell
|
||||
DIRS = public idl
|
||||
|
||||
ifdef MOZ_JSLOADER
|
||||
DIRS += loader
|
||||
endif
|
||||
|
||||
DIRS += src shell
|
||||
|
||||
ifdef ENABLE_TESTS
|
||||
DIRS += tests
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "nsIXPConnect.h"
|
||||
#include "nsIModule.h"
|
||||
#include "nsSupportsArray.h"
|
||||
#include "nsIFileSpec.h"
|
||||
#include "nsIFile.h"
|
||||
#ifndef XPCONNECT_STANDALONE
|
||||
#include "nsIPrincipal.h"
|
||||
|
|
|
@ -73,8 +73,6 @@
|
|||
#include "jsarena.h"
|
||||
#include "jscntxt.h"
|
||||
|
||||
#include "nsSpecialSystemDirectory.h" // For exe dir
|
||||
|
||||
#include "nsIJSContextStack.h"
|
||||
|
||||
/***************************************************************************/
|
||||
|
@ -196,7 +194,7 @@ Dump(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||
return JS_FALSE;
|
||||
|
||||
char *bytes = JS_GetStringBytes(str);
|
||||
bytes = nsCRT::strdup(bytes);
|
||||
bytes = strdup(bytes);
|
||||
|
||||
#ifdef XP_MAC
|
||||
for (char *c = bytes; *c; c++)
|
||||
|
|
|
@ -110,9 +110,11 @@ EXTRA_DSO_LDOPTS += \
|
|||
$(MOZ_JS_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_JSLOADER
|
||||
SHARED_LIBRARY_LIBS = \
|
||||
$(DIST)/lib/$(LIB_PREFIX)jsloader_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
|
|
|
@ -36,8 +36,9 @@
|
|||
/* Module level methods. */
|
||||
|
||||
#include "xpcprivate.h"
|
||||
|
||||
#ifdef MOZ_JSLOADER
|
||||
#include "mozJSLoaderConstructors.h"
|
||||
#endif
|
||||
|
||||
/* Module implementation for the xpconnect library. */
|
||||
|
||||
|
@ -83,6 +84,7 @@ static const nsModuleComponentInfo components[] = {
|
|||
{nsnull, SCRIPTABLE_INTERFACES_CID, NS_SCRIPTABLE_INTERFACES_CONTRACTID, nsXPCComponents_InterfacesConstructor },
|
||||
{nsnull, XPCVARIANT_CID, XPCVARIANT_CONTRACTID, nsnull, nsnull, nsnull, nsnull, NS_CI_INTERFACE_GETTER_NAME(XPCVariant), nsnull, &NS_CLASSINFO_NAME(XPCVariant)},
|
||||
|
||||
#ifdef MOZ_JSLOADER
|
||||
// jsloader stuff
|
||||
{ "JS component loader", MOZJSCOMPONENTLOADER_CID,
|
||||
mozJSComponentLoaderContractID, mozJSComponentLoaderConstructor,
|
||||
|
@ -91,6 +93,7 @@ static const nsModuleComponentInfo components[] = {
|
|||
,{ "JS subscript loader", MOZ_JSSUBSCRIPTLOADER_CID,
|
||||
mozJSSubScriptLoadContractID, mozJSSubScriptLoaderConstructor }
|
||||
#endif
|
||||
#endif
|
||||
#ifdef XPC_IDISPATCH_SUPPORT
|
||||
,{ nsnull, NS_IDISPATCH_SUPPORT_CID, NS_IDISPATCH_SUPPORT_CONTRACTID,
|
||||
nsIDispatchSupportConstructor }
|
||||
|
|
|
@ -115,6 +115,8 @@
|
|||
#include "nsISelectElement.h"
|
||||
#include "nsLayoutErrors.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsScrollPortFrame.h"
|
||||
#include "nsXULAtoms.h"
|
||||
|
||||
static NS_DEFINE_CID(kTextNodeCID, NS_TEXTNODE_CID);
|
||||
static NS_DEFINE_CID(kHTMLElementFactoryCID, NS_HTML_ELEMENT_FACTORY_CID);
|
||||
|
@ -5274,9 +5276,9 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsIPresShell* aPresShell
|
|||
aTag != nsHTMLAtoms::input &&
|
||||
aTag != nsHTMLAtoms::textarea &&
|
||||
aTag != nsHTMLAtoms::combobox &&
|
||||
aTag != nsHTMLAtoms::isindex &&
|
||||
aTag != nsHTMLAtoms::isindex
|
||||
#ifdef INCLUDE_XUL
|
||||
aTag != nsXULAtoms::scrollbar
|
||||
&& aTag != nsXULAtoms::scrollbar
|
||||
#endif
|
||||
)
|
||||
return NS_OK;
|
||||
|
|
|
@ -45,6 +45,7 @@ REQUIRES = xpcom \
|
|||
content \
|
||||
gfx \
|
||||
widget \
|
||||
view \
|
||||
locale \
|
||||
necko \
|
||||
dom \
|
||||
|
@ -87,9 +88,7 @@ SHARED_LIBRARY_LIBS = \
|
|||
$(DIST)/lib/$(LIB_PREFIX)gkhtmltable_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkxulbase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkbase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconshared_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkxultree_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkxulgrid_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconbase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconevents_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconhtmlcon_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconhtmldoc_s.$(LIB_SUFFIX) \
|
||||
|
@ -97,13 +96,21 @@ SHARED_LIBRARY_LIBS = \
|
|||
$(DIST)/lib/$(LIB_PREFIX)gkconxmlcon_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconxmldoc_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconxsldoc_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconxulcon_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconxuldoc_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconxultmpl_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconxbl_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconbase_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconxuldoc_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconshared_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkview_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
|
||||
ifdef MOZ_XUL
|
||||
SHARED_LIBRARY_LIBS += \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkxultree_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkxulgrid_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconxulcon_s.$(LIB_SUFFIX) \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkconxultmpl_s.$(LIB_SUFFIX) \
|
||||
$(NULL)
|
||||
endif
|
||||
|
||||
ifdef MOZ_MATHML
|
||||
SHARED_LIBRARY_LIBS += \
|
||||
$(DIST)/lib/$(LIB_PREFIX)gkmathmlcon_s.$(LIB_SUFFIX) \
|
||||
|
@ -156,6 +163,7 @@ INCLUDES += -I$(srcdir)/../base/src \
|
|||
-I$(srcdir)/../../content/xul/content/src \
|
||||
-I$(srcdir)/../../content/xul/templates/src \
|
||||
-I$(srcdir)/../../content/events/src \
|
||||
-I$(topsrcdir)/view/src \
|
||||
-I. \
|
||||
$(NULL)
|
||||
|
||||
|
|
|
@ -128,6 +128,15 @@
|
|||
#include "nsIAutoCopy.h"
|
||||
#include "nsIPrintPreviewContext.h"
|
||||
#include "nsCSSLoader.h"
|
||||
#include "nsXULAtoms.h"
|
||||
#include "nsLayoutCID.h"
|
||||
|
||||
// view stuff
|
||||
#include "nsViewsCID.h"
|
||||
#include "nsView.h"
|
||||
#include "nsScrollingView.h"
|
||||
#include "nsScrollPortView.h"
|
||||
#include "nsViewManager.h"
|
||||
|
||||
class nsIDocumentLoaderFactory;
|
||||
|
||||
|
@ -148,7 +157,6 @@ class nsIDocumentLoaderFactory;
|
|||
#include "nsIXULPrototypeDocument.h"
|
||||
#include "nsIXULPrototypeDocument.h"
|
||||
#include "nsIXULSortService.h"
|
||||
#include "nsXULAtoms.h"
|
||||
#include "nsXULContentUtils.h"
|
||||
#include "nsXULElement.h"
|
||||
|
||||
|
@ -220,9 +228,9 @@ Initialize(nsIModule* aSelf)
|
|||
nsHTMLAtoms::AddRefAtoms();
|
||||
nsXBLAtoms::AddRefAtoms();
|
||||
nsLayoutAtoms::AddRefAtoms();
|
||||
nsXULAtoms::AddRefAtoms();
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
nsXULAtoms::AddRefAtoms();
|
||||
nsXULContentUtils::Init();
|
||||
#endif
|
||||
|
||||
|
@ -283,16 +291,17 @@ Shutdown(nsIModule* aSelf)
|
|||
nsXBLAtoms::ReleaseAtoms();
|
||||
nsLayoutAtoms::ReleaseAtoms();
|
||||
|
||||
nsXULAtoms::ReleaseAtoms();
|
||||
nsRepeatService::Shutdown();
|
||||
nsStackLayout::Shutdown();
|
||||
nsBox::Shutdown();
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
nsXULContentUtils::Finish();
|
||||
nsXULAtoms::ReleaseAtoms();
|
||||
nsXULElement::ReleaseGlobals();
|
||||
nsXULPrototypeElement::ReleaseGlobals();
|
||||
nsXULPrototypeScript::ReleaseGlobals();
|
||||
nsRepeatService::Shutdown();
|
||||
nsSprocketLayout::Shutdown();
|
||||
nsStackLayout::Shutdown();
|
||||
nsBox::Shutdown();
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_MATHML
|
||||
|
@ -360,6 +369,35 @@ nsresult NS_NewFrameLoader(nsIFrameLoader** aResult);
|
|||
nsresult NS_NewSyncLoadDOMService(nsISyncLoadDOMService** aResult);
|
||||
nsresult NS_NewDOMEventGroup(nsIDOMEventGroup** aResult);
|
||||
|
||||
extern nsresult NS_CreateFrameTraversal(nsIFrameTraversal** aResult);
|
||||
extern nsresult NS_CreateCSSFrameConstructor(nsICSSFrameConstructor** aResult);
|
||||
extern nsresult NS_NewLayoutHistoryState(nsILayoutHistoryState** aResult);
|
||||
extern nsresult NS_NewAutoCopyService(nsIAutoCopyService** aResult);
|
||||
extern nsresult NS_NewSelectionImageService(nsISelectionImageService** aResult);
|
||||
|
||||
extern nsresult NS_NewSelection(nsIFrameSelection** aResult);
|
||||
extern nsresult NS_NewDomSelection(nsISelection** aResult);
|
||||
extern nsresult NS_NewDocumentViewer(nsIDocumentViewer** aResult);
|
||||
extern nsresult NS_NewRange(nsIDOMRange** aResult);
|
||||
extern nsresult NS_NewRangeUtils(nsIRangeUtils** aResult);
|
||||
extern nsresult NS_NewContentIterator(nsIContentIterator** aResult);
|
||||
extern nsresult NS_NewPreContentIterator(nsIContentIterator** aResult);
|
||||
extern nsresult NS_NewGenRegularIterator(nsIContentIterator** aResult);
|
||||
extern nsresult NS_NewContentSubtreeIterator(nsIContentIterator** aResult);
|
||||
extern nsresult NS_NewGenSubtreeIterator(nsIContentIterator** aInstancePtrResult);
|
||||
extern nsresult NS_NewContentDocumentLoaderFactory(nsIDocumentLoaderFactory** aResult);
|
||||
extern nsresult NS_NewHTMLElementFactory(nsIElementFactory** aResult);
|
||||
extern nsresult NS_NewXMLElementFactory(nsIElementFactory** aResult);
|
||||
extern nsresult NS_NewHTMLCopyTextEncoder(nsIDocumentEncoder** aResult);
|
||||
extern nsresult NS_NewTextEncoder(nsIDocumentEncoder** aResult);
|
||||
extern nsresult NS_NewXBLService(nsIXBLService** aResult);
|
||||
extern nsresult NS_NewBindingManager(nsIBindingManager** aResult);
|
||||
extern nsresult NS_NewNodeInfoManager(nsINodeInfoManager** aResult);
|
||||
extern nsresult NS_NewContentPolicy(nsIContentPolicy** aResult);
|
||||
extern nsresult NS_NewFrameLoader(nsIFrameLoader** aResult);
|
||||
extern nsresult NS_NewSyncLoadDOMService(nsISyncLoadDOMService** aResult);
|
||||
extern nsresult NS_NewDOMEventGroup(nsIDOMEventGroup** aResult);
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
nsresult NS_NewXULElementFactory(nsIElementFactory** aResult);
|
||||
NS_IMETHODIMP NS_NewXULControllers(nsISupports* aOuter, REFNSIID aIID, void** aResult);
|
||||
|
@ -402,6 +440,7 @@ MAKE_CTOR(CreateNewPresState, nsIPresState, NS_NewPresState)
|
|||
MAKE_CTOR(CreateNewGalleyContext, nsIPresContext, NS_NewGalleyContext)
|
||||
MAKE_CTOR(CreateNewPrintContext, nsIPrintContext, NS_NewPrintContext)
|
||||
MAKE_CTOR(CreateNewPrintPreviewContext, nsIPrintPreviewContext, NS_NewPrintPreviewContext)
|
||||
#ifdef MOZ_XUL
|
||||
MAKE_CTOR(CreateNewBoxObject, nsIBoxObject, NS_NewBoxObject)
|
||||
MAKE_CTOR(CreateNewListBoxObject, nsIBoxObject, NS_NewListBoxObject)
|
||||
MAKE_CTOR(CreateNewMenuBoxObject, nsIBoxObject, NS_NewMenuBoxObject)
|
||||
|
@ -411,6 +450,7 @@ MAKE_CTOR(CreateNewEditorBoxObject, nsIBoxObject, NS_NewEditorBoxO
|
|||
MAKE_CTOR(CreateNewIFrameBoxObject, nsIBoxObject, NS_NewIFrameBoxObject)
|
||||
MAKE_CTOR(CreateNewScrollBoxObject, nsIBoxObject, NS_NewScrollBoxObject)
|
||||
MAKE_CTOR(CreateNewTreeBoxObject, nsIBoxObject, NS_NewTreeBoxObject)
|
||||
#endif
|
||||
MAKE_CTOR(CreateNewAutoCopyService, nsIAutoCopyService, NS_NewAutoCopyService)
|
||||
MAKE_CTOR(CreateSelectionImageService, nsISelectionImageService,NS_NewSelectionImageService)
|
||||
MAKE_CTOR(CreateCaret, nsICaret, NS_NewCaret)
|
||||
|
@ -489,6 +529,38 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsWyciwygProtocolHandler)
|
|||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsContentAreaDragDrop)
|
||||
MAKE_CTOR(CreateSyncLoadDOMService, nsISyncLoadDOMService, NS_NewSyncLoadDOMService)
|
||||
|
||||
// views are not refcounted, so this is the same as
|
||||
// NS_GENERIC_FACTORY_CONSTRUCTOR without the NS_ADDREF/NS_RELEASE
|
||||
#define NS_GENERIC_FACTORY_CONSTRUCTOR_NOREFS(_InstanceClass) \
|
||||
static NS_IMETHODIMP \
|
||||
_InstanceClass##Constructor(nsISupports *aOuter, REFNSIID aIID, \
|
||||
void **aResult) \
|
||||
{ \
|
||||
nsresult rv; \
|
||||
\
|
||||
_InstanceClass * inst; \
|
||||
\
|
||||
*aResult = NULL; \
|
||||
if (NULL != aOuter) { \
|
||||
rv = NS_ERROR_NO_AGGREGATION; \
|
||||
return rv; \
|
||||
} \
|
||||
\
|
||||
NS_NEWXPCOM(inst, _InstanceClass); \
|
||||
if (NULL == inst) { \
|
||||
rv = NS_ERROR_OUT_OF_MEMORY; \
|
||||
return rv; \
|
||||
} \
|
||||
rv = inst->QueryInterface(aIID, aResult); \
|
||||
\
|
||||
return rv; \
|
||||
} \
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsViewManager)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_NOREFS(nsView)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_NOREFS(nsScrollingView)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_NOREFS(nsScrollPortView)
|
||||
|
||||
static NS_IMETHODIMP
|
||||
CreateHTMLImgElement(nsISupports* aOuter, REFNSIID aIID, void** aResult)
|
||||
{
|
||||
|
@ -654,6 +726,7 @@ static const nsModuleComponentInfo gComponents[] = {
|
|||
CreateNewPrintPreviewContext },
|
||||
// XXX end ick
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
{ "XUL Box Object",
|
||||
NS_BOXOBJECT_CID,
|
||||
"@mozilla.org/layout/xul-boxobject;1",
|
||||
|
@ -698,6 +771,7 @@ static const nsModuleComponentInfo gComponents[] = {
|
|||
NS_TREEBOXOBJECT_CID,
|
||||
"@mozilla.org/layout/xul-boxobject-tree;1",
|
||||
CreateNewTreeBoxObject },
|
||||
#endif
|
||||
|
||||
{ "AutoCopy Service",
|
||||
NS_AUTOCOPYSERVICE_CID,
|
||||
|
@ -1015,6 +1089,11 @@ static const nsModuleComponentInfo gComponents[] = {
|
|||
"@mozilla.org/DOM/Level2/CSS/computedStyleDeclaration;1",
|
||||
CreateComputedDOMStyle },
|
||||
|
||||
{ "XUL Controllers",
|
||||
NS_XULCONTROLLERS_CID,
|
||||
"@mozilla.org/xul/xul-controllers;1",
|
||||
NS_NewXULControllers },
|
||||
|
||||
#ifdef MOZ_XUL
|
||||
{ "XUL Sort Service",
|
||||
NS_XULSORTSERVICE_CID,
|
||||
|
@ -1046,11 +1125,6 @@ static const nsModuleComponentInfo gComponents[] = {
|
|||
"@mozilla.org/xul/xul-popup-listener;1",
|
||||
CreateXULPopupListener },
|
||||
|
||||
{ "XUL Controllers",
|
||||
NS_XULCONTROLLERS_CID,
|
||||
"@mozilla.org/xul/xul-controllers;1",
|
||||
NS_NewXULControllers },
|
||||
|
||||
{ "XUL Prototype Cache",
|
||||
NS_XULPROTOTYPECACHE_CID,
|
||||
"@mozilla.org/xul/xul-prototype-cache;1",
|
||||
|
@ -1065,6 +1139,11 @@ static const nsModuleComponentInfo gComponents[] = {
|
|||
NS_XULELEMENTFACTORY_CID,
|
||||
NS_ELEMENT_FACTORY_CONTRACTID_PREFIX "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
|
||||
CreateXULElementFactory },
|
||||
#else
|
||||
{ "XML Element Factory",
|
||||
NS_XULELEMENTFACTORY_CID,
|
||||
NS_ELEMENT_FACTORY_CONTRACTID_PREFIX "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
|
||||
CreateXMLElementFactory },
|
||||
#endif
|
||||
|
||||
#ifdef MOZ_MATHML
|
||||
|
@ -1113,8 +1192,16 @@ static const nsModuleComponentInfo gComponents[] = {
|
|||
{ "SyncLoad DOM Service",
|
||||
NS_SYNCLOADDOMSERVICE_CID,
|
||||
NS_SYNCLOADDOMSERVICE_CONTRACTID,
|
||||
CreateSyncLoadDOMService }
|
||||
CreateSyncLoadDOMService },
|
||||
|
||||
// view stuff
|
||||
{ "View Manager", NS_VIEW_MANAGER_CID, "@mozilla.org/view-manager;1",
|
||||
nsViewManagerConstructor },
|
||||
{ "View", NS_VIEW_CID, "@mozilla.org/view;1", nsViewConstructor },
|
||||
{ "Scrolling View", NS_SCROLLING_VIEW_CID, "@mozilla.org/scrolling-view;1",
|
||||
nsScrollingViewConstructor },
|
||||
{ "Scroll Port View", NS_SCROLL_PORT_VIEW_CID,
|
||||
"@mozilla.org/scroll-port-view;1", nsScrollPortViewConstructor }
|
||||
};
|
||||
|
||||
NS_IMPL_NSGETMODULE_WITH_CTOR_DTOR(nsLayoutModule, gComponents, Initialize, Shutdown)
|
||||
|
|
|
@ -115,6 +115,8 @@
|
|||
#include "nsISelectElement.h"
|
||||
#include "nsLayoutErrors.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsScrollPortFrame.h"
|
||||
#include "nsXULAtoms.h"
|
||||
|
||||
static NS_DEFINE_CID(kTextNodeCID, NS_TEXTNODE_CID);
|
||||
static NS_DEFINE_CID(kHTMLElementFactoryCID, NS_HTML_ELEMENT_FACTORY_CID);
|
||||
|
@ -5274,9 +5276,9 @@ nsCSSFrameConstructor::CreateAnonymousFrames(nsIPresShell* aPresShell
|
|||
aTag != nsHTMLAtoms::input &&
|
||||
aTag != nsHTMLAtoms::textarea &&
|
||||
aTag != nsHTMLAtoms::combobox &&
|
||||
aTag != nsHTMLAtoms::isindex &&
|
||||
aTag != nsHTMLAtoms::isindex
|
||||
#ifdef INCLUDE_XUL
|
||||
aTag != nsXULAtoms::scrollbar
|
||||
&& aTag != nsXULAtoms::scrollbar
|
||||
#endif
|
||||
)
|
||||
return NS_OK;
|
||||
|
|
|
@ -33,6 +33,7 @@ EXPORT_LIBRARY = 1
|
|||
IS_COMPONENT = 1
|
||||
MODULE_NAME = nsAbModule
|
||||
REQUIRES = xpcom \
|
||||
xpcom_obsolete \
|
||||
string \
|
||||
necko \
|
||||
mime \
|
||||
|
@ -78,6 +79,7 @@ EXTRA_DSO_LDOPTS = \
|
|||
$(EXTRA_DSO_LIBS) \
|
||||
$(MOZ_UNICHARUTIL_LIBS) \
|
||||
$(MOZ_COMPONENT_LIBS) \
|
||||
$(MOZ_XPCOM_OBSOLETE_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -30,6 +30,7 @@ MODULE = addrbook
|
|||
LIBRARY_NAME = addrbook_s
|
||||
META_COMPONENT = mail
|
||||
REQUIRES = xpcom \
|
||||
xpcom_obsolete \
|
||||
string \
|
||||
rdf \
|
||||
rdfutil \
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
#include "nsRDFCID.h"
|
||||
#include "nsIRDFNode.h"
|
||||
#include "nsEnumeratorUtils.h"
|
||||
#include "nsAdapterEnumerator.h"
|
||||
#include "nsIObserverService.h"
|
||||
|
||||
#include "nsString.h"
|
||||
|
|
|
@ -33,10 +33,12 @@ LIBRARY_NAME = msgbase
|
|||
RESFILE = mail.res
|
||||
endif
|
||||
META_COMPONENT = mail
|
||||
EXPORT_LIBRARY = 1
|
||||
Expcom_obsolete_LIBRARY = 1
|
||||
IS_COMPONENT = 1
|
||||
MODULE_NAME = nsMsgBaseModule
|
||||
REQUIRES = xpcom \
|
||||
xpcom_obsolete \
|
||||
xpobsolete \
|
||||
string \
|
||||
necko \
|
||||
intl \
|
||||
|
@ -87,6 +89,7 @@ EXTRA_DSO_LDOPTS = \
|
|||
$(MOZ_JS_LIBS) \
|
||||
$(MOZ_UNICHARUTIL_LIBS) \
|
||||
$(MOZ_COMPONENT_LIBS) \
|
||||
$(MOZ_XPCOM_OBSOLETE_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
LOCAL_INCLUDES = -I$(srcdir) -I$(srcdir)/../src
|
||||
|
|
|
@ -31,6 +31,7 @@ XPIDL_MODULE = msgsearch
|
|||
LIBRARY_NAME = msgsearch_s
|
||||
META_COMPONENT = mail
|
||||
REQUIRES = xpcom \
|
||||
xpcom_obsolete \
|
||||
string \
|
||||
mailnews \
|
||||
msgdb \
|
||||
|
|
|
@ -30,6 +30,7 @@ MODULE = msgbase
|
|||
LIBRARY_NAME = msgbase_s
|
||||
META_COMPONENT = mail
|
||||
REQUIRES = xpcom \
|
||||
xpcom_obsolete \
|
||||
string \
|
||||
necko \
|
||||
dom \
|
||||
|
|
|
@ -49,6 +49,7 @@
|
|||
#include "nsRDFCID.h"
|
||||
#include "nsIRDFNode.h"
|
||||
#include "nsEnumeratorUtils.h"
|
||||
#include "nsAdapterEnumerator.h"
|
||||
|
||||
#include "nsString.h"
|
||||
#include "nsCOMPtr.h"
|
||||
|
|
|
@ -32,6 +32,7 @@ META_COMPONENT = mail
|
|||
EXPORT_LIBRARY = 1
|
||||
SHORT_LIBNAME = msgbsutl
|
||||
REQUIRES = xpcom \
|
||||
xpcom_obsolete \
|
||||
string \
|
||||
msgbase \
|
||||
rdf \
|
||||
|
@ -80,6 +81,7 @@ CPPSRCS = \
|
|||
nsMsgTxn.cpp \
|
||||
nsMsgI18N.cpp \
|
||||
nsMsgUtf7Utils.cpp \
|
||||
nsAdapterEnumerator.cpp \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
|
@ -101,6 +103,7 @@ EXPORTS = \
|
|||
nsMsgTxn.h \
|
||||
nsMsgI18N.h \
|
||||
nsMsgUtf7Utils.h \
|
||||
nsAdapterEnumerator.h \
|
||||
$(NULL)
|
||||
|
||||
EXTRA_DSO_LDOPTS = \
|
||||
|
@ -108,6 +111,7 @@ EXTRA_DSO_LDOPTS = \
|
|||
$(DIST)/lib/$(LIB_PREFIX)rdfutil_s.$(LIB_SUFFIX) \
|
||||
$(MOZ_UNICHARUTIL_LIBS) \
|
||||
$(MOZ_COMPONENT_LIBS) \
|
||||
$(MOZ_XPCOM_OBSOLETE_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
DEFINES += -D_IMPL_NS_MSG_BASE
|
||||
|
|
|
@ -37,6 +37,7 @@ ifeq ($(OS_ARCH),WINNT)
|
|||
XPIDL_MODULE = msgcompo
|
||||
endif
|
||||
REQUIRES = xpcom \
|
||||
xpcom_obsolete \
|
||||
string \
|
||||
msgbase \
|
||||
msgbaseutil \
|
||||
|
@ -75,6 +76,7 @@ EXTRA_DSO_LDOPTS = \
|
|||
$(MOZ_JS_LIBS) \
|
||||
$(MOZ_UNICHARUTIL_LIBS) \
|
||||
$(MOZ_COMPONENT_LIBS) \
|
||||
$(MOZ_XPCOM_OBSOLETE_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -30,6 +30,7 @@ MODULE = msgcompose
|
|||
LIBRARY_NAME = msgcompose_s
|
||||
META_COMPONENT = mail
|
||||
REQUIRES = xpcom \
|
||||
xpcom_obsolete \
|
||||
string \
|
||||
dom \
|
||||
editor \
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include "nsMsgCompCID.h"
|
||||
#include "nsIChannel.h"
|
||||
#include "nsIURI.h"
|
||||
#include "nsCRT.h"
|
||||
|
||||
static NS_DEFINE_CID(kMsgComposeServiceCID, NS_MSGCOMPOSESERVICE_CID);
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ EXPORT_LIBRARY = 1
|
|||
IS_COMPONENT = 1
|
||||
MODULE_NAME = nsMsgDBModule
|
||||
REQUIRES = xpcom \
|
||||
xpcom_obsolete \
|
||||
string \
|
||||
mailnews \
|
||||
locale \
|
||||
|
@ -58,6 +59,7 @@ EXTRA_DSO_LDOPTS = \
|
|||
$(LIBS_DIR) \
|
||||
$(EXTRA_DSO_LIBS) \
|
||||
$(MOZ_COMPONENT_LIBS) \
|
||||
$(MOZ_XPCOM_OBSOLETE_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -30,6 +30,7 @@ MODULE = msgdb
|
|||
LIBRARY_NAME = msgdb_s
|
||||
META_COMPONENT = mail
|
||||
REQUIRES = xpcom \
|
||||
xpcom_obsolete \
|
||||
string \
|
||||
mailnews \
|
||||
mork \
|
||||
|
|
|
@ -61,6 +61,7 @@ EXTRA_DSO_LDOPTS = \
|
|||
$(EXTRA_DSO_LIBS) \
|
||||
$(MOZ_JS_LIBS) \
|
||||
$(MOZ_COMPONENT_LIBS) \
|
||||
$(MOZ_XPCOM_OBSOLETE_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -30,6 +30,7 @@ MODULE = mailview
|
|||
LIBRARY_NAME = mailview_s
|
||||
META_COMPONENT = mail
|
||||
REQUIRES = xpcom \
|
||||
xpcom_obsolete \
|
||||
string \
|
||||
msgbase \
|
||||
mailnews \
|
||||
|
|
|
@ -34,6 +34,7 @@ SHORT_LIBNAME = msgmdn
|
|||
IS_COMPONENT = 1
|
||||
MODULE_NAME = nsMsgMdnModule
|
||||
REQUIRES = xpcom \
|
||||
xpcom_obsolete \
|
||||
string \
|
||||
mailnews \
|
||||
mime \
|
||||
|
@ -61,6 +62,7 @@ EXTRA_DSO_LDOPTS = \
|
|||
$(EXTRA_DSO_LIBS) \
|
||||
$(MOZ_JS_LIBS) \
|
||||
$(MOZ_COMPONENT_LIBS) \
|
||||
$(MOZ_XPCOM_OBSOLETE_LIBS) \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче