Chromium Code Reviews| Index: Source/core/history/HistoryItem.cpp |
| diff --git a/Source/core/history/HistoryItem.cpp b/Source/core/history/HistoryItem.cpp |
| index 56dacc9b2c14ec6d0dd335f1b1e0f824da4239b3..24a455f9f89b900ba0d3a8c43278366e0d3c39c2 100644 |
| --- a/Source/core/history/HistoryItem.cpp |
| +++ b/Source/core/history/HistoryItem.cpp |
| @@ -65,8 +65,10 @@ inline HistoryItem::HistoryItem(const HistoryItem& item) |
| , m_target(item.m_target) |
| , m_scrollPoint(item.m_scrollPoint) |
| , m_pageScaleFactor(item.m_pageScaleFactor) |
| + , m_documentState(item.m_documentState) |
| , m_itemSequenceNumber(item.m_itemSequenceNumber) |
| , m_documentSequenceNumber(item.m_documentSequenceNumber) |
| + , m_stateObject(item.m_stateObject) |
| , m_formContentType(item.m_formContentType) |
| { |
| if (item.m_formData) |
| @@ -204,42 +206,9 @@ void HistoryItem::setStateObject(PassRefPtr<SerializedScriptValue> object) |
| void HistoryItem::addChildItem(PassRefPtr<HistoryItem> child) |
|
Charlie Reis
2013/10/19 00:44:15
Why do we still need addChildItem or m_children on
|
| { |
| - ASSERT(!childItemWithTarget(child->target())); |
| m_children.append(child); |
| } |
| -void HistoryItem::setChildItem(PassRefPtr<HistoryItem> child) |
| -{ |
| - unsigned size = m_children.size(); |
| - for (unsigned i = 0; i < size; ++i) { |
| - if (m_children[i]->target() == child->target()) { |
| - m_children[i] = child; |
| - return; |
| - } |
| - } |
| - m_children.append(child); |
| -} |
| - |
| -HistoryItem* HistoryItem::childItemWithTarget(const String& target) const |
| -{ |
| - unsigned size = m_children.size(); |
| - for (unsigned i = 0; i < size; ++i) { |
| - if (m_children[i]->target() == target) |
| - return m_children[i].get(); |
| - } |
| - return 0; |
| -} |
| - |
| -HistoryItem* HistoryItem::childItemWithDocumentSequenceNumber(long long number) const |
| -{ |
| - unsigned size = m_children.size(); |
| - for (unsigned i = 0; i < size; ++i) { |
| - if (m_children[i]->documentSequenceNumber() == number) |
| - return m_children[i].get(); |
| - } |
| - return 0; |
| -} |
| - |
| const HistoryItemVector& HistoryItem::children() const |
| { |
| return m_children; |
| @@ -250,61 +219,6 @@ void HistoryItem::clearChildren() |
| m_children.clear(); |
| } |
| -// We do same-document navigation if going to a different item and if either of the following is true: |
| -// - The other item corresponds to the same document (for history entries created via pushState or fragment changes). |
| -// - The other item corresponds to the same set of documents, including frames (for history entries created via regular navigation) |
| -bool HistoryItem::shouldDoSameDocumentNavigationTo(HistoryItem* otherItem) const |
| -{ |
| - if (this == otherItem) |
| - return false; |
| - |
| - if (stateObject() || otherItem->stateObject()) |
| - return documentSequenceNumber() == otherItem->documentSequenceNumber(); |
| - |
| - if ((url().hasFragmentIdentifier() || otherItem->url().hasFragmentIdentifier()) && equalIgnoringFragmentIdentifier(url(), otherItem->url())) |
| - return documentSequenceNumber() == otherItem->documentSequenceNumber(); |
| - |
| - return hasSameDocumentTree(otherItem); |
| -} |
| - |
| -// Does a recursive check that this item and its descendants have the same |
| -// document sequence numbers as the other item. |
| -bool HistoryItem::hasSameDocumentTree(HistoryItem* otherItem) const |
| -{ |
| - if (documentSequenceNumber() != otherItem->documentSequenceNumber()) |
| - return false; |
| - |
| - if (children().size() != otherItem->children().size()) |
| - return false; |
| - |
| - for (size_t i = 0; i < children().size(); i++) { |
| - HistoryItem* child = children()[i].get(); |
| - HistoryItem* otherChild = otherItem->childItemWithDocumentSequenceNumber(child->documentSequenceNumber()); |
| - if (!otherChild || !child->hasSameDocumentTree(otherChild)) |
| - return false; |
| - } |
| - |
| - return true; |
| -} |
| - |
| -// Does a non-recursive check that this item and its immediate children have the |
| -// same frames as the other item. |
| -bool HistoryItem::hasSameFrames(HistoryItem* otherItem) const |
| -{ |
| - if (target() != otherItem->target()) |
| - return false; |
| - |
| - if (children().size() != otherItem->children().size()) |
| - return false; |
| - |
| - for (size_t i = 0; i < children().size(); i++) { |
| - if (!otherItem->childItemWithTarget(children()[i]->target())) |
| - return false; |
| - } |
| - |
| - return true; |
| -} |
| - |
| String HistoryItem::formContentType() const |
| { |
| return m_formContentType; |
| @@ -346,37 +260,5 @@ bool HistoryItem::isCurrentDocument(Document* doc) const |
| return equalIgnoringFragmentIdentifier(url(), doc->url()); |
| } |
| -#ifndef NDEBUG |
| - |
| -int HistoryItem::showTree() const |
| -{ |
| - return showTreeWithIndent(0); |
| -} |
| - |
| -int HistoryItem::showTreeWithIndent(unsigned indentLevel) const |
| -{ |
| - Vector<char> prefix; |
| - for (unsigned i = 0; i < indentLevel; ++i) |
| - prefix.append(" ", 2); |
| - prefix.append("\0", 1); |
| - |
| - fprintf(stderr, "%s+-%s (%p)\n", prefix.data(), m_urlString.utf8().data(), this); |
| - |
| - int totalSubItems = 0; |
| - for (unsigned i = 0; i < m_children.size(); ++i) |
| - totalSubItems += m_children[i]->showTreeWithIndent(indentLevel + 1); |
| - return totalSubItems + 1; |
| -} |
| - |
| -#endif |
| - |
| } // namespace WebCore |
| -#ifndef NDEBUG |
| - |
| -int showTree(const WebCore::HistoryItem* item) |
| -{ |
| - return item->showTree(); |
| -} |
| - |
| -#endif |