From e8b458dd5e0239a9cd0ca7c374f39a771621b05f Mon Sep 17 00:00:00 2001 From: "ccarlen%netscape.com" Date: Sat, 11 Jan 2003 03:02:33 +0000 Subject: [PATCH] Bug 70714 - visited link doesn't change color in embedding apps. The patch turns on the building of the embed-lite component which implements global history with less footprint and is exported to Embed dist. r=chak/sr=alecf git-svn-id: svn://10.0.0.236/trunk@136189 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/embedding/Makefile.in | 2 +- mozilla/embedding/config/Makefile.in | 1 + mozilla/embedding/lite/Makefile.in | 3 ++- mozilla/embedding/lite/nsEmbedChromeRegistry.cpp | 9 ++------- mozilla/embedding/lite/nsEmbedGlobalHistory.cpp | 10 ++++------ mozilla/embedding/lite/nsEmbedGlobalHistory.h | 2 +- mozilla/embedding/lite/nsEmbedLiteModule.cpp | 14 +++++++------- 7 files changed, 18 insertions(+), 23 deletions(-) diff --git a/mozilla/embedding/Makefile.in b/mozilla/embedding/Makefile.in index 99721215955..73291c71751 100644 --- a/mozilla/embedding/Makefile.in +++ b/mozilla/embedding/Makefile.in @@ -25,6 +25,6 @@ VPATH = @srcdir@ include $(DEPTH)/config/autoconf.mk -DIRS = base components browser +DIRS = base components browser lite include $(topsrcdir)/config/rules.mk diff --git a/mozilla/embedding/config/Makefile.in b/mozilla/embedding/config/Makefile.in index 2893eee980b..eda0ede0a38 100644 --- a/mozilla/embedding/config/Makefile.in +++ b/mozilla/embedding/config/Makefile.in @@ -76,6 +76,7 @@ endif fi $(NSINSTALL) -t $(srcdir)/installed-chrome.txt $(DIST)/Embed/chrome $(NSINSTALL) -t $(srcdir)/readme.html $(DIST)/Embed + $(NSINSTALL) -t $(topsrcdir)/embedding/lite/$(LIB_PREFIX)embed_lite$(DLL_SUFFIX) $(DIST)/Embed/components ifeq ($(OS_ARCH),WINNT) ifeq ($(WINAPP),mfcembed) $(NSINSTALL) -t $(DIST)/bin/mfcembed.exe $(DIST)/Embed diff --git a/mozilla/embedding/lite/Makefile.in b/mozilla/embedding/lite/Makefile.in index 4c637fbb484..94975ce0a2f 100644 --- a/mozilla/embedding/lite/Makefile.in +++ b/mozilla/embedding/lite/Makefile.in @@ -40,6 +40,7 @@ REQUIRES = xpcom \ xpconnect \ js \ xuldoc \ + appcomps \ $(NULL) CPPSRCS = \ @@ -49,7 +50,7 @@ CPPSRCS = \ $(NULL) # bring in the chrome protocol handler -LOBJS = $(topsrcdir)/rdf/chrome/src/nsChromeProtocolHandler.$(OBJ_SUFFIX) +# LOBJS = $(topsrcdir)/rdf/chrome/src/nsChromeProtocolHandler.$(OBJ_SUFFIX) LOCAL_INCLUDES = -I$(DEPTH)/rdf/chrome/src diff --git a/mozilla/embedding/lite/nsEmbedChromeRegistry.cpp b/mozilla/embedding/lite/nsEmbedChromeRegistry.cpp index e2d061cd983..8f2475446ef 100644 --- a/mozilla/embedding/lite/nsEmbedChromeRegistry.cpp +++ b/mozilla/embedding/lite/nsEmbedChromeRegistry.cpp @@ -216,7 +216,6 @@ nsEmbedChromeRegistry::ReadChromeRegistry() nsresult nsEmbedChromeRegistry::ProcessNewChromeBuffer(char* aBuffer, PRInt32 aLength) { - nsresult rv = NS_OK; while (aLength > 0) { PRInt32 processedBytes = ProcessChromeLine(aBuffer, aLength); aBuffer += processedBytes; @@ -347,17 +346,13 @@ nsEmbedChromeRegistry::Canonify(nsIURI* aChromeURI) } NS_IMETHODIMP -nsEmbedChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL, char** aResult) +nsEmbedChromeRegistry::ConvertChromeURL(nsIURI* aChromeURL, nsACString& aResult) { nsresult rv; - nsCAutoString finalURL; - rv = aChromeURL->GetSpec(finalURL); + rv = aChromeURL->GetSpec(aResult); if (NS_FAILED(rv)) return rv; - *aResult = ToNewCString(finalURL); - if (!*aResult) return NS_ERROR_OUT_OF_MEMORY; - return NS_OK; } diff --git a/mozilla/embedding/lite/nsEmbedGlobalHistory.cpp b/mozilla/embedding/lite/nsEmbedGlobalHistory.cpp index 3b7643bf57c..af2eaf0ad9e 100644 --- a/mozilla/embedding/lite/nsEmbedGlobalHistory.cpp +++ b/mozilla/embedding/lite/nsEmbedGlobalHistory.cpp @@ -41,7 +41,7 @@ #include "nsIObserverService.h" #include "nsWeakReference.h" #include "nsAppDirectoryServiceDefs.h" -#include "nsHashTable.h" +#include "nsHashtable.h" #include "nsInt64.h" #include "prtypes.h" #include "nsFixedSizeAllocator.h" @@ -93,7 +93,7 @@ public: { mWritten = PR_TRUE; } // Memory management stuff - static void* operator new(size_t size); + static void* operator new(size_t size) CPP_THROW_NEW; static void operator delete(void *p, size_t size); // Must be called when done with all HistoryEntry objects @@ -111,7 +111,7 @@ nsFixedSizeAllocator *HistoryEntry::sPool; //***************************************************************************** -void* HistoryEntry::operator new(size_t size) +void* HistoryEntry::operator new(size_t size) CPP_THROW_NEW { if (size != sizeof(HistoryEntry)) return ::operator new(size); @@ -168,9 +168,7 @@ NS_IMPL_ISUPPORTS3(nsEmbedGlobalHistory, nsIGlobalHistory, nsIObserver, nsISuppo nsEmbedGlobalHistory::nsEmbedGlobalHistory() : mDataIsLoaded(PR_FALSE), mEntriesAddedSinceFlush(0), mURLTable(nsnull) -{ - NS_INIT_REFCNT(); - +{ LL_I2L(mExpirationInterval, kDefaultExpirationIntervalDays); LL_MUL(mExpirationInterval, mExpirationInterval, kMSecsPerDay); } diff --git a/mozilla/embedding/lite/nsEmbedGlobalHistory.h b/mozilla/embedding/lite/nsEmbedGlobalHistory.h index bc10034a4c1..a20e2d68dc0 100644 --- a/mozilla/embedding/lite/nsEmbedGlobalHistory.h +++ b/mozilla/embedding/lite/nsEmbedGlobalHistory.h @@ -87,7 +87,7 @@ protected: protected: PRBool mDataIsLoaded; - PRUint32 mEntriesAddedSinceFlush; + PRInt32 mEntriesAddedSinceFlush; nsCOMPtr mHistoryFile; nsHashtable *mURLTable; PRInt64 mExpirationInterval; diff --git a/mozilla/embedding/lite/nsEmbedLiteModule.cpp b/mozilla/embedding/lite/nsEmbedLiteModule.cpp index f84c84a9b7f..a916bf043aa 100644 --- a/mozilla/embedding/lite/nsEmbedLiteModule.cpp +++ b/mozilla/embedding/lite/nsEmbedLiteModule.cpp @@ -42,27 +42,27 @@ #include "nsEmbedGlobalHistory.h" #include "nsChromeProtocolHandler.h" -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsEmbedChromeRegistry, Init) +//NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsEmbedChromeRegistry, Init) NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsEmbedGlobalHistory, Init) static const nsModuleComponentInfo components[] = { -#if 1 // Don't hook up until implementation is finished +#if 0 // Don't hook up until implementation is finished { "Chrome Registry", NS_EMBEDCHROMEREGISTRY_CID, "@mozilla.org/chrome/chrome-registry;1", nsEmbedChromeRegistryConstructor, }, + { "Chrome Protocol Handler", + NS_CHROMEPROTOCOLHANDLER_CID, + NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "chrome", + nsChromeProtocolHandler::Create + }, #endif { "Global History", NS_EMBEDGLOBALHISTORY_CID, "@mozilla.org/browser/global-history;1", nsEmbedGlobalHistoryConstructor, - }, - { "Chrome Protocol Handler", - NS_CHROMEPROTOCOLHANDLER_CID, - NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "chrome", - nsChromeProtocolHandler::Create } };