diff options
author | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-09 22:37:20 +0000 |
---|---|---|
committer | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-09 22:37:20 +0000 |
commit | 4c3d9d6ab2149b6946ee9595b82a483ca1261204 (patch) | |
tree | 17de045e75d21852d950ce48565f67b510b9d882 /chrome/browser/history/history_backend.cc | |
parent | 43f8b0a6f8313fcae7d50cfaf8d6e646c80c2125 (diff) | |
download | chromium_src-4c3d9d6ab2149b6946ee9595b82a483ca1261204.zip chromium_src-4c3d9d6ab2149b6946ee9595b82a483ca1261204.tar.gz chromium_src-4c3d9d6ab2149b6946ee9595b82a483ca1261204.tar.bz2 |
Remove VisitedLink dependency on rest of chrome
This is in preparation of componentizing VisitedLink implementation and
be shared with Android WebView.
* Added VisitedLinkDelegate which HistoryService implements.
* Removed VisitedLinkMasterFactory and have HistoryService directly own
VisitedLinkMaster.
* Introduce URLIterator interface for DeleteURLs.
Last committed in https://src.chromium.org/viewvc/chrome?view=rev&revision=175186
Reverted in https://src.chromium.org/viewvc/chrome?view=rev&revision=175217
due to memory leaks.
Before this patch, VisitedLink was a ProfileKeyedService and some using
HistoryService did not create VisitedLink at all. After this patch,
VisitedLink is created and owned directly by HistoryService, so they are
now created for some tests depending on which HistoryService constructor
is used.
First version was leaking URLEnumerator in HistoryService::RebuildTable
which was doing manual ref counting (AddRef/Release) calls. Some tests do
not start the background thread at all, so URLEnumerator::OnComplete is
never called to delete itself.
Fixed by properly ref-counting URLEnumerator with scoped_refptr in this
path.
BUG=168716
Review URL: https://chromiumcodereview.appspot.com/11573060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175906 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/history/history_backend.cc')
-rw-r--r-- | chrome/browser/history/history_backend.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index d53f672..34a0a30 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -1058,13 +1058,14 @@ void HistoryBackend::AddPageNoVisitForBookmark(const GURL& url, db_->AddURL(url_info); } -void HistoryBackend::IterateURLs(HistoryService::URLEnumerator* iterator) { +void HistoryBackend::IterateURLs( + const scoped_refptr<VisitedLinkDelegate::URLEnumerator>& iterator) { if (db_.get()) { HistoryDatabase::URLEnumerator e; if (db_->InitURLEnumeratorForEverything(&e)) { URLRow info; while (e.GetNextURL(&info)) { - iterator->OnURL(info); + iterator->OnURL(info.url()); } iterator->OnComplete(true); // Success. return; |