当前位置: 首页>>代码示例>>C++>>正文


C++ MOZ_NOT_REACHED函数代码示例

本文整理汇总了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();
}
开发者ID:BrunoReX,项目名称:palemoon,代码行数:27,代码来源:LinuxPower.cpp

示例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;
}
开发者ID:AshishNamdev,项目名称:mozilla-central,代码行数:29,代码来源:SmsParent.cpp

示例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;
}
开发者ID:hibrium,项目名称:Pale-Moon,代码行数:25,代码来源:nsJARProtocolHandler.cpp

示例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;
}
开发者ID:RickEyre,项目名称:mozilla-central,代码行数:30,代码来源:GLScreenBuffer.cpp

示例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;
  }
}
开发者ID:BrunoReX,项目名称:palemoon,代码行数:29,代码来源:TextureHost.cpp

示例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;
}
开发者ID:BitVapor,项目名称:Pale-Moon,代码行数:28,代码来源:TCPSocketParent.cpp

示例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;
}
开发者ID:hibrium,项目名称:Pale-Moon,代码行数:26,代码来源:WidgetUtils.cpp

示例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;
  }
}
开发者ID:BrunoReX,项目名称:palemoon,代码行数:28,代码来源:CompositableHost.cpp

示例9: MOZ_NOT_REACHED

nsresult
BluetoothServiceChildProcess::GetDevicePropertiesInternal(
                                                 const BluetoothSignal& aSignal)
{
  MOZ_NOT_REACHED("Should never be called from child");
  return NS_ERROR_NOT_IMPLEMENTED;
}
开发者ID:KyleBarnhart,项目名称:mozilla-central,代码行数:7,代码来源:BluetoothServiceChildProcess.cpp

示例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;
}
开发者ID:bjacob,项目名称:mozilla-central,代码行数:26,代码来源:TCPSocketParent.cpp

示例11: MOZ_NOT_REACHED

bool
BluetoothServiceChildProcess::UpdateSdpRecords(const nsAString& aDeviceAddress,
                                               BluetoothProfileManagerBase* aManager)
{
  MOZ_NOT_REACHED("This should never be called!");
  return false;
}
开发者ID:RickEyre,项目名称:mozilla-central,代码行数:7,代码来源:BluetoothServiceChildProcess.cpp

示例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;
  }
}
开发者ID:FunkyVerb,项目名称:devtools-window,代码行数:28,代码来源:Telemetry.cpp

示例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(),
              &params)) {
        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;
}
开发者ID:haluto,项目名称:appmanager,代码行数:34,代码来源:SmsParent.cpp

示例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!");
  }
}
开发者ID:Lynart,项目名称:mozilla-central,代码行数:19,代码来源:InputStreamUtils.cpp

示例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;
}
开发者ID:Web5design,项目名称:mozilla-central,代码行数:11,代码来源:BluetoothServiceChildProcess.cpp


注:本文中的MOZ_NOT_REACHED函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。