本文整理汇总了C++中MOZ_NOT_REACHED函数的典型用法代码示例。如果您正苦于以下问题:C++ MOZ_NOT_REACHED函数的具体用法?C++ MOZ_NOT_REACHED怎么用?C++ MOZ_NOT_REACHED使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了MOZ_NOT_REACHED函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QuitHard
// Function to complusively shut down the system with a given mode.
static void
QuitHard(hal::ShutdownMode aMode)
{
switch (aMode)
{
case hal::eHalShutdownMode_PowerOff:
PowerOff();
break;
case hal::eHalShutdownMode_Reboot:
Reboot();
break;
case hal::eHalShutdownMode_Restart:
// Don't let signal handlers affect forced shutdown.
kill(0, SIGKILL);
// If we can't SIGKILL our process group, something is badly
// wrong. Trying to deliver a catch-able signal to ourselves can
// invoke signal handlers and might cause problems. So try
// _exit() and hope we go away.
_exit(1);
break;
default:
MOZ_NOT_REACHED();
break;
}
MOZ_NOT_REACHED();
}
示例2: switch
bool
SmsParent::RecvPSmsRequestConstructor(PSmsRequestParent* aActor,
const IPCSmsRequest& aRequest)
{
SmsRequestParent* actor = static_cast<SmsRequestParent*>(aActor);
switch (aRequest.type()) {
case IPCSmsRequest::TCreateMessageListRequest:
return actor->DoRequest(aRequest.get_CreateMessageListRequest());
case IPCSmsRequest::TSendMessageRequest:
return actor->DoRequest(aRequest.get_SendMessageRequest());
case IPCSmsRequest::TGetMessageRequest:
return actor->DoRequest(aRequest.get_GetMessageRequest());
case IPCSmsRequest::TDeleteMessageRequest:
return actor->DoRequest(aRequest.get_DeleteMessageRequest());
case IPCSmsRequest::TGetNextMessageInListRequest:
return actor->DoRequest(aRequest.get_GetNextMessageInListRequest());
case IPCSmsRequest::TMarkMessageReadRequest:
return actor->DoRequest(aRequest.get_MarkMessageReadRequest());
case IPCSmsRequest::TGetThreadListRequest:
return actor->DoRequest(aRequest.get_GetThreadListRequest());
default:
MOZ_NOT_REACHED("Unknown type!");
return false;
}
MOZ_NOT_REACHED("Should never get here!");
return false;
}
示例3: MOZ_ASSERT
bool
nsJARProtocolHandler::RemoteOpenFileInProgress(
nsIHashable *aRemoteFile,
nsIRemoteOpenFileListener *aListener)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aRemoteFile);
MOZ_ASSERT(aListener);
if (IsMainProcess()) {
MOZ_NOT_REACHED("Shouldn't be called in the main process!");
return false;
}
RemoteFileListenerArray *listeners;
if (mRemoteFileListeners.Get(aRemoteFile, &listeners)) {
listeners->AppendElement(aListener);
return true;
}
// We deliberately don't put the listener in the new array since the first
// load is handled differently.
mRemoteFileListeners.Put(aRemoteFile, new RemoteFileListenerArray());
return false;
}
示例4: MOZ_ASSERT
void
ReadBuffer::Attach(SharedSurface_GL* surf)
{
MOZ_ASSERT(surf && mSurf);
MOZ_ASSERT(surf->AttachType() == mSurf->AttachType());
MOZ_ASSERT(surf->Size() == mSurf->Size());
// Nothing else is needed for AttachType Screen.
if (surf->AttachType() != AttachmentType::Screen) {
GLuint colorTex = 0;
GLuint colorRB = 0;
switch (surf->AttachType()) {
case AttachmentType::GLTexture:
colorTex = surf->Texture();
break;
case AttachmentType::GLRenderbuffer:
colorRB = surf->Renderbuffer();
break;
default:
MOZ_NOT_REACHED("Unknown attachment type?");
return;
}
mGL->AttachBuffersToFB(colorTex, colorRB, 0, 0, mFB);
MOZ_ASSERT(mGL->IsFramebufferComplete(mFB));
}
mSurf = surf;
}
示例5: switch
/* static */ TemporaryRef<TextureHost>
TextureHost::CreateTextureHost(SurfaceDescriptorType aDescriptorType,
uint32_t aTextureHostFlags,
uint32_t aTextureFlags)
{
switch (Compositor::GetBackend()) {
case LAYERS_OPENGL:
return CreateTextureHostOGL(aDescriptorType,
aTextureHostFlags,
aTextureFlags);
case LAYERS_D3D9:
return CreateTextureHostD3D9(aDescriptorType,
aTextureHostFlags,
aTextureFlags);
#ifdef XP_WIN
case LAYERS_D3D11:
return CreateTextureHostD3D11(aDescriptorType,
aTextureHostFlags,
aTextureFlags);
#endif
case LAYERS_BASIC:
return CreateBasicTextureHost(aDescriptorType,
aTextureHostFlags,
aTextureFlags);
default:
MOZ_NOT_REACHED("Couldn't create texture host");
return nullptr;
}
}
示例6: NS_ENSURE_TRUE
bool
TCPSocketParent::RecvData(const SendableData& aData)
{
NS_ENSURE_TRUE(mIntermediary, true);
nsresult rv;
switch (aData.type()) {
case SendableData::TArrayOfuint8_t: {
AutoSafeJSContext cx;
JS::Rooted<JS::Value> val(cx);
JS::Rooted<JSObject*> obj(cx, mIntermediaryObj);
IPC::DeserializeArrayBuffer(obj, aData.get_ArrayOfuint8_t(), &val);
rv = mIntermediary->SendArrayBuffer(val);
NS_ENSURE_SUCCESS(rv, true);
break;
}
case SendableData::TnsString:
rv = mIntermediary->SendString(aData.get_nsString());
NS_ENSURE_SUCCESS(rv, true);
break;
default:
MOZ_NOT_REACHED("unexpected SendableData type");
return false;
}
return true;
}
示例7: ComputeTransformForRotation
gfxMatrix
ComputeTransformForRotation(const nsIntRect& aBounds,
ScreenRotation aRotation)
{
gfxMatrix transform;
switch (aRotation) {
case ROTATION_0:
break;
case ROTATION_90:
transform.Translate(gfxPoint(aBounds.width, 0));
transform.Rotate(M_PI / 2);
break;
case ROTATION_180:
transform.Translate(gfxPoint(aBounds.width, aBounds.height));
transform.Rotate(M_PI);
break;
case ROTATION_270:
transform.Translate(gfxPoint(0, aBounds.height));
transform.Rotate(M_PI * 3 / 2);
break;
default:
MOZ_NOT_REACHED("Unknown rotation");
break;
}
return transform;
}
示例8: switch
/* static */ TemporaryRef<CompositableHost>
CompositableHost::Create(const TextureInfo& aTextureInfo)
{
RefPtr<CompositableHost> result;
switch (aTextureInfo.mCompositableType) {
case BUFFER_IMAGE_BUFFERED:
result = new ImageHostBuffered(aTextureInfo);
return result;
case BUFFER_IMAGE_SINGLE:
result = new ImageHostSingle(aTextureInfo);
return result;
case BUFFER_TILED:
result = new TiledContentHost(aTextureInfo);
return result;
case BUFFER_CONTENT:
result = new ContentHostSingleBuffered(aTextureInfo);
return result;
case BUFFER_CONTENT_DIRECT:
result = new ContentHostDoubleBuffered(aTextureInfo);
return result;
case BUFFER_CONTENT_INC:
result = new ContentHostIncremental(aTextureInfo);
return result;
default:
MOZ_NOT_REACHED("Unknown CompositableType");
return nullptr;
}
}
示例9: MOZ_NOT_REACHED
nsresult
BluetoothServiceChildProcess::GetDevicePropertiesInternal(
const BluetoothSignal& aSignal)
{
MOZ_NOT_REACHED("Should never be called from child");
return NS_ERROR_NOT_IMPLEMENTED;
}
示例10: NS_ENSURE_TRUE
bool
TCPSocketParent::RecvData(const SendableData& aData)
{
NS_ENSURE_TRUE(mIntermediary, true);
nsresult rv;
switch (aData.type()) {
case SendableData::TArrayOfuint8_t: {
jsval val;
IPC::DeserializeUint8Array(mIntermediaryObj, aData.get_ArrayOfuint8_t(), &val);
rv = mIntermediary->SendArrayBuffer(val);
NS_ENSURE_SUCCESS(rv, true);
break;
}
case SendableData::TnsString:
rv = mIntermediary->SendString(aData.get_nsString());
NS_ENSURE_SUCCESS(rv, true);
break;
default:
MOZ_NOT_REACHED();
return false;
}
return true;
}
示例11: MOZ_NOT_REACHED
bool
BluetoothServiceChildProcess::UpdateSdpRecords(const nsAString& aDeviceAddress,
BluetoothProfileManagerBase* aManager)
{
MOZ_NOT_REACHED("This should never be called!");
return false;
}
示例12: JSHistogram_Snapshot
JSBool
JSHistogram_Snapshot(JSContext *cx, unsigned argc, jsval *vp)
{
JSObject *obj = JS_THIS_OBJECT(cx, vp);
if (!obj) {
return JS_FALSE;
}
Histogram *h = static_cast<Histogram*>(JS_GetPrivate(obj));
JSObject *snapshot = JS_NewObject(cx, nullptr, nullptr, nullptr);
if (!snapshot)
return JS_FALSE;
JS::AutoObjectRooter sroot(cx, snapshot);
switch (ReflectHistogramSnapshot(cx, snapshot, h)) {
case REFLECT_FAILURE:
return JS_FALSE;
case REFLECT_CORRUPT:
JS_ReportError(cx, "Histogram is corrupt");
return JS_FALSE;
case REFLECT_OK:
JS_SET_RVAL(cx, vp, OBJECT_TO_JSVAL(snapshot));
return JS_TRUE;
default:
MOZ_NOT_REACHED("unhandled reflection status");
return JS_FALSE;
}
}
示例13: switch
bool
SmsRequestParent::DoRequest(const SendMessageRequest& aRequest)
{
switch(aRequest.type()) {
case SendMessageRequest::TSendSmsMessageRequest: {
nsCOMPtr<nsISmsService> smsService = do_GetService(SMS_SERVICE_CONTRACTID);
NS_ENSURE_TRUE(smsService, true);
const SendSmsMessageRequest &data = aRequest.get_SendSmsMessageRequest();
smsService->Send(data.number(), data.message(), this);
}
break;
case SendMessageRequest::TSendMmsMessageRequest: {
nsCOMPtr<nsIMmsService> mmsService = do_GetService(MMS_SERVICE_CONTRACTID);
NS_ENSURE_TRUE(mmsService, true);
JS::Value params;
JSContext* cx = nsContentUtils::GetSafeJSContext();
if (!GetParamsFromSendMmsMessageRequest(
cx,
aRequest.get_SendMmsMessageRequest(),
¶ms)) {
NS_WARNING("SmsRequestParent: Fail to build MMS params.");
return true;
}
mmsService->Send(params, this);
}
break;
default:
MOZ_NOT_REACHED("Unknown type of SendMessageRequest!");
return false;
}
return true;
}
示例14: SerializeInputStream
void
SerializeInputStream(nsIInputStream* aInputStream,
InputStreamParams& aParams)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aInputStream);
nsCOMPtr<nsIIPCSerializableInputStream> serializable =
do_QueryInterface(aInputStream);
if (!serializable) {
MOZ_NOT_REACHED("Input stream is not serializable!");
}
serializable->Serialize(aParams);
if (aParams.type() == InputStreamParams::T__None) {
MOZ_NOT_REACHED("Serialize failed!");
}
}
示例15: MOZ_NOT_REACHED
nsresult
BluetoothServiceChildProcess::ListenSocketViaService(
int aChannel,
BluetoothSocketType aType,
bool aAuth,
bool aEncrypt,
mozilla::ipc::UnixSocketConsumer* aConsumer)
{
MOZ_NOT_REACHED("This should never be called!");
return NS_ERROR_FAILURE;
}