Bug 589506 - Scrub the codebase of MOZ_VIEW_SOURCE and MOZ_JSLOADER. r+=ted

This commit is contained in:
Justin Wood 2010-08-24 23:27:34 -04:00
parent c44dfdd819
commit bd3654e3bd
12 changed files with 6 additions and 79 deletions

View File

@ -128,8 +128,6 @@ ENABLE_TESTS = @ENABLE_TESTS@
IBMBIDI = @IBMBIDI@ IBMBIDI = @IBMBIDI@
MOZ_UNIVERSALCHARDET = @MOZ_UNIVERSALCHARDET@ MOZ_UNIVERSALCHARDET = @MOZ_UNIVERSALCHARDET@
ACCESSIBILITY = @ACCESSIBILITY@ ACCESSIBILITY = @ACCESSIBILITY@
MOZ_VIEW_SOURCE = @MOZ_VIEW_SOURCE@
MOZ_JSLOADER = @MOZ_JSLOADER@
MOZ_USE_NATIVE_UCONV = @MOZ_USE_NATIVE_UCONV@ MOZ_USE_NATIVE_UCONV = @MOZ_USE_NATIVE_UCONV@
MOZ_BRANDING_DIRECTORY = @MOZ_BRANDING_DIRECTORY@ MOZ_BRANDING_DIRECTORY = @MOZ_BRANDING_DIRECTORY@
XPCOM_USE_LEA = @XPCOM_USE_LEA@ XPCOM_USE_LEA = @XPCOM_USE_LEA@

View File

@ -4964,7 +4964,6 @@ MOZ_INSTALLER=1
MOZ_IPC=1 MOZ_IPC=1
MOZ_JAVAXPCOM= MOZ_JAVAXPCOM=
MOZ_JSDEBUGGER=1 MOZ_JSDEBUGGER=1
MOZ_JSLOADER=1
MOZ_MATHML=1 MOZ_MATHML=1
MOZ_MORK= MOZ_MORK=
MOZ_MORKREADER=1 MOZ_MORKREADER=1
@ -5010,7 +5009,6 @@ MOZ_UI_LOCALE=en-US
MOZ_UNIVERSALCHARDET=1 MOZ_UNIVERSALCHARDET=1
MOZ_URL_CLASSIFIER= MOZ_URL_CLASSIFIER=
MOZ_USE_NATIVE_UCONV= MOZ_USE_NATIVE_UCONV=
MOZ_VIEW_SOURCE=1
MOZ_XSLT_STANDALONE= MOZ_XSLT_STANDALONE=
MOZ_XTF=1 MOZ_XTF=1
MOZ_XUL=1 MOZ_XUL=1
@ -5859,13 +5857,6 @@ dnl bi-directional support always on
IBMBIDI=1 IBMBIDI=1
AC_DEFINE(IBMBIDI) AC_DEFINE(IBMBIDI)
dnl ========================================================
dnl view source support on by default
dnl ========================================================
if test "$MOZ_VIEW_SOURCE"; then
AC_DEFINE(MOZ_VIEW_SOURCE)
fi
dnl ======================================================== dnl ========================================================
dnl accessibility support on by default on all platforms dnl accessibility support on by default on all platforms
dnl except OS X. dnl except OS X.
@ -5891,13 +5882,6 @@ case "$target" in
esac esac
fi fi
dnl ========================================================
dnl xpcom js loader support on by default
dnl ========================================================
if test "$MOZ_JSLOADER"; then
AC_DEFINE(MOZ_JSLOADER)
fi
dnl ======================================================== dnl ========================================================
dnl Disable printing dnl Disable printing
dnl ======================================================== dnl ========================================================
@ -9005,7 +8989,6 @@ AC_SUBST(MOZ_SHARK)
AC_SUBST(MOZ_CALLGRIND) AC_SUBST(MOZ_CALLGRIND)
AC_SUBST(MOZ_VTUNE) AC_SUBST(MOZ_VTUNE)
AC_SUBST(MOZ_PROFILING) AC_SUBST(MOZ_PROFILING)
AC_SUBST(MOZ_JSLOADER)
AC_SUBST(MOZ_USE_NATIVE_UCONV) AC_SUBST(MOZ_USE_NATIVE_UCONV)
AC_SUBST(MOZ_QUANTIFY) AC_SUBST(MOZ_QUANTIFY)
AC_SUBST(LIBICONV) AC_SUBST(LIBICONV)
@ -9035,7 +9018,6 @@ AC_SUBST(ENABLE_TESTS)
AC_SUBST(IBMBIDI) AC_SUBST(IBMBIDI)
AC_SUBST(MOZ_UNIVERSALCHARDET) AC_SUBST(MOZ_UNIVERSALCHARDET)
AC_SUBST(ACCESSIBILITY) AC_SUBST(ACCESSIBILITY)
AC_SUBST(MOZ_VIEW_SOURCE)
AC_SUBST(MOZ_SPELLCHECK) AC_SUBST(MOZ_SPELLCHECK)
AC_SUBST(MOZ_USER_DIR) AC_SUBST(MOZ_USER_DIR)
AC_SUBST(MOZ_CRASHREPORTER) AC_SUBST(MOZ_CRASHREPORTER)

