本文整理汇总了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);
}
示例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();
}
示例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);
}
示例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;
}