diff options
author | Steve Block <steveblock@google.com> | 2010-08-27 11:02:25 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-09-02 17:17:20 +0100 |
commit | e8b154fd68f9b33be40a3590e58347f353835f5c (patch) | |
tree | 0733ce26384183245aaa5656af26c653636fe6c1 /WebCore/history | |
parent | da56157816334089526a7a115a85fd85a6e9a1dc (diff) | |
download | external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.zip external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.tar.gz external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.tar.bz2 |
Merge WebKit at r66079 : Initial merge by git
Change-Id: Ie2e1440fb9d487d24e52c247342c076fecaecac7
Diffstat (limited to 'WebCore/history')
-rw-r--r-- | WebCore/history/HistoryItem.cpp | 20 | ||||
-rw-r--r-- | WebCore/history/HistoryItem.h | 2 |
2 files changed, 20 insertions, 2 deletions
diff --git a/WebCore/history/HistoryItem.cpp b/WebCore/history/HistoryItem.cpp index 3ee423b..42adcfb 100644 --- a/WebCore/history/HistoryItem.cpp +++ b/WebCore/history/HistoryItem.cpp @@ -150,7 +150,7 @@ inline HistoryItem::HistoryItem(const HistoryItem& item) m_children.uncheckedAppend(item.m_children[i]->copy()); if (item.m_redirectURLs) - m_redirectURLs.set(new Vector<String>(*item.m_redirectURLs)); + m_redirectURLs = adoptPtr(new Vector<String>(*item.m_redirectURLs)); } PassRefPtr<HistoryItem> HistoryItem::copy() const @@ -480,6 +480,22 @@ void HistoryItem::clearChildren() m_children.clear(); } +bool HistoryItem::hasSameDocuments(HistoryItem* otherItem) +{ + if (documentSequenceNumber() != otherItem->documentSequenceNumber()) + return false; + + if (children().size() != otherItem->children().size()) + return false; + + for (size_t i = 0; i < children().size(); i++) { + if (!children()[i]->hasSameDocuments(otherItem->children()[i].get())) + return false; + } + + return true; +} + String HistoryItem::formContentType() const { return m_formContentType; @@ -537,7 +553,7 @@ void HistoryItem::mergeAutoCompleteHints(HistoryItem* otherItem) void HistoryItem::addRedirectURL(const String& url) { if (!m_redirectURLs) - m_redirectURLs.set(new Vector<String>); + m_redirectURLs = adoptPtr(new Vector<String>); // Our API allows us to store all the URLs in the redirect chain, but for // now we only have a use for the final URL. diff --git a/WebCore/history/HistoryItem.h b/WebCore/history/HistoryItem.h index ef73c5e..dfdbc43 100644 --- a/WebCore/history/HistoryItem.h +++ b/WebCore/history/HistoryItem.h @@ -159,6 +159,8 @@ public: const HistoryItemVector& children() const; bool hasChildren() const; void clearChildren(); + + bool hasSameDocuments(HistoryItem* otherItem); // This should not be called directly for HistoryItems that are already included // in GlobalHistory. The WebKit api for this is to use -[WebHistory setLastVisitedTimeInterval:forItem:] instead. |