static PassRefPtr<HistoryItem> itemForExport(HistoryNode* historyNode) { ASSERT(historyNode); RefPtr<HistoryItem> item = historyNode->value()->copy(); const Vector<OwnPtr<HistoryNode> >& childEntries = historyNode->children(); for (size_t i = 0; i < childEntries.size(); i++) item->addChildItem(itemForExport(childEntries[i].get())); return item; }
PassRefPtr<HistoryItem> HistoryController::previousItemForExport() { if (!m_previousEntry) return nullptr; return itemForExport(m_previousEntry->rootHistoryNode()); }
PassRefPtr<HistoryItem> HistoryController::currentItemForExport() { if (!m_currentEntry) return nullptr; return itemForExport(m_currentEntry->rootHistoryNode()); }