View File

@ -5679,7 +5679,6 @@ AC_SUBST(MOZ_SHARK)
AC_SUBST(MOZ_CALLGRIND) AC_SUBST(MOZ_CALLGRIND)
AC_SUBST(MOZ_VTUNE) AC_SUBST(MOZ_VTUNE)
AC_SUBST(MOZ_PROFILING) AC_SUBST(MOZ_PROFILING)
AC_SUBST(MOZ_JSLOADER)
AC_SUBST(MOZ_QUANTIFY) AC_SUBST(MOZ_QUANTIFY)
AC_SUBST(LIBICONV) AC_SUBST(LIBICONV)

View File

@ -44,13 +44,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk include $(DEPTH)/config/autoconf.mk
MODULE = xpconnect MODULE = xpconnect
DIRS = public idl wrappers DIRS = public idl wrappers loader src
ifdef MOZ_JSLOADER
DIRS += loader
endif
DIRS += src
ifndef BUILD_STATIC_LIBS ifndef BUILD_STATIC_LIBS
TOOL_DIRS += shell TOOL_DIRS += shell

View File

@ -132,15 +132,10 @@ EXTRA_DSO_LDOPTS += \
$(MOZ_JS_LIBS) \ $(MOZ_JS_LIBS) \
$(NULL) $(NULL)
ifdef MOZ_JSLOADER
SHARED_LIBRARY_LIBS = \ SHARED_LIBRARY_LIBS = \
../loader/$(LIB_PREFIX)jsloader_s.$(LIB_SUFFIX) \ ../loader/$(LIB_PREFIX)jsloader_s.$(LIB_SUFFIX) \
$(NULL) ../wrappers/$(LIB_PREFIX)xpcwrappers_s.$(LIB_SUFFIX) \
endif $(NULL)
SHARED_LIBRARY_LIBS += \
../wrappers/$(LIB_PREFIX)xpcwrappers_s.$(LIB_SUFFIX) \
$(NULL)
include $(topsrcdir)/config/rules.mk include $(topsrcdir)/config/rules.mk

View File

