Commit 134422b9 authored by mrowe@apple.com's avatar mrowe@apple.com

<rdar://problem/9371289> WebKit2 can persist an invalid current back/forward...

<rdar://problem/9371289> WebKit2 can persist an invalid current back/forward item index when URLs are filtered from back/forward list

Reviewed by Brady Eidson.

* UIProcess/cf/WebBackForwardListCF.cpp:
(WebKit::WebBackForwardList::createCFDictionaryRepresentation): We need to update the current index to account for filtered items
for all items before the current item in the array.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@85564 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9db7a192
2011-05-02 Mark Rowe <mrowe@apple.com>
Reviewed by Brady Eidson.
<rdar://problem/9371289> WebKit2 can persist an invalid current back/forward item index when URLs are filtered from back/forward list
* UIProcess/cf/WebBackForwardListCF.cpp:
(WebKit::WebBackForwardList::createCFDictionaryRepresentation): We need to update the current index to account for filtered items
for all items before the current item in the array.
2011-05-02 Anders Carlsson <andersca@apple.com>
Reviewed by Adam Roben.
......
......@@ -62,7 +62,7 @@ CFDictionaryRef WebBackForwardList::createCFDictionaryRepresentation(WebPageProx
for (size_t i = 0; i < m_entries.size(); ++i) {
RefPtr<WebURL> webURL = WebURL::create(m_entries[i]->url());
if (filter && !filter(toAPI(m_page), WKPageGetSessionHistoryURLValueType(), toURLRef(m_entries[i]->originalURL().impl()), context)) {
if (i <= static_cast<size_t>(currentIndex))
if (i <= static_cast<size_t>(m_current))
currentIndex--;
continue;
}
......@@ -78,6 +78,8 @@ CFDictionaryRef WebBackForwardList::createCFDictionaryRepresentation(WebPageProx
RetainPtr<CFDictionaryRef> entryDictionary(AdoptCF, CFDictionaryCreate(0, keys, values, 4, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
CFArrayAppendValue(entries.get(), entryDictionary.get());
}
ASSERT(currentIndex < CFArrayGetCount(entries.get()));
RetainPtr<CFNumberRef> currentIndexNumber(AdoptCF, CFNumberCreate(0, kCFNumberIntType, &currentIndex));
const void* keys[2] = { SessionHistoryCurrentIndexKey(), SessionHistoryEntriesKey() };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment