本文整理汇总了C++中XPCWrappedNative::HasMutatedSet方法的典型用法代码示例。如果您正苦于以下问题:C++ XPCWrappedNative::HasMutatedSet方法的具体用法?C++ XPCWrappedNative::HasMutatedSet怎么用?C++ XPCWrappedNative::HasMutatedSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XPCWrappedNative
的用法示例。
在下文中一共展示了XPCWrappedNative::HasMutatedSet方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ccx
bool
XPC_WN_Shared_Enumerate(JSContext* cx, HandleObject obj)
{
XPCCallContext ccx(cx, obj);
XPCWrappedNative* wrapper = ccx.GetWrapper();
THROW_AND_RETURN_IF_BAD_WRAPPER(cx, wrapper);
// Since we aren't going to enumerate tearoff names and the prototype
// handles non-mutated members, we can do this potential short-circuit.
if (!wrapper->HasMutatedSet())
return true;
XPCNativeSet* set = wrapper->GetSet();
XPCNativeSet* protoSet = wrapper->HasProto() ?
wrapper->GetProto()->GetSet() : nullptr;
uint16_t interface_count = set->GetInterfaceCount();
XPCNativeInterface** interfaceArray = set->GetInterfaceArray();
for (uint16_t i = 0; i < interface_count; i++) {
XPCNativeInterface* iface = interfaceArray[i];
uint16_t member_count = iface->GetMemberCount();
for (uint16_t k = 0; k < member_count; k++) {
XPCNativeMember* member = iface->GetMemberAt(k);
jsid name = member->GetName();
// Skip if this member is going to come from the proto.
uint16_t index;
if (protoSet &&
protoSet->FindMember(name, nullptr, &index) && index == i)
continue;
if (!xpc_ForcePropertyResolve(cx, obj, name))
return false;
}
}
return true;
}