@ -54,10 +54,7 @@
#include "XrayWrapper.h" #include "XrayWrapper.h"
#include "nsNullPrincipal.h" #include "nsNullPrincipal.h"
#include "nsJSUtils.h" #include "nsJSUtils.h"
#ifdef MOZ_JSLOADER
#include "mozJSComponentLoader.h" #include "mozJSComponentLoader.h"
#endif
/***************************************************************************/ /***************************************************************************/
// stuff used by all // stuff used by all
@ -3767,15 +3764,11 @@ xpc_EvalInSandbox(JSContext *cx, JSObject *sandbox, const nsAString& source,
NS_IMETHODIMP NS_IMETHODIMP
nsXPCComponents_Utils::Import(const nsACString & registryLocation) nsXPCComponents_Utils::Import(const nsACString & registryLocation)
{ {
#ifdef MOZ_JSLOADER
nsCOMPtr<xpcIJSModuleLoader> moduleloader = nsCOMPtr<xpcIJSModuleLoader> moduleloader =
do_GetService(MOZJSCOMPONENTLOADER_CONTRACTID); do_GetService(MOZJSCOMPONENTLOADER_CONTRACTID);
if (!moduleloader) if (!moduleloader)
return NS_ERROR_FAILURE; return NS_ERROR_FAILURE;
return moduleloader->Import(registryLocation); return moduleloader->Import(registryLocation);
#else
return NS_ERROR_NOT_AVAILABLE;
#endif
} }
/* xpcIJSWeakReference getWeakReference (); */ /* xpcIJSWeakReference getWeakReference (); */

View File

@ -96,9 +96,7 @@ static const char* const gHTMLTypes[] = {
APPLICATION_JAVASCRIPT, APPLICATION_JAVASCRIPT,
APPLICATION_ECMASCRIPT, APPLICATION_ECMASCRIPT,
APPLICATION_XJAVASCRIPT, APPLICATION_XJAVASCRIPT,
#ifdef MOZ_VIEW_SOURCE
VIEWSOURCE_CONTENT_TYPE, VIEWSOURCE_CONTENT_TYPE,
#endif
APPLICATION_XHTML_XML, APPLICATION_XHTML_XML,
0 0
}; };
@ -193,7 +191,6 @@ nsContentDLF::CreateInstance(const char* aCommand,
nsCAutoString type; nsCAutoString type;
// Are we viewing source? // Are we viewing source?
#ifdef MOZ_VIEW_SOURCE
nsCOMPtr<nsIViewSourceChannel> viewSourceChannel = do_QueryInterface(aChannel); nsCOMPtr<nsIViewSourceChannel> viewSourceChannel = do_QueryInterface(aChannel);
if (viewSourceChannel) if (viewSourceChannel)
{ {
@ -244,7 +241,6 @@ nsContentDLF::CreateInstance(const char* aCommand,
aChannel->SetContentType(NS_LITERAL_CSTRING(TEXT_PLAIN)); aChannel->SetContentType(NS_LITERAL_CSTRING(TEXT_PLAIN));
aContentType = TEXT_PLAIN; aContentType = TEXT_PLAIN;
} }
#endif
// Try html // Try html
int typeIndex=0; int typeIndex=0;
while(gHTMLTypes[typeIndex]) { while(gHTMLTypes[typeIndex]) {

View File

@ -90,13 +90,6 @@ private:
nsresult nsresult
NS_NewContentDocumentLoaderFactory(nsIDocumentLoaderFactory** aResult); NS_NewContentDocumentLoaderFactory(nsIDocumentLoaderFactory** aResult);
#ifdef MOZ_VIEW_SOURCE
#define CONTENTDLF_VIEWSOURCE_CATEGORIES \
{ "Gecko-Content-Viewers", VIEWSOURCE_CONTENT_TYPE, "@mozilla.org/content/document-loader-factory;1" },
#else
#define CONTENTDLF_VIEWSOURCE_CATEGORIES
#endif
#ifdef MOZ_MATHML #ifdef MOZ_MATHML
#define CONTENTDLF_MATHML_CATEGORIES \ #define CONTENTDLF_MATHML_CATEGORIES \
{ "Gecko-Content-Viewers", APPLICATION_MATHML_XML, "@mozilla.org/content/document-loader-factory;1" }, { "Gecko-Content-Viewers", APPLICATION_MATHML_XML, "@mozilla.org/content/document-loader-factory;1" },
@ -135,7 +128,7 @@ NS_NewContentDocumentLoaderFactory(nsIDocumentLoaderFactory** aResult);
{ "Gecko-Content-Viewers", TEXT_RDF, "@mozilla.org/content/document-loader-factory;1" }, \ { "Gecko-Content-Viewers", TEXT_RDF, "@mozilla.org/content/document-loader-factory;1" }, \
{ "Gecko-Content-Viewers", TEXT_XUL, "@mozilla.org/content/document-loader-factory;1" }, \ { "Gecko-Content-Viewers", TEXT_XUL, "@mozilla.org/content/document-loader-factory;1" }, \
{ "Gecko-Content-Viewers", APPLICATION_CACHED_XUL, "@mozilla.org/content/document-loader-factory;1" }, \ { "Gecko-Content-Viewers", APPLICATION_CACHED_XUL, "@mozilla.org/content/document-loader-factory;1" }, \
CONTENTDLF_VIEWSOURCE_CATEGORIES \ { "Gecko-Content-Viewers", VIEWSOURCE_CONTENT_TYPE, "@mozilla.org/content/document-loader-factory;1" }, \
CONTENTDLF_MATHML_CATEGORIES \ CONTENTDLF_MATHML_CATEGORIES \
CONTENTDLF_SVG_CATEGORIES \ CONTENTDLF_SVG_CATEGORIES \
CONTENTDLF_WEBM_CATEGORIES CONTENTDLF_WEBM_CATEGORIES

View File

@ -74,13 +74,8 @@ CPPSRCS = \
nsScanner.cpp \ nsScanner.cpp \
nsToken.cpp \ nsToken.cpp \
nsParserMsgUtils.cpp\ nsParserMsgUtils.cpp\
$(NULL)
ifdef MOZ_VIEW_SOURCE
CPPSRCS += \
nsViewSourceHTML.cpp \ nsViewSourceHTML.cpp \
$(NULL) $(NULL)
endif
ifdef MOZ_DEBUG ifdef MOZ_DEBUG
CPPSRCS += \ CPPSRCS += \

View File

@ -72,10 +72,7 @@
#include "nsIThreadPool.h" #include "nsIThreadPool.h"
#include "nsXPCOMCIDInternal.h" #include "nsXPCOMCIDInternal.h"
#include "nsMimeTypes.h" #include "nsMimeTypes.h"
#ifdef MOZ_VIEW_SOURCE
#include "nsViewSourceHTML.h" #include "nsViewSourceHTML.h"
#endif
#define NS_PARSER_FLAG_PARSER_ENABLED 0x00000002 #define NS_PARSER_FLAG_PARSER_ENABLED 0x00000002
#define NS_PARSER_FLAG_OBSERVERS_ENABLED 0x00000004 #define NS_PARSER_FLAG_OBSERVERS_ENABLED 0x00000004
@ -1436,12 +1433,10 @@ FindSuitableDTD(CParserContext& aParserContext)
// We always find a DTD. // We always find a DTD.
aParserContext.mAutoDetectStatus = ePrimaryDetect; aParserContext.mAutoDetectStatus = ePrimaryDetect;
#ifdef MOZ_VIEW_SOURCE
// Quick check for view source. // Quick check for view source.
if (aParserContext.mParserCommand == eViewSource) { if (aParserContext.mParserCommand == eViewSource) {
return new CViewSourceHTML(); return new CViewSourceHTML();
} }
#endif
// Now see if we're parsing HTML (which, as far as we're concerned, simply // Now see if we're parsing HTML (which, as far as we're concerned, simply
// means "not XML"). // means "not XML").

View File

@ -52,10 +52,7 @@
#include "nsSAXAttributes.h" #include "nsSAXAttributes.h"
#include "nsSAXLocator.h" #include "nsSAXLocator.h"
#include "nsSAXXMLReader.h" #include "nsSAXXMLReader.h"
#ifdef MOZ_VIEW_SOURCE
#include "nsViewSourceHTML.h" #include "nsViewSourceHTML.h"
#endif
#if defined(NS_DEBUG) #if defined(NS_DEBUG)
#include "nsLoggingSink.h" #include "nsLoggingSink.h"
@ -73,9 +70,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsParser)
NS_GENERIC_FACTORY_CONSTRUCTOR(CNavDTD) NS_GENERIC_FACTORY_CONSTRUCTOR(CNavDTD)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsParserService) NS_GENERIC_FACTORY_CONSTRUCTOR(nsParserService)
#ifdef MOZ_VIEW_SOURCE
NS_GENERIC_FACTORY_CONSTRUCTOR(CViewSourceHTML) NS_GENERIC_FACTORY_CONSTRUCTOR(CViewSourceHTML)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSAXAttributes) NS_GENERIC_FACTORY_CONSTRUCTOR(nsSAXAttributes)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSAXXMLReader) NS_GENERIC_FACTORY_CONSTRUCTOR(nsSAXXMLReader)
@ -86,9 +81,7 @@ NS_DEFINE_NAMED_CID(NS_EXPAT_DRIVER_CID);
#endif #endif
NS_DEFINE_NAMED_CID(NS_PARSER_CID); NS_DEFINE_NAMED_CID(NS_PARSER_CID);
NS_DEFINE_NAMED_CID(NS_CNAVDTD_CID); NS_DEFINE_NAMED_CID(NS_CNAVDTD_CID);
#ifdef MOZ_VIEW_SOURCE
NS_DEFINE_NAMED_CID(NS_VIEWSOURCE_DTD_CID); NS_DEFINE_NAMED_CID(NS_VIEWSOURCE_DTD_CID);
#endif
NS_DEFINE_NAMED_CID(NS_PARSERSERVICE_CID); NS_DEFINE_NAMED_CID(NS_PARSERSERVICE_CID);
NS_DEFINE_NAMED_CID(NS_SAXATTRIBUTES_CID); NS_DEFINE_NAMED_CID(NS_SAXATTRIBUTES_CID);
NS_DEFINE_NAMED_CID(NS_SAXXMLREADER_CID); NS_DEFINE_NAMED_CID(NS_SAXXMLREADER_CID);
@ -100,9 +93,7 @@ static const mozilla::Module::CIDEntry kParserCIDs[] = {
#endif #endif
{ &kNS_PARSER_CID, false, NULL, nsParserConstructor }, { &kNS_PARSER_CID, false, NULL, nsParserConstructor },
{ &kNS_CNAVDTD_CID, false, NULL, CNavDTDConstructor }, { &kNS_CNAVDTD_CID, false, NULL, CNavDTDConstructor },
#ifdef MOZ_VIEW_SOURCE
{ &kNS_VIEWSOURCE_DTD_CID, false, NULL, CViewSourceHTMLConstructor }, { &kNS_VIEWSOURCE_DTD_CID, false, NULL, CViewSourceHTMLConstructor },
#endif
{ &kNS_PARSERSERVICE_CID, false, NULL, nsParserServiceConstructor }, { &kNS_PARSERSERVICE_CID, false, NULL, nsParserServiceConstructor },
{ &kNS_SAXATTRIBUTES_CID, false, NULL, nsSAXAttributesConstructor }, { &kNS_SAXATTRIBUTES_CID, false, NULL, nsSAXAttributesConstructor },
{ &kNS_SAXXMLREADER_CID, false, NULL, nsSAXXMLReaderConstructor }, { &kNS_SAXXMLREADER_CID, false, NULL, nsSAXXMLReaderConstructor },

View File

@ -70,7 +70,7 @@ PARALLEL_DIRS += \
typeaheadfind \ typeaheadfind \
urlformatter \ urlformatter \
viewconfig \ viewconfig \
webapps \ viewsource \
$(NULL) $(NULL)
ifdef BUILD_CTYPES ifdef BUILD_CTYPES
@ -97,10 +97,6 @@ ifdef NS_PRINTING
PARALLEL_DIRS += printing PARALLEL_DIRS += printing
endif endif
ifdef MOZ_VIEW_SOURCE
PARALLEL_DIRS += viewsource
endif
ifdef MOZ_XUL ifdef MOZ_XUL
PARALLEL_DIRS += \ PARALLEL_DIRS += \
autocomplete \ autocomplete \