本文整理汇总了C++中ObjectId::isNull方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectId::isNull方法的具体用法?C++ ObjectId::isNull怎么用?C++ ObjectId::isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectId
的用法示例。
在下文中一共展示了ObjectId::isNull方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetProxyExtra
ObjectId
WrapperOwner::idOfUnchecked(JSObject *obj)
{
MOZ_ASSERT(IsCPOW(obj));
Value v = GetProxyExtra(obj, 1);
MOZ_ASSERT(v.isDouble());
ObjectId objId = ObjectId::deserialize(BitwiseCast<uint64_t>(v.toDouble()));
MOZ_ASSERT(!objId.isNull());
return objId;
}
示例2: contextMenu
void QtIVIWidget::contextMenu(QPoint pos)
{
QModelIndex index = m_objectTreeView->indexAt(pos);
if (!index.isValid())
return;
index = index.sibling(index.row(), 0);
const ObjectId objectId = index.data(ObjectModel::ObjectIdRole).value<ObjectId>();
if (objectId.isNull())
return;
QMenu menu;
ContextMenuExtension ext(objectId);
ext.populateMenu(&menu);
menu.exec(m_objectTreeView->viewport()->mapToGlobal(pos));
}
示例3: obj
bool
WrapperOwner::toObjectVariant(JSContext* cx, JSObject* objArg, ObjectVariant* objVarp)
{
RootedObject obj(cx, objArg);
MOZ_ASSERT(obj);
// We always save objects unwrapped in the CPOW table. If we stored
// wrappers, then the wrapper might be GCed while the target remained alive.
// Whenever operating on an object that comes from the table, we wrap it
// in findObjectById.
unsigned wrapperFlags = 0;
obj = js::UncheckedUnwrap(obj, true, &wrapperFlags);
if (obj && IsCPOW(obj) && OwnerOf(obj) == this) {
*objVarp = LocalObject(idOf(obj).serialize());
return true;
}
bool waiveXray = wrapperFlags & xpc::WrapperFactory::WAIVE_XRAY_WRAPPER_FLAG;
ObjectId id = objectIdMap(waiveXray).find(obj);
if (!id.isNull()) {
MOZ_ASSERT(id.hasXrayWaiver() == waiveXray);
*objVarp = MakeRemoteObject(cx, id, obj);
return true;
}
// Need to call PreserveWrapper on |obj| in case it's a reflector.
// FIXME: What if it's an XPCWrappedNative?
if (mozilla::dom::IsDOMObject(obj))
mozilla::dom::TryPreserveWrapper(obj);
id = ObjectId(nextSerialNumber_++, waiveXray);
if (!objects_.add(id, obj))
return false;
if (!objectIdMap(waiveXray).add(cx, obj, id))
return false;
*objVarp = MakeRemoteObject(cx, id, obj);
return true;
}