void HistoryController::goToEntry(PassOwnPtr<HistoryEntry> targetEntry, ResourceRequestCachePolicy cachePolicy) { HistoryFrameLoadSet sameDocumentLoads; HistoryFrameLoadSet differentDocumentLoads; m_provisionalEntry = targetEntry; if (m_currentEntry) recursiveGoToEntry(m_page->mainFrame(), sameDocumentLoads, differentDocumentLoads); else differentDocumentLoads.set(m_page->mainFrame(), m_provisionalEntry->root()); if (sameDocumentLoads.isEmpty() && differentDocumentLoads.isEmpty()) sameDocumentLoads.set(m_page->mainFrame(), m_provisionalEntry->root()); if (differentDocumentLoads.isEmpty()) { m_previousEntry = m_currentEntry.release(); m_currentEntry = m_provisionalEntry.release(); } for (HistoryFrameLoadSet::iterator it = sameDocumentLoads.begin(); it != sameDocumentLoads.end(); ++it) { if (it->key->host()) it->key->loader().loadHistoryItem(it->value.get(), HistorySameDocumentLoad, cachePolicy); } for (HistoryFrameLoadSet::iterator it = differentDocumentLoads.begin(); it != differentDocumentLoads.end(); ++it) { if (it->key->host()) it->key->loader().loadHistoryItem(it->value.get(), HistoryDifferentDocumentLoad, cachePolicy); } }
void HistoryController::recursiveGoToEntry(LocalFrame* frame, HistoryFrameLoadSet& sameDocumentLoads, HistoryFrameLoadSet& differentDocumentLoads) { ASSERT(m_provisionalEntry); ASSERT(m_currentEntry); HistoryItem* newItem = m_provisionalEntry->itemForFrame(frame); HistoryItem* oldItem = m_currentEntry->itemForFrame(frame); if (!newItem) return; if (!oldItem || (newItem != oldItem && newItem->itemSequenceNumber() != oldItem->itemSequenceNumber())) { if (oldItem && newItem->documentSequenceNumber() == oldItem->documentSequenceNumber()) sameDocumentLoads.set(frame, newItem); else differentDocumentLoads.set(frame, newItem); return; } for (LocalFrame* child = frame->tree().firstChild(); child; child = child->tree().nextSibling()) recursiveGoToEntry(child, sameDocumentLoads, differentDocumentLoads); }
void HistoryController::goToEntry(PassOwnPtr<HistoryEntry> targetEntry, ResourceRequestCachePolicy cachePolicy) { ASSERT(m_sameDocumentLoadsInProgress.isEmpty()); ASSERT(m_differentDocumentLoadsInProgress.isEmpty()); m_provisionalEntry = targetEntry; if (m_currentEntry) recursiveGoToEntry(m_page->mainFrame()); else m_differentDocumentLoadsInProgress.set(m_page->mainFrame(), m_provisionalEntry->root()); if (m_sameDocumentLoadsInProgress.isEmpty() && m_differentDocumentLoadsInProgress.isEmpty()) m_sameDocumentLoadsInProgress.set(m_page->mainFrame(), m_provisionalEntry->root()); if (m_differentDocumentLoadsInProgress.isEmpty()) { m_previousEntry = m_currentEntry.release(); m_currentEntry = m_provisionalEntry.release(); } for (HistoryFrameLoadSet::iterator it = m_sameDocumentLoadsInProgress.begin(); it != m_sameDocumentLoadsInProgress.end(); ++it) { #if defined(S_P140719_02604) if (it->key && it->key->host()) #else if (it->key->host()) #endif it->key->loader().loadHistoryItem(it->value.get(), HistorySameDocumentLoad, cachePolicy); } for (HistoryFrameLoadSet::iterator it = m_differentDocumentLoadsInProgress.begin(); it != m_differentDocumentLoadsInProgress.end(); ++it) { #if defined(S_P140719_02604) if (it->key && it->key->host()) #else if (it->key->host()) #endif it->key->loader().loadHistoryItem(it->value.get(), HistoryDifferentDocumentLoad, cachePolicy); } m_sameDocumentLoadsInProgress.clear(); m_differentDocumentLoadsInProgress.clear(); }