本文整理汇总了C++中XPCPerThreadData::GetCallContext方法的典型用法代码示例。如果您正苦于以下问题:C++ XPCPerThreadData::GetCallContext方法的具体用法?C++ XPCPerThreadData::GetCallContext怎么用?C++ XPCPerThreadData::GetCallContext使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XPCPerThreadData
的用法示例。
在下文中一共展示了XPCPerThreadData::GetCallContext方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GCCallback
//.........这里部分代码省略.........
// NativeSets, and the WrappedNativeJSClasses...
// Do the marking...
XPCWrappedNativeScope::MarkAllWrappedNativesAndProtos();
self->mDetachedWrappedNativeProtoMap->
Enumerate(DetachedWrappedNativeProtoMarker, nsnull);
// Mark the sets used in the call contexts. There is a small
// chance that a wrapper's set will change *while* a call is
// happening which uses that wrapper's old interfface set. So,
// we need to do this marking to avoid collecting those sets
// that might no longer be otherwise reachable from the wrappers
// or the wrapperprotos.
// Skip this part if XPConnect is shutting down. We get into
// bad locking problems with the thread iteration otherwise.
if(!self->GetXPConnect()->IsShuttingDown())
{
PRLock* threadLock = XPCPerThreadData::GetLock();
if(threadLock)
{ // scoped lock
nsAutoLock lock(threadLock);
XPCPerThreadData* iterp = nsnull;
XPCPerThreadData* thread;
while(nsnull != (thread =
XPCPerThreadData::IterateThreads(&iterp)))
{
// Mark those AutoMarkingPtr lists!
thread->MarkAutoRootsAfterJSFinalize();
XPCCallContext* ccxp = thread->GetCallContext();
while(ccxp)
{
// Deal with the strictness of callcontext that
// complains if you ask for a set when
// it is in a state where the set could not
// possibly be valid.
if(ccxp->CanGetSet())
{
XPCNativeSet* set = ccxp->GetSet();
if(set)
set->Mark();
}
if(ccxp->CanGetInterface())
{
XPCNativeInterface* iface = ccxp->GetInterface();
if(iface)
iface->Mark();
}
ccxp = ccxp->GetPrevCallContext();
}
}
}
}
// Do the sweeping...
// We don't want to sweep the JSClasses at shutdown time.
// At this point there may be JSObjects using them that have
// been removed from the other maps.
if(!self->GetXPConnect()->IsShuttingDown())
{
self->mNativeScriptableSharedMap->