Bug 997963, part 7 - Remove some old ifdef DEBUG_foo code from string bundle code. r=ehsan
authorAndrew McCreight <continuation@gmail.com>
Mon, 21 Apr 2014 09:41:57 -0700
changeset 179816 e70e9419acc226064b3ad6c7737638b064a880a5
parent 179815 34473bcef1b75424e6277dbf7328a511bf61c5ff
child 179817 9acbab76a7b0206654a70c1093b1f220bb56c534
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersehsan
bugs997963
milestone31.0a1
Bug 997963, part 7 - Remove some old ifdef DEBUG_foo code from string bundle code. r=ehsan
intl/strres/src/nsStringBundle.cpp
--- a/intl/strres/src/nsStringBundle.cpp
+++ b/intl/strres/src/nsStringBundle.cpp
@@ -111,23 +111,16 @@ nsStringBundle::GetStringFromID(int32_t 
     rv = mOverrideStrings->GetStringFromName(mPropertiesURL,
                                              name,
                                              aResult);
     if (NS_SUCCEEDED(rv)) return rv;
   }
 
   rv = mProps->GetStringProperty(name, aResult);
 
-#ifdef DEBUG_tao_
-  char *s = ToNewCString(aResult);
-  printf("\n** GetStringFromID: aResult=%s, len=%d\n", s?s:"null",
-         aResult.Length());
-  if (s) nsMemory::Free(s);
-#endif /* DEBUG_tao_ */
-
   return rv;
 }
 
 nsresult
 nsStringBundle::GetStringFromName(const nsAString& aName,
                                   nsAString& aResult)
 {
   nsresult rv;
@@ -136,24 +129,16 @@ nsStringBundle::GetStringFromName(const 
   if (mOverrideStrings) {
     rv = mOverrideStrings->GetStringFromName(mPropertiesURL,
                                              NS_ConvertUTF16toUTF8(aName),
                                              aResult);
     if (NS_SUCCEEDED(rv)) return rv;
   }
 
   rv = mProps->GetStringProperty(NS_ConvertUTF16toUTF8(aName), aResult);
-#ifdef DEBUG_tao_
-  char *s = ToNewCString(aResult),
-       *ss = ToNewCString(aName);
-  printf("\n** GetStringFromName: aName=%s, aResult=%s, len=%d\n",
-         ss?ss:"null", s?s:"null", aResult.Length());
-  if (s)  nsMemory::Free(s);
-  if (ss) nsMemory::Free(ss);
-#endif /* DEBUG_tao_ */
   return rv;
 }
 
 NS_IMETHODIMP
 nsStringBundle::FormatStringFromID(int32_t aID,
                                    const char16_t **aParams,
                                    uint32_t aLength,
                                    char16_t ** aResult)
@@ -491,20 +476,16 @@ struct bundleCacheEntry_t : public Linke
   nsAutoPtr<nsCStringKey> mHashKey;
   nsCOMPtr<nsIStringBundle> mBundle;
 };
 
 
 nsStringBundleService::nsStringBundleService() :
   mBundleMap(MAX_CACHED_BUNDLES, true)
 {
-#ifdef DEBUG_tao_
-  printf("\n++ nsStringBundleService::nsStringBundleService ++\n");
-#endif
-
   mErrorService = do_GetService(kErrorServiceCID);
   NS_ASSERTION(mErrorService, "Couldn't get error service");
 }
 
 NS_IMPL_ISUPPORTS3(nsStringBundleService,
                    nsIStringBundleService,
                    nsIObserver,
                    nsISupportsWeakReference)
@@ -617,21 +598,16 @@ nsStringBundleService::insertIntoCache(a
   } else {
     // cache is full
     // take the last entry in the list, and recycle it.
     cacheEntry = mBundleCache.getLast();
 
     // remove it from the hash table and linked list
     NS_ASSERTION(mBundleMap.Exists(cacheEntry->mHashKey),
                  "Element will not be removed!");
-#ifdef DEBUG_alecf
-    NS_WARNING(nsPrintfCString("Booting %s to make room for %s\n",
-                               cacheEntry->mHashKey->GetString(),
-                               aHashKey->GetString()).get());
-#endif
     mBundleMap.Remove(cacheEntry->mHashKey);
     cacheEntry->remove();
   }
 
   // at this point we have a new cacheEntry that doesn't exist
   // in the hashtable, so set up the cacheEntry
   cacheEntry->mHashKey = (nsCStringKey*)aHashKey->Clone();
   cacheEntry->mBundle = aBundle;
@@ -641,21 +617,16 @@ nsStringBundleService::insertIntoCache(a
 
   return cacheEntry;
 }
 
 NS_IMETHODIMP
 nsStringBundleService::CreateBundle(const char* aURLSpec,
                                     nsIStringBundle** aResult)
 {
-#ifdef DEBUG_tao_
-  printf("\n++ nsStringBundleService::CreateBundle ++\n");
-  printf("\n** nsStringBundleService::CreateBundle: %s\n", aURLSpec ? aURLSpec : "null");
-#endif
-
   return getStringBundle(aURLSpec,aResult);
 }
 
 NS_IMETHODIMP
 nsStringBundleService::CreateExtensibleBundle(const char* aCategory,
                                               nsIStringBundle** aResult)
 {
   NS_ENSURE_ARG_POINTER(aResult);