diff --git a/mozilla/embedding/base/Makefile.in b/mozilla/embedding/base/Makefile.in index 2e297cd3771..c4eafacab4c 100644 --- a/mozilla/embedding/base/Makefile.in +++ b/mozilla/embedding/base/Makefile.in @@ -56,8 +56,6 @@ endif # static lib. FORCE_STATIC_LIB = 1 -DEFINES += -DXPCOM_GLUE - include $(topsrcdir)/config/rules.mk CXXFLAGS += $(MOZ_TOOLKIT_REGISTRY_CFLAGS) diff --git a/mozilla/embedding/base/nsEmbedAPI.cpp b/mozilla/embedding/base/nsEmbedAPI.cpp index 40f6e57d5dc..1631996776d 100644 --- a/mozilla/embedding/base/nsEmbedAPI.cpp +++ b/mozilla/embedding/base/nsEmbedAPI.cpp @@ -22,10 +22,6 @@ * Contributor(s): */ -#ifdef XPCOM_GLUE -#include "nsXPCOMGlue.h" -#endif - #include "nsIServiceManager.h" #include "nsIComponentRegistrar.h" #include "nsIAppStartupNotifier.h" @@ -87,11 +83,6 @@ nsresult NS_InitEmbedding(nsILocalFile *mozBinDirectory, if (!sXPCOMInitializedFlag) #endif { - -#ifdef XPCOM_GLUE - // TODO: Need to be smarter about where exactly the xpcom library is. - XPCOMGlueStartup(nsnull); -#endif // Initialise XPCOM NS_InitXPCOM2(&sServiceManager, mozBinDirectory, appFileLocProvider); @@ -185,8 +176,5 @@ nsresult NS_TermEmbedding() NS_ShutdownXPCOM(sServiceManager); #endif -#ifdef XPCOM_GLUE - XPCOMGlueShutdown(); -#endif return NS_OK; } diff --git a/mozilla/embedding/browser/activex/src/control/Makefile.in b/mozilla/embedding/browser/activex/src/control/Makefile.in index c70f5bc73ec..b520909a089 100644 --- a/mozilla/embedding/browser/activex/src/control/Makefile.in +++ b/mozilla/embedding/browser/activex/src/control/Makefile.in @@ -79,12 +79,9 @@ CPPSRCS = \ guids.cpp \ $(NULL) -DEFINES += -DXPCOM_GLUE - -# we still include xpcom directly since this control uses atoms and voidarray. EXTRA_DSO_LDOPTS = \ + $(DIST)/lib/$(LIB_PREFIX)gkgfx.$(LIB_SUFFIX) \ $(DIST)/lib/$(LIB_PREFIX)embed_base_s.$(LIB_SUFFIX) \ - $(XPCOM_GLUE_LIBS) \ $(XPCOM_LIBS) \ $(NSPR_LIBS) \ $(NULL) diff --git a/mozilla/embedding/browser/gtk/src/Makefile.in b/mozilla/embedding/browser/gtk/src/Makefile.in index 0714fde76ab..3ae770323fe 100644 --- a/mozilla/embedding/browser/gtk/src/Makefile.in +++ b/mozilla/embedding/browser/gtk/src/Makefile.in @@ -89,9 +89,7 @@ EXPORTS = \ gtkmozembed_internal.h EXTRA_DSO_LDOPTS = \ - $(DIST)/lib/$(LIB_PREFIX)embed_base_s.$(LIB_SUFFIX) \ - $(XPCOM_GLUE_LIBS) \ - $(NSPR_LIBS) \ + $(MOZ_COMPONENT_LIBS) \ -lgtksuperwin \ $(NULL) diff --git a/mozilla/embedding/tests/mfcembed/Makefile.in b/mozilla/embedding/tests/mfcembed/Makefile.in index 5cfbe0c8c49..1d59177e434 100644 --- a/mozilla/embedding/tests/mfcembed/Makefile.in +++ b/mozilla/embedding/tests/mfcembed/Makefile.in @@ -83,13 +83,11 @@ CPPSRCS = \ StdAfx.cpp \ $(NULL) -EXTRA_DSO_LIBS = mfcEmbedComponents - -DEFINES += -DXPCOM_GLUE +EXTRA_DSO_LIBS = embed_base_s gkgfx mfcEmbedComponents LIBS = \ - $(DIST)/lib/$(LIB_PREFIX)embed_base_s.$(LIB_SUFFIX) \ - $(XPCOM_GLUE_LIBS) \ + $(EXTRA_DSO_LIBS) \ + $(XPCOM_LIBS) \ $(NSPR_LIBS) \ $(NULL) diff --git a/mozilla/embedding/tests/mfcembed/MfcEmbed.cpp b/mozilla/embedding/tests/mfcembed/MfcEmbed.cpp index a6707ff8ff4..24c43dfa637 100644 --- a/mozilla/embedding/tests/mfcembed/MfcEmbed.cpp +++ b/mozilla/embedding/tests/mfcembed/MfcEmbed.cpp @@ -55,11 +55,10 @@ #include "nsIWindowWatcher.h" #include "plstr.h" #include "Preferences.h" +#include "nsCRT.h" #include #include -#include "nsIComponentRegistrar.h" - #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE @@ -169,12 +168,6 @@ nsresult CMfcEmbedApp::OverrideComponents() { nsresult rv = NS_OK; - - nsCOMPtr registrar; - rv = NS_GetComponentRegistrar(getter_AddRefs(registrar)); - if (NS_FAILED(rv)) - return rv; - // replace Mozilla's default PromptService with our own, if the // expected override DLL is present HMODULE overlib = ::LoadLibrary(kComponentsLibname); @@ -190,10 +183,11 @@ nsresult CMfcEmbedApp::OverrideComponents() nsCOMPtr promptFactory; rv = MakeFactory(getter_AddRefs(promptFactory)); if (NS_SUCCEEDED(rv)) - registrar->RegisterFactory(kPromptServiceCID, - "Prompt Service", - "@mozilla.org/embedcomp/prompt-service;1", - promptFactory); // replace existing + nsComponentManager::RegisterFactory(kPromptServiceCID, + "Prompt Service", + "@mozilla.org/embedcomp/prompt-service;1", + promptFactory, + PR_TRUE); // replace existing } else ::FreeLibrary(overlib); } @@ -212,10 +206,11 @@ nsresult CMfcEmbedApp::OverrideComponents() nsCOMPtr helperAppDlgFactory; rv = MakeFactory(getter_AddRefs(helperAppDlgFactory)); if (NS_SUCCEEDED(rv)) - registrar->RegisterFactory(kHelperAppLauncherDialogCID, - "Helper App Launcher Dialog", - "@mozilla.org/helperapplauncherdialog;1", - helperAppDlgFactory); + nsComponentManager::RegisterFactory(kHelperAppLauncherDialogCID, + "Helper App Launcher Dialog", + "@mozilla.org/helperapplauncherdialog;1", + helperAppDlgFactory, + PR_TRUE); // replace existing } else ::FreeLibrary(overlib); } @@ -235,10 +230,11 @@ nsresult CMfcEmbedApp::OverrideComponents() nsCOMPtr printingPromptFactory; rv = MakeFactory(getter_AddRefs(printingPromptFactory)); if (NS_SUCCEEDED(rv)) - registrar->RegisterFactory(kPrintingPromptServiceCID, - "Printing Prompt Service", - "@mozilla.org/embedcomp/printingprompt-service;1", - printingPromptFactory); + nsComponentManager::RegisterFactory(kPrintingPromptServiceCID, + "Printing Prompt Service", + "@mozilla.org/embedcomp/printingprompt-service;1", + printingPromptFactory, + PR_TRUE); // replace existing } else ::FreeLibrary(overlib); } @@ -651,7 +647,7 @@ NS_IMETHODIMP CMfcEmbedApp::Observe(nsISupports *aSubject, const char *aTopic, c { nsresult rv = NS_OK; - if (strcmp(aTopic, "profile-approve-change") == 0) + if (nsCRT::strcmp(aTopic, "profile-approve-change") == 0) { // Ask the user if they want to int result = MessageBox(NULL, "Do you want to close all windows in order to switch the profile?", "Confirm", MB_YESNO | MB_ICONQUESTION); @@ -662,7 +658,7 @@ NS_IMETHODIMP CMfcEmbedApp::Observe(nsISupports *aSubject, const char *aTopic, c status->VetoChange(); } } - else if (strcmp(aTopic, "profile-change-teardown") == 0) + else if (nsCRT::strcmp(aTopic, "profile-change-teardown") == 0) { // Close all open windows. Alternatively, we could just call CBrowserWindow::Stop() // on each. Either way, we have to stop all network activity on this phase. @@ -683,13 +679,13 @@ NS_IMETHODIMP CMfcEmbedApp::Observe(nsISupports *aSubject, const char *aTopic, c } } } - else if (strcmp(aTopic, "profile-after-change") == 0) + else if (nsCRT::strcmp(aTopic, "profile-after-change") == 0) { InitializePrefs(); // In case we have just switched to a newly created profile. // Only make a new browser window on a switch. This also gets // called at start up and we already make a window then. - if (!strcmp(someData, NS_LITERAL_STRING("switch").get())) + if (!nsCRT::strcmp(someData, NS_LITERAL_STRING("switch").get())) OnNewBrowser(); } return rv; diff --git a/mozilla/embedding/tests/mfcembed/MfcEmbed.h b/mozilla/embedding/tests/mfcembed/MfcEmbed.h index 114f838df65..e8d6f3e34fd 100644 --- a/mozilla/embedding/tests/mfcembed/MfcEmbed.h +++ b/mozilla/embedding/tests/mfcembed/MfcEmbed.h @@ -126,28 +126,6 @@ private: ///////////////////////////////////////////////////////////////////////////// -static PRInt32 strcmp(const PRUnichar* s1, const PRUnichar* s2) { - if(s1 && s2) { - for (;;) { - PRUnichar c1 = *s1++; - PRUnichar c2 = *s2++; - if (c1 != c2) { - if (c1 < c2) return -1; - return 1; - } - if ((0==c1) || (0==c2)) break; - } - } - else { - if (s1) // s2 must have been null - return -1; - if (s2) // s1 must have been null - return 1; - } - return 0; -} - - //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. diff --git a/mozilla/embedding/tests/mfcembed/ProfilesDlg.cpp b/mozilla/embedding/tests/mfcembed/ProfilesDlg.cpp index 9dc9ae68b0d..9ba7ca093fa 100644 --- a/mozilla/embedding/tests/mfcembed/ProfilesDlg.cpp +++ b/mozilla/embedding/tests/mfcembed/ProfilesDlg.cpp @@ -38,6 +38,7 @@ // Mozilla #include "nsIProfile.h" #include "nsIServiceManager.h" +#include "nsCRT.h" #ifdef _DEBUG #define new DEBUG_NEW @@ -227,7 +228,7 @@ BOOL CProfilesDlg::OnInitDialog() { CString tmpStr(W2T(profileList[index])); m_ProfileList.AddString(tmpStr); - if (strcmp(profileList[index], curProfileName.get()) == 0) + if (nsCRT::strcmp(profileList[index], curProfileName.get()) == 0) selectedRow = index; } diff --git a/mozilla/embedding/tests/mfcembed/components/nsPrintDialogUtil.cpp b/mozilla/embedding/tests/mfcembed/components/nsPrintDialogUtil.cpp index 467803f0a8f..41581291f6b 100644 --- a/mozilla/embedding/tests/mfcembed/components/nsPrintDialogUtil.cpp +++ b/mozilla/embedding/tests/mfcembed/components/nsPrintDialogUtil.cpp @@ -81,6 +81,7 @@ static NS_DEFINE_IID(kPrinterEnumeratorCID, NS_PRINTER_ENUMERATOR_CID); #include "nsRect.h" #include "nsIPref.h" +#include "nsCRT.h" #include "prenv.h" /* for PR_GetEnv */ #include @@ -836,17 +837,6 @@ static PRUnichar * GetDefaultPrinterNameFromGlobalPrinters() return printerName; } -static PRUint32 strlen(const PRUnichar* s) -{ - PRUint32 len = 0; - if(s) { - while (*s++ != 0) { - len++; - } - } - return len; -} - //------------------------------------------------------------------ // Displays the native Print Dialog @@ -876,7 +866,7 @@ ShowNativePrintDialog(HWND aHWnd, if (!printerName) return NS_ERROR_FAILURE; // Now create a DEVNAMES struct so the the dialog is initialized correctly. - PRUint32 len = strlen(printerName); + PRUint32 len = nsCRT::strlen(printerName); hDevNames = (HGLOBAL)::GlobalAlloc(GHND, len+sizeof(DEVNAMES)+1); DEVNAMES* pDevNames = (DEVNAMES*)::GlobalLock(hDevNames); pDevNames->wDriverOffset = sizeof(DEVNAMES); diff --git a/mozilla/embedding/tests/mfcembed/winEmbedFileLocProvider.cpp b/mozilla/embedding/tests/mfcembed/winEmbedFileLocProvider.cpp index 8f203186648..420bf53c75a 100644 --- a/mozilla/embedding/tests/mfcembed/winEmbedFileLocProvider.cpp +++ b/mozilla/embedding/tests/mfcembed/winEmbedFileLocProvider.cpp @@ -35,6 +35,7 @@ #include "nsILocalFile.h" #include "nsString.h" #include "nsXPIDLString.h" +#include "nsCRT.h" #include @@ -91,23 +92,23 @@ winEmbedFileLocProvider::GetFile(const char *prop, PRBool *persistant, nsIFile * *_retval = nsnull; *persistant = PR_TRUE; - if (strcmp(prop, NS_APP_APPLICATION_REGISTRY_DIR) == 0) + if (nsCRT::strcmp(prop, NS_APP_APPLICATION_REGISTRY_DIR) == 0) { rv = GetProductDirectory(getter_AddRefs(localFile)); } - else if (strcmp(prop, NS_APP_APPLICATION_REGISTRY_FILE) == 0) + else if (nsCRT::strcmp(prop, NS_APP_APPLICATION_REGISTRY_FILE) == 0) { rv = GetProductDirectory(getter_AddRefs(localFile)); if (NS_SUCCEEDED(rv)) rv = localFile->AppendNative(APP_REGISTRY_NAME); } - else if (strcmp(prop, NS_APP_DEFAULTS_50_DIR) == 0) + else if (nsCRT::strcmp(prop, NS_APP_DEFAULTS_50_DIR) == 0) { rv = CloneMozBinDirectory(getter_AddRefs(localFile)); if (NS_SUCCEEDED(rv)) rv = localFile->AppendRelativeNativePath(DEFAULTS_DIR_NAME); } - else if (strcmp(prop, NS_APP_PREF_DEFAULTS_50_DIR) == 0) + else if (nsCRT::strcmp(prop, NS_APP_PREF_DEFAULTS_50_DIR) == 0) { rv = CloneMozBinDirectory(getter_AddRefs(localFile)); if (NS_SUCCEEDED(rv)) { @@ -116,8 +117,8 @@ winEmbedFileLocProvider::GetFile(const char *prop, PRBool *persistant, nsIFile * rv = localFile->AppendRelativeNativePath(DEFAULTS_PREF_DIR_NAME); } } - else if (strcmp(prop, NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR) == 0 || - strcmp(prop, NS_APP_PROFILE_DEFAULTS_50_DIR) == 0) + else if (nsCRT::strcmp(prop, NS_APP_PROFILE_DEFAULTS_NLOC_50_DIR) == 0 || + nsCRT::strcmp(prop, NS_APP_PROFILE_DEFAULTS_50_DIR) == 0) { rv = CloneMozBinDirectory(getter_AddRefs(localFile)); if (NS_SUCCEEDED(rv)) { @@ -126,29 +127,29 @@ winEmbedFileLocProvider::GetFile(const char *prop, PRBool *persistant, nsIFile * rv = localFile->AppendRelativeNativePath(DEFAULTS_PROFILE_DIR_NAME); } } - else if (strcmp(prop, NS_APP_USER_PROFILES_ROOT_DIR) == 0) + else if (nsCRT::strcmp(prop, NS_APP_USER_PROFILES_ROOT_DIR) == 0) { rv = GetDefaultUserProfileRoot(getter_AddRefs(localFile)); } - else if (strcmp(prop, NS_APP_RES_DIR) == 0) + else if (nsCRT::strcmp(prop, NS_APP_RES_DIR) == 0) { rv = CloneMozBinDirectory(getter_AddRefs(localFile)); if (NS_SUCCEEDED(rv)) rv = localFile->AppendRelativeNativePath(RES_DIR_NAME); } - else if (strcmp(prop, NS_APP_CHROME_DIR) == 0) + else if (nsCRT::strcmp(prop, NS_APP_CHROME_DIR) == 0) { rv = CloneMozBinDirectory(getter_AddRefs(localFile)); if (NS_SUCCEEDED(rv)) rv = localFile->AppendRelativeNativePath(CHROME_DIR_NAME); } - else if (strcmp(prop, NS_APP_PLUGINS_DIR) == 0) + else if (nsCRT::strcmp(prop, NS_APP_PLUGINS_DIR) == 0) { rv = CloneMozBinDirectory(getter_AddRefs(localFile)); if (NS_SUCCEEDED(rv)) rv = localFile->AppendRelativeNativePath(PLUGINS_DIR_NAME); } - else if (strcmp(prop, NS_APP_SEARCH_DIR) == 0) + else if (nsCRT::strcmp(prop, NS_APP_SEARCH_DIR) == 0) { rv = CloneMozBinDirectory(getter_AddRefs(localFile)); if (NS_SUCCEEDED(rv)) @@ -163,11 +164,11 @@ winEmbedFileLocProvider::GetFile(const char *prop, PRBool *persistant, nsIFile * // Please see http://www.mozilla.org/projects/embedding/MRE.html // for more info. on MRE //--------------------------------------------------------------- - else if (strcmp(prop, NS_MRE_DIR) == 0) + else if (nsCRT::strcmp(prop, NS_MRE_DIR) == 0) { rv = GetMreDirectory(getter_AddRefs(localFile)); } - else if (strcmp(prop, NS_MRE_COMPONENT_DIR) == 0) + else if (nsCRT::strcmp(prop, NS_MRE_COMPONENT_DIR) == 0) { rv = GetMreDirectory(getter_AddRefs(localFile)); if (NS_SUCCEEDED(rv)) diff --git a/mozilla/embedding/tests/winEmbed/Makefile.in b/mozilla/embedding/tests/winEmbed/Makefile.in index 828dd56f4d5..1a374b213c2 100644 --- a/mozilla/embedding/tests/winEmbed/Makefile.in +++ b/mozilla/embedding/tests/winEmbed/Makefile.in @@ -62,11 +62,11 @@ CPPSRCS = \ StdAfx.cpp \ $(NULL) -DEFINES += -DXPCOM_GLUE +EXTRA_DSO_LIBS = embed_base_s gkgfx LIBS = \ - $(DIST)/lib/$(LIB_PREFIX)embed_base_s.$(LIB_SUFFIX) \ - $(XPCOM_GLUE_LIBS) \ + $(EXTRA_DSO_LIBS) \ + $(XPCOM_LIBS) \ $(NSPR_LIBS) \ $(NULL)