• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MOZ_NOT_REACHED函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中MOZ_NOT_REACHED函数的典型用法代码示例。如果您正苦于以下问题:C++ MOZ_NOT_REACHED函数的具体用法?C++ MOZ_NOT_REACHED怎么用?C++ MOZ_NOT_REACHED使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了MOZ_NOT_REACHED函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: switch

SurfaceStream*
SurfaceStream::CreateForType(SurfaceStreamType type, SurfaceStream* prevStream)
{
    switch (type) {
        case SurfaceStreamType::SingleBuffer:
            return new SurfaceStream_SingleBuffer(prevStream);
        case SurfaceStreamType::TripleBuffer_Copy:
            return new SurfaceStream_TripleBuffer_Copy(prevStream);
        case SurfaceStreamType::TripleBuffer:
            return new SurfaceStream_TripleBuffer(prevStream);
        default:
            MOZ_NOT_REACHED("Invalid Type.");
            return nullptr;
    }
}
开发者ID:Web5design,项目名称:mozilla-central,代码行数:15,代码来源:SurfaceStream.cpp


示例17: PixelFormatForImageFormat

static android::PixelFormat
PixelFormatForImageFormat(gfxASurface::gfxImageFormat aFormat)
{
  switch (aFormat) {
  case gfxASurface::ImageFormatARGB32:
    return android::PIXEL_FORMAT_RGBA_8888;
  case gfxASurface::ImageFormatRGB24:
    return android::PIXEL_FORMAT_RGBX_8888;
  case gfxASurface::ImageFormatRGB16_565:
    return android::PIXEL_FORMAT_RGB_565;
  case gfxASurface::ImageFormatA8:
    return android::PIXEL_FORMAT_A_8;
  default:
    MOZ_NOT_REACHED("Unknown gralloc pixel format");
  }
  return gfxASurface::ImageFormatARGB32;
}
开发者ID:hideakihata,项目名称:mozilla-central.fgv,代码行数:17,代码来源:ShadowLayerUtilsGralloc.cpp


示例18: AssertIsOnMainThread

JSContext*
DOMBindingBase::GetJSContextFromContextStack() const
{
  AssertIsOnMainThread();
  MOZ_ASSERT(!mJSContext);

  if (!mContextStack) {
    mContextStack = nsContentUtils::ThreadJSContextStack();
    MOZ_ASSERT(mContextStack);
  }

  JSContext* cx;
  if (NS_FAILED(mContextStack->Peek(&cx))) {
    MOZ_NOT_REACHED("This should never fail!");
  }

  MOZ_ASSERT(cx);
  return cx;
}
开发者ID:AshishNamdev,项目名称:mozilla-central,代码行数:19,代码来源:DOMBindingBase.cpp


示例19: switch

NS_IMETHODIMP
TextComposition::CompositionEventDispatcher::Run()
{
  if (!mPresContext->GetPresShell() ||
      mPresContext->GetPresShell()->IsDestroying()) {
    return NS_OK; // cannot dispatch any events anymore
  }

  nsEventStatus status = nsEventStatus_eIgnore;
  switch (mEventMessage) {
    case NS_COMPOSITION_START: {
      nsCompositionEvent compStart(true, NS_COMPOSITION_START, mWidget);
      nsQueryContentEvent selectedText(true, NS_QUERY_SELECTED_TEXT, mWidget);
      nsContentEventHandler handler(mPresContext);
      handler.OnQuerySelectedText(&selectedText);
      NS_ASSERTION(selectedText.mSucceeded, "Failed to get selected text");
      compStart.data = selectedText.mReply.mString;
      nsIMEStateManager::DispatchCompositionEvent(mEventTarget, mPresContext,
                                                  &compStart, &status, nullptr);
      break;
    }
    case NS_COMPOSITION_UPDATE:
    case NS_COMPOSITION_END: {
      nsCompositionEvent compEvent(true, mEventMessage, mWidget);
      compEvent.data = mData;
      nsIMEStateManager::DispatchCompositionEvent(mEventTarget, mPresContext,
                                                  &compEvent, &status, nullptr);
      break;
    }
    case NS_TEXT_TEXT: {
      nsTextEvent textEvent(true, NS_TEXT_TEXT, mWidget);
      textEvent.theText = mData;
      nsIMEStateManager::DispatchCompositionEvent(mEventTarget, mPresContext,
                                                  &textEvent, &status, nullptr);
      break;
    }
    default:
      MOZ_NOT_REACHED("Unsupported event");
      break;
  }
  return NS_OK;
}
开发者ID:ehsan,项目名称:test-cvs-mc,代码行数:42,代码来源:TextComposition.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MOZ_RELEASE_ASSERT函数代码示例发布时间:2022-05-30
下一篇:
C++ MOZ_LOG函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap