Bug 838349 - Fix bogus use of assertions in Places
authorMarco Bonardo <mbonardo@mozilla.com>
Wed, 06 Feb 2013 02:37:07 +0100
changeset 130852 b45420e3fa090064a31ed435543aafa2c371df82
parent 130851 3a7b2f3a36a6233a7c9479b4fe64f0e322bd559a
child 130853 57f2e0ad71a951ec321eb646cd627aad8f6d730e
push id2323
push userbbajaj@mozilla.com
push dateMon, 01 Apr 2013 19:47:02 +0000
treeherdermozilla-beta@7712be144d91 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs838349
milestone21.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 838349 - Fix bogus use of assertions in Places r=trivial
toolkit/components/places/AsyncFaviconHelpers.cpp
toolkit/components/places/Database.cpp
toolkit/components/places/History.cpp
toolkit/components/places/nsAnnotationService.cpp
--- a/toolkit/components/places/AsyncFaviconHelpers.cpp
+++ b/toolkit/components/places/AsyncFaviconHelpers.cpp
@@ -878,17 +878,17 @@ AsyncGetFaviconDataForPage::Run()
 
   PageData pageData;
   pageData.spec.Assign(mPageSpec);
 
   if (!iconSpec.IsEmpty()) {
     rv = FetchIconInfo(mDB, iconData);
     if (NS_FAILED(rv)) {
       iconData.spec.Truncate();
-      MOZ_NOT_REACHED("Fetching favicon information failed unexpectedly.");
+      MOZ_ASSERT(false, "Fetching favicon information failed unexpectedly.");
     }
   }
 
   nsCOMPtr<nsIRunnable> event =
     new NotifyIconObservers(iconData, pageData, mCallback);
   rv = NS_DispatchToMainThread(event);
   NS_ENSURE_SUCCESS(rv, rv);
   return NS_OK;
--- a/toolkit/components/places/Database.cpp
+++ b/toolkit/components/places/Database.cpp
@@ -161,17 +161,17 @@ updateSQLiteStatistics(mozIStorageConnec
 enum JournalMode
 SetJournalMode(nsCOMPtr<mozIStorageConnection>& aDBConn,
                              enum JournalMode aJournalMode)
 {
   MOZ_ASSERT(NS_IsMainThread());
   nsAutoCString journalMode;
   switch (aJournalMode) {
     default:
-      MOZ_ASSERT("Trying to set an unknown journal mode.");
+      MOZ_ASSERT(false, "Trying to set an unknown journal mode.");
       // Fall through to the default DELETE journal.
     case JOURNAL_DELETE:
       journalMode.AssignLiteral("delete");
       break;
     case JOURNAL_TRUNCATE:
       journalMode.AssignLiteral("truncate");
       break;
     case JOURNAL_MEMORY:
--- a/toolkit/components/places/History.cpp
+++ b/toolkit/components/places/History.cpp
@@ -194,17 +194,17 @@ class PlaceHashKey : public nsCStringHas
     , visitCount(-1)
     , bookmarked(-1)
     {
     }
 
     PlaceHashKey(const PlaceHashKey& aOther)
     : nsCStringHashKey(&aOther.GetKey())
     {
-      MOZ_ASSERT("Do not call me!");
+      MOZ_ASSERT(false, "Do not call me!");
     }
 
     // Visit count for this place.
     int32_t visitCount;
     // Whether this place is bookmarked.
     int32_t bookmarked;
     // Array of VisitData objects.
     nsTArray<VisitData> visits;
--- a/toolkit/components/places/nsAnnotationService.cpp
+++ b/toolkit/components/places/nsAnnotationService.cpp
@@ -1283,17 +1283,17 @@ nsAnnotationService::GetAnnotationsWithN
         nsAutoString valueString;
         rv = stmt->GetString(4, valueString);
         NS_ENSURE_SUCCESS(rv, rv);
 
         rv = variant->SetAsAString(valueString);
         break;
       }
       default:
-        MOZ_ASSERT("Unsupported annotation type");
+        MOZ_ASSERT(false, "Unsupported annotation type");
         // Move to the next result.
         continue;
     }
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<mozIAnnotatedResult> anno = new AnnotatedResult(guid, uri, itemId,
                                                              aName, variant);
     NS_ENSURE_TRUE(annotations.AppendObject(anno), NS_ERROR_OUT_OF_MEMORY);