Commit f7f2d9a1 authored by adachan@apple.com's avatar adachan@apple.com

<rdar://problem/6803905> Lots of ASSERTs firing when trying to clear history

        Reviewed by Steve Falkenburg.

        * WebHistory.cpp:
        (WebHistory::data): Return null if there are no history items.



git-svn-id: svn://svn.chromium.org/blink/trunk@42630 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent c3454200
2009-04-17 Ada Chan <adachan@apple.com>
<rdar://problem/6803905> Lots of ASSERTs firing when trying to clear history
Reviewed by Steve Falkenburg.
* WebHistory.cpp:
(WebHistory::data): Return null if there are no history items.
2009-04-17 Ada Chan <adachan@apple.com> 2009-04-17 Ada Chan <adachan@apple.com>
- Fix a leak in WebHistoryItem::children() by adopting the created instance of WebHistoryItem. - Fix a leak in WebHistoryItem::children() by adopting the created instance of WebHistoryItem.
......
...@@ -565,7 +565,11 @@ HRESULT WebHistory::data(IStream** stream) ...@@ -565,7 +565,11 @@ HRESULT WebHistory::data(IStream** stream)
*stream = 0; *stream = 0;
COMPtr<MemoryStream> result(AdoptCOM, MemoryStream::createInstance(SharedBuffer::wrapCFData(data().get()))); RetainPtr<CFDataRef> historyData = data();
if (!historyData)
return S_OK;
COMPtr<MemoryStream> result(AdoptCOM, MemoryStream::createInstance(SharedBuffer::wrapCFData(historyData.get())));
return result.copyRefTo(stream); return result.copyRefTo(stream);
} }
...@@ -948,6 +952,9 @@ void WebHistory::addVisitedLinksToPageGroup(PageGroup& group) ...@@ -948,6 +952,9 @@ void WebHistory::addVisitedLinksToPageGroup(PageGroup& group)
RetainPtr<CFDataRef> WebHistory::data() const RetainPtr<CFDataRef> WebHistory::data() const
{ {
if (!CFArrayGetCount(m_entriesByDate.get()))
return 0;
WebHistoryWriter writer(m_entriesByDate.get()); WebHistoryWriter writer(m_entriesByDate.get());
writer.writePropertyList(); writer.writePropertyList();
return writer.releaseData(); return writer.releaseData();
......
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