зеркало из https://github.com/mozilla/gecko-dev.git
Bug 990764 - Replace MOZ_ASSUME_UNREACHABLE in dom. r=smaug
This commit is contained in:
Родитель
6ee6a846e8
Коммит
aca9b90afe
|
@ -1042,11 +1042,11 @@ MainProcessRunnable::Run()
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -1511,11 +1511,11 @@ ChildProcessRunnable::Run()
|
|||
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;
|
||||
}
|
||||
|
||||
|
@ -1824,13 +1824,13 @@ public:
|
|||
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
|
||||
|
|
|
@ -750,9 +750,9 @@ AudioChannelService::Observe(nsISupports* aSubject, const char* aTopic, const ch
|
|||
} 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");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -68,7 +68,7 @@ public:
|
|||
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() {
|
||||
|
|
|
@ -1824,7 +1824,7 @@ 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
|
||||
|
|
|
@ -179,7 +179,7 @@ nsDOMCameraControl::nsDOMCameraControl(uint32_t aCameraId,
|
|||
break;
|
||||
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Unanticipated camera mode!");
|
||||
MOZ_ASSERT_UNREACHABLE("Unanticipated camera mode!");
|
||||
}
|
||||
|
||||
config.mPreviewSize.width = aInitialConfig.mPreviewSize.mWidth;
|
||||
|
@ -1068,7 +1068,7 @@ nsDOMCameraControl::OnHardwareStateChange(CameraControlListener::HardwareState a
|
|||
break;
|
||||
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Unanticipated camera hardware state");
|
||||
MOZ_ASSERT_UNREACHABLE("Unanticipated camera hardware state");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1163,7 +1163,7 @@ nsDOMCameraControl::OnRecorderStateChange(CameraControlListener::RecorderState a
|
|||
#endif
|
||||
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Unanticipated video recorder error");
|
||||
MOZ_ASSERT_UNREACHABLE("Unanticipated video recorder error");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1344,7 +1344,7 @@ nsDOMCameraControl::OnUserError(CameraControlListener::UserContext aContext, nsr
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ DOMCameraControlListener::OnPreviewStateChange(PreviewState aState)
|
|||
|
||||
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));
|
||||
|
|
|
@ -221,7 +221,9 @@ nsGonkCameraControl::SetConfigurationInternal(const Configuration& 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__);
|
||||
|
|
|
@ -351,7 +351,7 @@ IDBCursor::ConvertDirection(mozilla::dom::IDBCursorDirection aDirection)
|
|||
return PREV_UNIQUE;
|
||||
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Unknown direction!");
|
||||
MOZ_CRASH("Unknown direction!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -492,7 +492,7 @@ IDBCursor::ContinueInternal(const Key& aKey, int32_t aCount, ErrorResult& aRv)
|
|||
break;
|
||||
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Unknown cursor type!");
|
||||
MOZ_CRASH("Unknown cursor type!");
|
||||
}
|
||||
|
||||
nsresult rv = helper->DispatchToTransactionPool();
|
||||
|
@ -560,7 +560,7 @@ IDBCursor::WrapObject(JSContext* aCx)
|
|||
return IDBCursorBinding::Wrap(aCx, this);
|
||||
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Bad type!");
|
||||
MOZ_CRASH("Bad type!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -583,7 +583,7 @@ IDBCursor::GetDirection() const
|
|||
return mozilla::dom::IDBCursorDirection::Prevunique;
|
||||
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Bad direction!");
|
||||
MOZ_CRASH("Bad direction!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -606,7 +606,7 @@ IDBCursor::GetSource(OwningIDBObjectStoreOrIDBIndex& aSource) const
|
|||
break;
|
||||
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Bad type!");
|
||||
MOZ_ASSERT_UNREACHABLE("Bad type!");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -724,7 +724,7 @@ IDBCursor::Continue(JSContext* aCx,
|
|||
break;
|
||||
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Unknown direction type!");
|
||||
MOZ_CRASH("Unknown direction type!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4125,7 +4125,7 @@ OpenKeyCursorHelper::DoDatabaseWork(mozIStorageConnection* /* aConnection */)
|
|||
break;
|
||||
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Unknown direction type!");
|
||||
MOZ_CRASH("Unknown direction type!");
|
||||
}
|
||||
|
||||
nsCString firstQuery = queryStart + keyRangeClause + directionClause +
|
||||
|
@ -4197,7 +4197,7 @@ OpenKeyCursorHelper::DoDatabaseWork(mozIStorageConnection* /* aConnection */)
|
|||
break;
|
||||
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Unknown direction type!");
|
||||
MOZ_CRASH("Unknown direction type!");
|
||||
}
|
||||
|
||||
mContinueQuery = queryStart + keyRangeClause + directionClause + openLimit;
|
||||
|
|
|
@ -65,7 +65,7 @@ public:
|
|||
#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
|
||||
|
|
|
@ -37,8 +37,6 @@ PersistenceTypeToText(PersistenceType aPersistenceType, nsACString& aText)
|
|||
default:
|
||||
MOZ_CRASH("Bad persistence type value!");
|
||||
}
|
||||
|
||||
MOZ_ASSUME_UNREACHABLE("Should never get here!");
|
||||
}
|
||||
|
||||
inline PersistenceType
|
||||
|
@ -52,7 +50,7 @@ PersistenceTypeFromText(const nsACString& aText)
|
|||
return PERSISTENCE_TYPE_TEMPORARY;
|
||||
}
|
||||
|
||||
MOZ_ASSUME_UNREACHABLE("Should never get here!");
|
||||
MOZ_CRASH("Should never get here!");
|
||||
}
|
||||
|
||||
inline nsresult
|
||||
|
|
|
@ -430,7 +430,7 @@ public:
|
|||
mCallbackState = Complete;
|
||||
return;
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Can't advance past Complete!");
|
||||
MOZ_ASSERT_UNREACHABLE("Can't advance past Complete!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ public:
|
|||
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");
|
||||
}
|
||||
|
||||
|
|
|
@ -2450,7 +2450,7 @@ 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
|
||||
|
|
|
@ -894,14 +894,14 @@ 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
|
||||
|
@ -1500,14 +1500,14 @@ private:
|
|||
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
|
||||
|
@ -4066,7 +4066,7 @@ WorkerPrivate::DoRunLoop(JSContext* aCx)
|
|||
}
|
||||
}
|
||||
|
||||
MOZ_ASSUME_UNREACHABLE("Shouldn't get here!");
|
||||
MOZ_CRASH("Shouldn't get here!");
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -67,7 +67,7 @@ WorkerRunnable::PreDispatch(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
|
|||
break;
|
||||
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Unknown behavior!");
|
||||
MOZ_ASSERT_UNREACHABLE("Unknown behavior!");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -154,7 +154,7 @@ WorkerRunnable::PostDispatch(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
|
|||
break;
|
||||
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Unknown behavior!");
|
||||
MOZ_ASSERT_UNREACHABLE("Unknown behavior!");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -190,7 +190,7 @@ WorkerRunnable::PostRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
|
|||
break;
|
||||
|
||||
default:
|
||||
MOZ_ASSUME_UNREACHABLE("Unknown behavior!");
|
||||
MOZ_ASSERT_UNREACHABLE("Unknown behavior!");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -203,7 +203,7 @@ ConvertStringToResponseType(const nsAString& aString)
|
|||
}
|
||||
}
|
||||
|
||||
MOZ_ASSUME_UNREACHABLE("Don't know anything about this response type!");
|
||||
MOZ_CRASH("Don't know anything about this response type!");
|
||||
}
|
||||
|
||||
enum
|
||||
|
|
Загрузка…
Ссылка в новой задаче