Bug 990764 - Replace MOZ_ASSUME_UNREACHABLE in dom. r=smaug
authorChris Peterson <cpeterson@mozilla.com>
Sun, 20 Apr 2014 00:36:40 -0700
changeset 201523 db13bb9473cc40c42900c1d0afd841fe6ea378e2
parent 201522 335bd3cd08025f412bf4f26ab43a5bb74e8f0755
child 201524 8c25478e68dc2068baeb3fbca9701d855c989eaf
push id3741
push userasasaki@mozilla.com
push dateMon, 21 Jul 2014 20:25:18 +0000
treeherdermozilla-beta@4d6f46f5af68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs990764
milestone32.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 990764 - Replace MOZ_ASSUME_UNREACHABLE in dom. r=smaug
dom/asmjscache/AsmJSCache.cpp
dom/audiochannel/AudioChannelService.cpp
dom/base/ScriptSettings.cpp
dom/bluetooth/bluez/BluetoothHfpManager.cpp
dom/camera/DOMCameraControl.cpp
dom/camera/DOMCameraControlListener.cpp
dom/camera/GonkCameraControl.cpp
dom/indexedDB/IDBCursor.cpp
dom/indexedDB/IDBObjectStore.cpp
dom/network/src/NetUtils.h
dom/quota/PersistenceType.h
dom/quota/QuotaManager.cpp
dom/system/gonk/AudioManager.cpp
dom/workers/RuntimeService.cpp
dom/workers/WorkerPrivate.cpp
dom/workers/WorkerRunnable.cpp
dom/workers/XMLHttpRequest.cpp
--- a/dom/asmjscache/AsmJSCache.cpp
+++ b/dom/asmjscache/AsmJSCache.cpp
@@ -1037,21 +1037,21 @@ MainProcessRunnable::Run()
       mState = eFinished;
       OnClose();
       return NS_OK;
     }
 
     case eWaitingToOpenCacheFileForRead:
     case eOpened:
     case eFinished: {
-      MOZ_ASSUME_UNREACHABLE("Shouldn't Run() in this state");
+      MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Shouldn't Run() in this state");
     }
   }
 
-  MOZ_ASSUME_UNREACHABLE("Corrupt state");
+  MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Corrupt state");
   return NS_OK;
 }
 
 bool
 FindHashMatch(const Metadata& aMetadata, const ReadParams& aReadParams,
               unsigned* aModuleIndex)
 {
   // Perform a fast hash of the first sNumFastHashChars chars. Each cache entry
@@ -1506,21 +1506,21 @@ ChildProcessRunnable::Run()
 
       mState = eFinished;
       return NS_OK;
     }
 
     case eOpening:
     case eOpened:
     case eFinished: {
-      MOZ_ASSUME_UNREACHABLE("Shouldn't Run() in this state");
+      MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Shouldn't Run() in this state");
     }
   }
 
-  MOZ_ASSUME_UNREACHABLE("Corrupt state");
+  MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE("Corrupt state");
   return NS_OK;
 }
 
 } // unnamed namespace
 
 void
 DeallocEntryChild(PAsmJSCacheEntryChild* aActor)
 {
@@ -1819,23 +1819,23 @@ public:
   {
     return false;
   }
 
   virtual void
   WaitForStoragesToComplete(nsTArray<nsIOfflineStorage*>& aStorages,
                             nsIRunnable* aCallback) MOZ_OVERRIDE
   {
-    MOZ_ASSUME_UNREACHABLE("There are no storages");
+    MOZ_ASSERT_UNREACHABLE("There are no storages");
   }
 
   virtual void
   AbortTransactionsForStorage(nsIOfflineStorage* aStorage) MOZ_OVERRIDE
   {
-    MOZ_ASSUME_UNREACHABLE("There are no storages");
+    MOZ_ASSERT_UNREACHABLE("There are no storages");
   }
 
   virtual bool
   HasTransactionsForStorage(nsIOfflineStorage* aStorage) MOZ_OVERRIDE
   {
     return false;
   }
 
--- a/dom/audiochannel/AudioChannelService.cpp
+++ b/dom/audiochannel/AudioChannelService.cpp
@@ -745,19 +745,19 @@ AudioChannelService::Observe(nsISupports
       audioManager->SetAudioChannelVolume((int32_t)AudioChannel::Notification, index);
     } else if (keyStr.EqualsLiteral("audio.volume.alarm")) {
       audioManager->SetAudioChannelVolume((int32_t)AudioChannel::Alarm, index);
     } else if (keyStr.EqualsLiteral("audio.volume.telephony")) {
       audioManager->SetAudioChannelVolume((int32_t)AudioChannel::Telephony, index);
     } else if (!keyStr.EqualsLiteral("audio.volume.bt_sco")) {
       // bt_sco is not a valid audio channel so we manipulate it in
       // AudioManager.cpp. And the others should not be used.
-      // We didn't use MOZ_ASSUME_UNREACHABLE here because any web content who
-      // has permission of mozSettings can set any names then it can be easy to
-      // crash the B2G.
+      // We didn't use MOZ_CRASH or MOZ_MAKE_COMPILER_ASSUME_IS_UNREACHABLE here
+      // because any web content who has permission of mozSettings can set any
+      // names then it can be easy to crash the B2G.
       NS_WARNING("unexpected audio channel for volume control");
     }
   }
 #endif
 
   return NS_OK;
 }
 
--- a/dom/base/ScriptSettings.cpp
+++ b/dom/base/ScriptSettings.cpp
@@ -63,17 +63,17 @@ public:
   ScriptSettingsStackEntry* EntryPoint() {
     if (!mStack.Length())
       return nullptr;
     for (int i = mStack.Length() - 1; i >= 0; --i) {
       if (mStack[i]->mIsCandidateEntryPoint) {
         return mStack[i];
       }
     }
-    MOZ_ASSUME_UNREACHABLE("Non-empty stack should always have an entry point");
+    MOZ_CRASH("Non-empty stack should always have an entry point");
   }
 
   nsIGlobalObject* EntryGlobal() {
     ScriptSettingsStackEntry *entry = EntryPoint();
     return entry ? entry->mGlobalObject : nullptr;
   }
 
 private:
--- a/dom/bluetooth/bluez/BluetoothHfpManager.cpp
+++ b/dom/bluetooth/bluez/BluetoothHfpManager.cpp
@@ -1819,17 +1819,17 @@ BluetoothHfpManager::OnSocketDisconnect(
   Reset();
 }
 
 void
 BluetoothHfpManager::OnUpdateSdpRecords(const nsAString& aDeviceAddress)
 {
   // UpdateSdpRecord() is not called so this callback function should not
   // be invoked.
-  MOZ_ASSUME_UNREACHABLE("UpdateSdpRecords() should be called somewhere");
+  MOZ_ASSERT_UNREACHABLE("UpdateSdpRecords() should be called somewhere");
 }
 
 void
 BluetoothHfpManager::OnGetServiceChannel(const nsAString& aDeviceAddress,
                                          const nsAString& aServiceUuid,
                                          int aChannel)
 {
   MOZ_ASSERT(NS_IsMainThread());
--- a/dom/camera/DOMCameraControl.cpp
+++ b/dom/camera/DOMCameraControl.cpp
@@ -174,17 +174,17 @@ nsDOMCameraControl::nsDOMCameraControl(u
       config.mMode = ICameraControl::kPictureMode;
       break;
 
     case CameraMode::Video:
       config.mMode = ICameraControl::kVideoMode;
       break;
 
     default:
-      MOZ_ASSUME_UNREACHABLE("Unanticipated camera mode!");
+      MOZ_ASSERT_UNREACHABLE("Unanticipated camera mode!");
   }
 
   config.mPreviewSize.width = aInitialConfig.mPreviewSize.mWidth;
   config.mPreviewSize.height = aInitialConfig.mPreviewSize.mHeight;
   config.mRecorderProfile = aInitialConfig.mRecorderProfile;
 
   mCameraControl = ICameraControl::Create(aCameraId);
   mCurrentConfiguration = initialConfig.forget();
@@ -1063,17 +1063,17 @@ nsDOMCameraControl::OnHardwareStateChang
       } else if(mOnClosedCb) {
         // If not, something else closed the hardware.
         nsRefPtr<CameraClosedCallback> cb = mOnClosedCb;
         cb->Call(ignored);
       }
       break;
 
     default:
-      MOZ_ASSUME_UNREACHABLE("Unanticipated camera hardware state");
+      MOZ_ASSERT_UNREACHABLE("Unanticipated camera hardware state");
   }
 }
 
 void
 nsDOMCameraControl::OnShutter()
 {
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -1158,17 +1158,17 @@ nsDOMCameraControl::OnRecorderStateChang
       break;
 
     case CameraControlListener::kMediaServerFailed:
       state = NS_LITERAL_STRING("MediaServerFailed");
       break;
 #endif
 
     default:
-      MOZ_ASSUME_UNREACHABLE("Unanticipated video recorder error");
+      MOZ_ASSERT_UNREACHABLE("Unanticipated video recorder error");
       return;
   }
 
   nsRefPtr<CameraRecorderStateChange> cb = mOnRecorderStateChangeCb;
   if (cb) {
     cb->Call(state, ignored);
   }
 }
@@ -1339,17 +1339,17 @@ nsDOMCameraControl::OnUserError(CameraCo
       NS_WARNING("Failed to set thumbnail size");
       return;
 
     default:
       {
         nsPrintfCString msg("Unhandled aContext=%u, aError=0x%x\n", aContext, aError);
         NS_WARNING(msg.get());
       }
-      MOZ_ASSUME_UNREACHABLE("Unhandled user error");
+      MOZ_ASSERT_UNREACHABLE("Unhandled user error");
       return;
   }
 
   if (!errorCb) {
     DOM_CAMERA_LOGW("DOM No error handler for aError=0x%x in aContext=%u\n",
       aError, aContext);
     return;
   }
--- a/dom/camera/DOMCameraControlListener.cpp
+++ b/dom/camera/DOMCameraControlListener.cpp
@@ -126,17 +126,17 @@ DOMCameraControlListener::OnPreviewState
       break;
 
     case kPreviewStarted:
       DOM_CAMERA_LOGI("Preview started\n");
       break;
 
     default:
       DOM_CAMERA_LOGE("Unknown preview state %d\n", aState);
-      MOZ_ASSUME_UNREACHABLE("Invalid preview state");
+      MOZ_ASSERT_UNREACHABLE("Invalid preview state");
       return;
   }
   NS_DispatchToMainThread(new Callback(mDOMCameraControl, aState));
 }
 
 void
 DOMCameraControlListener::OnRecorderStateChange(RecorderState aState,
                                                 int32_t aStatus, int32_t aTrackNum)
--- a/dom/camera/GonkCameraControl.cpp
+++ b/dom/camera/GonkCameraControl.cpp
@@ -216,17 +216,19 @@ nsGonkCameraControl::SetConfigurationInt
       rv = SetPictureConfiguration(aConfig);
       break;
 
     case kVideoMode:
       rv = SetVideoConfiguration(aConfig);
       break;
 
     default:
-      MOZ_ASSUME_UNREACHABLE("Unanticipated camera mode in SetConfigurationInternal()");
+      MOZ_ASSERT_UNREACHABLE("Unanticipated camera mode in SetConfigurationInternal()");
+      rv = NS_ERROR_FAILURE;
+      break;
   }
 
   DOM_CAMERA_LOGT("%s:%d\n", __func__, __LINE__);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mCurrentConfiguration.mMode = aConfig.mMode;
   mCurrentConfiguration.mRecorderProfile = aConfig.mRecorderProfile;
   if (aConfig.mMode == kVideoMode) {
--- a/dom/indexedDB/IDBCursor.cpp
+++ b/dom/indexedDB/IDBCursor.cpp
@@ -346,17 +346,17 @@ IDBCursor::ConvertDirection(mozilla::dom
 
     case mozilla::dom::IDBCursorDirection::Prev:
       return PREV;
 
     case mozilla::dom::IDBCursorDirection::Prevunique:
       return PREV_UNIQUE;
 
     default:
-      MOZ_ASSUME_UNREACHABLE("Unknown direction!");
+      MOZ_CRASH("Unknown direction!");
   }
 }
 
 // static
 already_AddRefed<IDBCursor>
 IDBCursor::CreateCommon(IDBRequest* aRequest,
                         IDBTransaction* aTransaction,
                         IDBObjectStore* aObjectStore,
@@ -487,17 +487,17 @@ IDBCursor::ContinueInternal(const Key& a
       helper = new ContinueIndexHelper(this, aCount);
       break;
 
     case INDEXOBJECT:
       helper = new ContinueIndexObjectHelper(this, aCount);
       break;
 
     default:
-      MOZ_ASSUME_UNREACHABLE("Unknown cursor type!");
+      MOZ_CRASH("Unknown cursor type!");
   }
 
   nsresult rv = helper->DispatchToTransactionPool();
   if (NS_FAILED(rv)) {
     IDB_WARNING("Failed to dispatch!");
     aRv.Throw(NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
     return;
   }
@@ -555,17 +555,17 @@ IDBCursor::WrapObject(JSContext* aCx)
     case INDEXOBJECT:
       return IDBCursorWithValueBinding::Wrap(aCx, this);
 
     case OBJECTSTOREKEY:
     case INDEXKEY:
       return IDBCursorBinding::Wrap(aCx, this);
 
     default:
-      MOZ_ASSUME_UNREACHABLE("Bad type!");
+      MOZ_CRASH("Bad type!");
   }
 }
 
 mozilla::dom::IDBCursorDirection
 IDBCursor::GetDirection() const
 {
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -578,17 +578,17 @@ IDBCursor::GetDirection() const
 
     case PREV:
       return mozilla::dom::IDBCursorDirection::Prev;
 
     case PREV_UNIQUE:
       return mozilla::dom::IDBCursorDirection::Prevunique;
 
     default:
-      MOZ_ASSUME_UNREACHABLE("Bad direction!");
+      MOZ_CRASH("Bad direction!");
   }
 }
 
 void
 IDBCursor::GetSource(OwningIDBObjectStoreOrIDBIndex& aSource) const
 {
   MOZ_ASSERT(NS_IsMainThread());
 
@@ -601,17 +601,17 @@ IDBCursor::GetSource(OwningIDBObjectStor
 
     case INDEXKEY:
     case INDEXOBJECT:
       MOZ_ASSERT(mIndex);
       aSource.SetAsIDBIndex() = mIndex;
       break;
 
     default:
-      MOZ_ASSUME_UNREACHABLE("Bad type!");
+      MOZ_ASSERT_UNREACHABLE("Bad type!");
   }
 }
 
 JS::Value
 IDBCursor::GetKey(JSContext* aCx, ErrorResult& aRv)
 {
   MOZ_ASSERT(NS_IsMainThread());
   MOZ_ASSERT(!mKey.IsUnset() || !mHaveValue);
@@ -719,17 +719,17 @@ IDBCursor::Continue(JSContext* aCx,
       case IDBCursor::PREV_UNIQUE:
         if (key >= mKey) {
           aRv.Throw(NS_ERROR_DOM_INDEXEDDB_DATA_ERR);
           return;
         }
         break;
 
       default:
-        MOZ_ASSUME_UNREACHABLE("Unknown direction type!");
+        MOZ_CRASH("Unknown direction type!");
     }
   }
 
   ContinueInternal(key, 1, aRv);
   if (aRv.Failed()) {
     return;
   }
 
