本文整理汇总了C++中nsAutoPtr::InitiateRequest方法的典型用法代码示例。如果您正苦于以下问题:C++ nsAutoPtr::InitiateRequest方法的具体用法?C++ nsAutoPtr::InitiateRequest怎么用?C++ nsAutoPtr::InitiateRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsAutoPtr
的用法示例。
在下文中一共展示了nsAutoPtr::InitiateRequest方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BackgroundActorCreated
nsresult
QuotaManagerService::InitiateRequest(nsAutoPtr<PendingRequestInfo>& aInfo)
{
// Nothing can be done here if we have previously failed to create a
// background actor.
if (mBackgroundActorFailed) {
return NS_ERROR_FAILURE;
}
if (!mBackgroundActor && mPendingRequests.IsEmpty()) {
if (PBackgroundChild* actor = BackgroundChild::GetForCurrentThread()) {
BackgroundActorCreated(actor);
} else {
// We need to start the sequence to create a background actor for this
// thread.
RefPtr<BackgroundCreateCallback> cb = new BackgroundCreateCallback(this);
if (NS_WARN_IF(!BackgroundChild::GetOrCreateForCurrentThread(cb))) {
return NS_ERROR_FAILURE;
}
}
}
// If we already have a background actor then we can start this request now.
if (mBackgroundActor) {
nsresult rv = aInfo->InitiateRequest(mBackgroundActor);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
} else {
mPendingRequests.AppendElement(aInfo.forget());
}
return NS_OK;
}