本文整理汇总了C++中webcore::HistoryItem::bridge方法的典型用法代码示例。如果您正苦于以下问题:C++ HistoryItem::bridge方法的具体用法?C++ HistoryItem::bridge怎么用?C++ HistoryItem::bridge使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webcore::HistoryItem
的用法示例。
在下文中一共展示了HistoryItem::bridge方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write_children_recursive
static void write_children_recursive(WTF::Vector<char>& v, WebCore::HistoryItem* parent)
{
const WebCore::HistoryItemVector& children = parent->children();
WebCore::HistoryItemVector::const_iterator end = children.end();
for (WebCore::HistoryItemVector::const_iterator i = children.begin(); i != end; ++i) {
WebCore::HistoryItem* item = (*i).get();
LOG_ASSERT(parent->bridge(),
"The parent item should have a bridge object!");
if (!item->bridge()) {
WebHistoryItem* bridge = new WebHistoryItem(static_cast<WebHistoryItem*>(parent->bridge()));
item->setBridge(bridge);
bridge->setActive();
} else {
// The only time this item's parent may not be the same as the
// parent's bridge is during history close. In that case, the
// parent must not have a parent bridge.
WebHistoryItem* bridge = static_cast<WebHistoryItem*>(item->bridge());
WebHistoryItem* parentBridge = static_cast<WebHistoryItem*>(parent->bridge());
LOG_ASSERT(parentBridge->parent() == 0 ||
bridge->parent() == parentBridge,
"Somehow this item has an incorrect parent");
bridge->setParent(parentBridge);
}
write_item(v, item);
write_children_recursive(v, item);
}
}