本文整理汇总了C++中XPCWrappedNative::SystemIsBeingShutDown方法的典型用法代码示例。如果您正苦于以下问题:C++ XPCWrappedNative::SystemIsBeingShutDown方法的具体用法?C++ XPCWrappedNative::SystemIsBeingShutDown怎么用?C++ XPCWrappedNative::SystemIsBeingShutDown使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XPCWrappedNative
的用法示例。
在下文中一共展示了XPCWrappedNative::SystemIsBeingShutDown方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
static JSDHashOperator
WrappedNativeShutdownEnumerator(JSDHashTable *table, JSDHashEntryHdr *hdr,
uint32_t number, void *arg)
{
ShutdownData* data = (ShutdownData*) arg;
XPCWrappedNative* wrapper = ((Native2WrappedNativeMap::Entry*)hdr)->value;
if (wrapper->IsValid()) {
wrapper->SystemIsBeingShutDown();
data->wrapperCount++;
}
return JS_DHASH_REMOVE;
}
示例2: while
//static
void
XPCWrappedNativeScope::SystemIsBeingShutDown()
{
int liveScopeCount = 0;
XPCWrappedNativeScope* cur;
// First move all the scopes to the dying list.
cur = gScopes;
while (cur) {
XPCWrappedNativeScope* next = cur->mNext;
cur->mNext = gDyingScopes;
gDyingScopes = cur;
cur = next;
liveScopeCount++;
}
gScopes = nullptr;
// We're forcibly killing scopes, rather than allowing them to go away
// when they're ready. As such, we need to do some cleanup before they
// can safely be destroyed.
for (cur = gDyingScopes; cur; cur = cur->mNext) {
// Give the Components object a chance to try to clean up.
if (cur->mComponents)
cur->mComponents->SystemIsBeingShutDown();
// Walk the protos first. Wrapper shutdown can leave dangling
// proto pointers in the proto map.
for (auto i = cur->mWrappedNativeProtoMap->Iter(); !i.Done(); i.Next()) {
auto entry = static_cast<ClassInfo2WrappedNativeProtoMap::Entry*>(i.Get());
entry->value->SystemIsBeingShutDown();
i.Remove();
}
for (auto i = cur->mWrappedNativeMap->Iter(); !i.Done(); i.Next()) {
auto entry = static_cast<Native2WrappedNativeMap::Entry*>(i.Get());
XPCWrappedNative* wrapper = entry->value;
if (wrapper->IsValid()) {
wrapper->SystemIsBeingShutDown();
}
i.Remove();
}
}
// Now it is safe to kill all the scopes.
KillDyingScopes();
}