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


C++ PluginAsyncSurrogate类代码示例

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


在下文中一共展示了PluginAsyncSurrogate类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Cast

/* static */ int16_t
PluginAsyncSurrogate::NPP_HandleEvent(NPP aInstance, void* aEvent)
{
  PluginAsyncSurrogate* surrogate = Cast(aInstance);
  MOZ_ASSERT(surrogate);
  return surrogate->NPP_HandleEvent(aEvent);
}
开发者ID:Standard8,项目名称:gecko-dev,代码行数:7,代码来源:PluginAsyncSurrogate.cpp

示例2: IPC_OK

mozilla::ipc::IPCResult
BrowserStreamParent::RecvAsyncNPP_NewStreamResult(const NPError& rv,
                                                  const uint16_t& stype)
{
  PLUGIN_LOG_DEBUG_FUNCTION;
  PluginAsyncSurrogate* surrogate = mNPP->GetAsyncSurrogate();
  MOZ_ASSERT(surrogate);
  surrogate->AsyncCallArriving();
  if (mState == DEFERRING_DESTROY) {
    // We've been asked to destroy ourselves before init was complete.
    mState = DYING;
    Unused << SendNPP_DestroyStream(mDeferredDestroyReason);
    return IPC_OK();
  }

  NPError error = rv;
  if (error == NPERR_NO_ERROR) {
    if (!mStreamListener) {
      return IPC_FAIL_NO_REASON(this);
    }
    if (mStreamListener->SetStreamType(stype)) {
      mState = ALIVE;
    } else {
      error = NPERR_GENERIC_ERROR;
    }
  }

  if (error != NPERR_NO_ERROR) {
    surrogate->DestroyAsyncStream(mStream);
    Unused << PBrowserStreamParent::Send__delete__(this);
  }

  return IPC_OK();
}
开发者ID:Wafflespeanut,项目名称:gecko-dev,代码行数:34,代码来源:BrowserStreamParent.cpp

示例3: Cast

/* static */ NPError
PluginAsyncSurrogate::NPP_DestroyStream(NPP aInstance,
                                        NPStream* aStream,
                                        NPReason aReason)
{
  PluginAsyncSurrogate* surrogate = Cast(aInstance);
  MOZ_ASSERT(surrogate);
  return surrogate->NPP_DestroyStream(aStream, aReason);
}
开发者ID:AtulKumar2,项目名称:gecko-dev,代码行数:9,代码来源:PluginAsyncSurrogate.cpp

示例4:

bool
BrowserStreamParent::RecvAsyncNPP_NewStreamResult(const NPError& rv,
                                                  const uint16_t& stype)
{
  PLUGIN_LOG_DEBUG_FUNCTION;
  PluginAsyncSurrogate* surrogate = mNPP->GetAsyncSurrogate();
  MOZ_ASSERT(surrogate);
  surrogate->AsyncCallArriving();
  nsRefPtr<nsNPAPIPluginStreamListener> streamListener = mStreamListener.forget();
  if (mState == DEFERRING_DESTROY) {
    // We've been asked to destroy ourselves before init was complete.
    mState = DYING;
    unused << SendNPP_DestroyStream(mDeferredDestroyReason);
    return true;
  }

  NPError error = rv;
  if (error == NPERR_NO_ERROR) {
    if (!streamListener) {
      return false;
    }
    if (streamListener->SetStreamType(stype)) {
      mState = ALIVE;
    } else {
      error = NPERR_GENERIC_ERROR;
    }
  }

  if (error != NPERR_NO_ERROR) {
    // We need to clean up the stream
    parent::_destroystream(mNPP->GetNPP(), mStream, NPRES_DONE);
    unused << PBrowserStreamParent::Send__delete__(this);
  }

  return true;
}
开发者ID:Standard8,项目名称:gecko-dev,代码行数:36,代码来源:BrowserStreamParent.cpp


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