--- a/dom/indexedDB/IDBObjectStore.cpp
+++ b/dom/indexedDB/IDBObjectStore.cpp
@@ -4120,17 +4120,17 @@ OpenKeyCursorHelper::DoDatabaseWork(mozI
       break;
 
     case IDBCursor::PREV:
     case IDBCursor::PREV_UNIQUE:
       directionClause.AppendLiteral(" DESC");
       break;
 
     default:
-      MOZ_ASSUME_UNREACHABLE("Unknown direction type!");
+      MOZ_CRASH("Unknown direction type!");
   }
 
   nsCString firstQuery = queryStart + keyRangeClause + directionClause +
                          openLimit + NS_LITERAL_CSTRING("1");
 
   nsCOMPtr<mozIStorageStatement> stmt =
     mTransaction->GetCachedStatement(firstQuery);
   IDB_ENSURE_TRUE(stmt, NS_ERROR_DOM_INDEXEDDB_UNKNOWN_ERR);
@@ -4192,17 +4192,17 @@ OpenKeyCursorHelper::DoDatabaseWork(mozI
         AppendConditionClause(keyValue, rangeKey, false,
                               !mKeyRange->IsLowerOpen(),
                               continueToKeyRangeClause);
         mRangeKey = mKeyRange->Lower();
       }
       break;
 
     default:
-      MOZ_ASSUME_UNREACHABLE("Unknown direction type!");
+      MOZ_CRASH("Unknown direction type!");
   }
 
   mContinueQuery = queryStart + keyRangeClause + directionClause + openLimit;
   mContinueToQuery = queryStart + continueToKeyRangeClause + directionClause +
                      openLimit;
 
   return NS_OK;
 }
--- a/dom/network/src/NetUtils.h
+++ b/dom/network/src/NetUtils.h
@@ -60,12 +60,12 @@ public:
 
 // Defines a function type with the right arguments and return type.
 #define DEFINE_DLFUNC(name, ret, args...) typedef ret (*FUNC##name)(args);
 
 // Set up a dlsymed function ready to use.
 #define USE_DLFUNC(name)                                                      \
   FUNC##name name = (FUNC##name) dlsym(GetSharedLibrary(), #name);            \
   if (!name) {                                                                \
-    MOZ_ASSUME_UNREACHABLE("Symbol not found in shared library : " #name);    \
+    MOZ_CRASH("Symbol not found in shared library : " #name);                 \
   }
 
 #endif // NetUtils_h
--- a/dom/quota/PersistenceType.h
+++ b/dom/quota/PersistenceType.h
@@ -32,32 +32,30 @@ PersistenceTypeToText(PersistenceType aP
     case PERSISTENCE_TYPE_TEMPORARY:
       aText.AssignLiteral("temporary");
       return;
 
     case PERSISTENCE_TYPE_INVALID:
     default:
       MOZ_CRASH("Bad persistence type value!");
   }
-
-  MOZ_ASSUME_UNREACHABLE("Should never get here!");
 }
 
 inline PersistenceType
 PersistenceTypeFromText(const nsACString& aText)
 {
   if (aText.EqualsLiteral("persistent")) {
     return PERSISTENCE_TYPE_PERSISTENT;
   }
 
   if (aText.EqualsLiteral("temporary")) {
     return PERSISTENCE_TYPE_TEMPORARY;
   }
 
-  MOZ_ASSUME_UNREACHABLE("Should never get here!");
+  MOZ_CRASH("Should never get here!");
 }
 
 inline nsresult
 NullablePersistenceTypeFromText(const nsACString& aText,
                                 Nullable<PersistenceType>* aPersistenceType)
 {
   if (aText.IsVoid()) {
     *aPersistenceType = Nullable<PersistenceType>();
--- a/dom/quota/QuotaManager.cpp
+++ b/dom/quota/QuotaManager.cpp
@@ -425,17 +425,17 @@ public:
         return;
       case OpenAllowed:
         mCallbackState = IO;
         return;
       case IO:
         mCallbackState = Complete;
         return;
       default:
-        MOZ_ASSUME_UNREACHABLE("Can't advance past Complete!");
+        MOZ_ASSERT_UNREACHABLE("Can't advance past Complete!");
     }
   }
 
   nsresult
   Dispatch();
 
   nsresult
   RunImmediately();
--- a/dom/system/gonk/AudioManager.cpp
+++ b/dom/system/gonk/AudioManager.cpp
@@ -139,17 +139,17 @@ public:
                                           volIndex);
     } else if (aName.EqualsLiteral("audio.volume.telephony")) {
       audioManager->SetAudioChannelVolume((int32_t)AudioChannel::Telephony,
                                           volIndex);
     } else if (aName.EqualsLiteral("audio.volume.bt_sco")) {
       static_cast<AudioManager *>(audioManager.get())->SetStreamVolumeIndex(
         AUDIO_STREAM_BLUETOOTH_SCO, volIndex);
     } else {
-      MOZ_ASSUME_UNREACHABLE("unexpected audio channel for initializing "
+      MOZ_ASSERT_UNREACHABLE("unexpected audio channel for initializing "
                              "volume control");
     }
 
     return NS_OK;
   }
 
   NS_IMETHOD HandleError(const nsAString& aName)
   {
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -2445,17 +2445,17 @@ RuntimeService::WorkerThread::Dispatch(n
 }
 
 NS_IMPL_ISUPPORTS(RuntimeService::WorkerThread::Observer, nsIThreadObserver)
 
 NS_IMETHODIMP
 RuntimeService::WorkerThread::Observer::OnDispatchedEvent(
                                                 nsIThreadInternal* /*aThread */)
 {
-  MOZ_ASSUME_UNREACHABLE("This should never be called!");
+  MOZ_CRASH("OnDispatchedEvent() should never be called!");
 }
 
 NS_IMETHODIMP
 RuntimeService::WorkerThread::Observer::OnProcessNextEvent(
                                                nsIThreadInternal* /* aThread */,
                                                bool aMayWait,
                                                uint32_t aRecursionDepth)
 {
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -889,24 +889,24 @@ public:
   CloseEventRunnable(WorkerPrivate* aWorkerPrivate)
   : WorkerRunnable(aWorkerPrivate, WorkerThreadUnchangedBusyCount)
   { }
 
 private:
   virtual bool
   PreDispatch(JSContext* aCx, WorkerPrivate* aWorkerPrivate) MOZ_OVERRIDE
   {
-    MOZ_ASSUME_UNREACHABLE("Don't call Dispatch() on CloseEventRunnable!");
+    MOZ_CRASH("Don't call Dispatch() on CloseEventRunnable!");
   }
 
   virtual void
   PostDispatch(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
                bool aDispatchResult) MOZ_OVERRIDE
   {
-    MOZ_ASSUME_UNREACHABLE("Don't call Dispatch() on CloseEventRunnable!");
+    MOZ_CRASH("Don't call Dispatch() on CloseEventRunnable!");
   }
 
   virtual bool
   WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) MOZ_OVERRIDE
   {
     JS::Rooted<JSObject*> target(aCx, JS::CurrentGlobalOrNull(aCx));
     NS_ASSERTION(target, "This must never be null!");
 
@@ -1495,24 +1495,24 @@ private:
     if (mTimer) {
       mTimer->Cancel();
     }
   }
 
   virtual bool
   PreDispatch(JSContext* aCx, WorkerPrivate* aWorkerPrivate) MOZ_OVERRIDE
   {
-    MOZ_ASSUME_UNREACHABLE("Don't call Dispatch() on KillCloseEventRunnable!");
+    MOZ_CRASH("Don't call Dispatch() on KillCloseEventRunnable!");
   }
 
   virtual void
   PostDispatch(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
                bool aDispatchResult) MOZ_OVERRIDE
   {
-    MOZ_ASSUME_UNREACHABLE("Don't call Dispatch() on KillCloseEventRunnable!");
+    MOZ_CRASH("Don't call Dispatch() on KillCloseEventRunnable!");
   }
 
   virtual bool
   WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) MOZ_OVERRIDE
   {
     if (mTimer) {
       mTimer->Cancel();
       mTimer = nullptr;
@@ -4061,17 +4061,17 @@ WorkerPrivate::DoRunLoop(JSContext* aCx)
     }
     else {
       // The normal event queue has been exhausted, cancel the periodic GC timer
       // and schedule the idle GC timer.
       SetGCTimerMode(IdleTimer);
     }
   }
 
-  MOZ_ASSUME_UNREACHABLE("Shouldn't get here!");
+  MOZ_CRASH("Shouldn't get here!");
 }
 
 void
 WorkerPrivate::OnProcessNextEvent(uint32_t aRecursionDepth)
 {
   AssertIsOnWorkerThread();
   MOZ_ASSERT(aRecursionDepth);
 
--- a/dom/workers/WorkerRunnable.cpp
+++ b/dom/workers/WorkerRunnable.cpp
@@ -62,17 +62,17 @@ WorkerRunnable::PreDispatch(JSContext* a
       MOZ_ASSERT(aCx);
       break;
 
     case WorkerThreadUnchangedBusyCount:
       aWorkerPrivate->AssertIsOnParentThread();
       break;
 
     default:
-      MOZ_ASSUME_UNREACHABLE("Unknown behavior!");
+      MOZ_ASSERT_UNREACHABLE("Unknown behavior!");
   }
 #endif
 
   if (mBehavior == WorkerThreadModifyBusyCount) {
     return aWorkerPrivate->ModifyBusyCount(aCx, true);
   }
 
   return true;
@@ -149,17 +149,17 @@ WorkerRunnable::PostDispatch(JSContext* 
       MOZ_ASSERT(aCx);
       break;
 
     case WorkerThreadUnchangedBusyCount:
       aWorkerPrivate->AssertIsOnParentThread();
       break;
 
     default:
-      MOZ_ASSUME_UNREACHABLE("Unknown behavior!");
+      MOZ_ASSERT_UNREACHABLE("Unknown behavior!");
   }
 #endif
 
   if (!aDispatchResult) {
     if (mBehavior == WorkerThreadModifyBusyCount) {
       aWorkerPrivate->ModifyBusyCount(aCx, false);
     }
     if (aCx) {
@@ -185,17 +185,17 @@ WorkerRunnable::PostRun(JSContext* aCx, 
       aWorkerPrivate->AssertIsOnWorkerThread();
       break;
 
     case WorkerThreadUnchangedBusyCount:
       aWorkerPrivate->AssertIsOnWorkerThread();
       break;
 
     default:
-      MOZ_ASSUME_UNREACHABLE("Unknown behavior!");
+      MOZ_ASSERT_UNREACHABLE("Unknown behavior!");
   }
 #endif
 
   if (mBehavior == WorkerThreadModifyBusyCount) {
     if (!aWorkerPrivate->ModifyBusyCountFromWorker(aCx, false)) {
       aRunResult = false;
     }
   }
--- a/dom/workers/XMLHttpRequest.cpp
+++ b/dom/workers/XMLHttpRequest.cpp
@@ -198,17 +198,17 @@ ConvertStringToResponseType(const nsAStr
     mozilla::dom::XMLHttpRequestResponseTypeValues;
 
   for (size_t index = 0; index < ArrayLength(strings) - 1; index++) {
     if (aString.EqualsASCII(strings[index].value, strings[index].length)) {
       return static_cast<XMLHttpRequestResponseType>(index);
     }
   }
 
-  MOZ_ASSUME_UNREACHABLE("Don't know anything about this response type!");
+  MOZ_CRASH("Don't know anything about this response type!");
 }
 
 enum
 {
   STRING_abort = 0,
   STRING_error,
   STRING_load,
   STRING_loadstart,