| Index: chrome/browser/history/url_index_private_data.cc
|
| diff --git a/chrome/browser/history/url_index_private_data.cc b/chrome/browser/history/url_index_private_data.cc
|
| index 33b702633f7bf14da5d8bb02d9ba267878bfe54a..bf062cfeef6cc90cb11cc85f3549573b9472a2e0 100644
|
| --- a/chrome/browser/history/url_index_private_data.cc
|
| +++ b/chrome/browser/history/url_index_private_data.cc
|
| @@ -280,7 +280,8 @@ bool URLIndexPrivateData::UpdateURL(
|
| HistoryService* history_service,
|
| const URLRow& row,
|
| const std::string& languages,
|
| - const std::set<std::string>& scheme_whitelist) {
|
| + const std::set<std::string>& scheme_whitelist,
|
| + base::CancelableTaskTracker* tracker) {
|
| // The row may or may not already be in our index. If it is not already
|
| // indexed and it qualifies then it gets indexed. If it is already
|
| // indexed and still qualifies then it gets updated, otherwise it
|
| @@ -293,7 +294,12 @@ bool URLIndexPrivateData::UpdateURL(
|
| URLRow new_row(row);
|
| new_row.set_id(row_id);
|
| row_was_updated = RowQualifiesAsSignificant(new_row, base::Time()) &&
|
| - IndexRow(NULL, history_service, new_row, languages, scheme_whitelist);
|
| + IndexRow(NULL,
|
| + history_service,
|
| + new_row,
|
| + languages,
|
| + scheme_whitelist,
|
| + tracker);
|
| } else if (RowQualifiesAsSignificant(row, base::Time())) {
|
| // This indexed row still qualifies and will be re-indexed.
|
| // The url won't have changed but the title, visit count, etc.
|
| @@ -308,7 +314,7 @@ bool URLIndexPrivateData::UpdateURL(
|
| row_to_update.set_last_visit(row.last_visit());
|
| // If something appears to have changed, update the recent visits
|
| // information.
|
| - ScheduleUpdateRecentVisits(history_service, row_id);
|
| + ScheduleUpdateRecentVisits(history_service, row_id, tracker);
|
| // While the URL is guaranteed to remain stable, the title may have
|
| // changed. If so, then update the index with the changed words.
|
| if (title_updated) {
|
| @@ -357,10 +363,10 @@ void URLIndexPrivateData::UpdateRecentVisits(
|
|
|
| void URLIndexPrivateData::ScheduleUpdateRecentVisits(
|
| HistoryService* history_service,
|
| - URLID url_id) {
|
| + URLID url_id,
|
| + base::CancelableTaskTracker* tracker) {
|
| history_service->ScheduleDBTask(
|
| - new UpdateRecentVisitsFromHistoryDBTask(this, url_id),
|
| - &recent_visits_consumer_);
|
| + new UpdateRecentVisitsFromHistoryDBTask(this, url_id), tracker);
|
| }
|
|
|
| // Helper functor for DeleteURL.
|
| @@ -444,8 +450,8 @@ scoped_refptr<URLIndexPrivateData> URLIndexPrivateData::RebuildFromHistory(
|
| return NULL;
|
| rebuilt_data->last_time_rebuilt_from_history_ = base::Time::Now();
|
| for (URLRow row; history_enum.GetNextURL(&row); ) {
|
| - rebuilt_data->IndexRow(history_db, NULL, row, languages,
|
| - scheme_whitelist);
|
| + rebuilt_data->IndexRow(
|
| + history_db, NULL, row, languages, scheme_whitelist, NULL);
|
| }
|
|
|
| UMA_HISTOGRAM_TIMES("History.InMemoryURLIndexingTime",
|
| @@ -468,10 +474,6 @@ bool URLIndexPrivateData::WritePrivateDataToCacheFileTask(
|
| return private_data->SaveToFile(file_path);
|
| }
|
|
|
| -void URLIndexPrivateData::CancelPendingUpdates() {
|
| - recent_visits_consumer_.CancelAllRequests();
|
| -}
|
| -
|
| scoped_refptr<URLIndexPrivateData> URLIndexPrivateData::Duplicate() const {
|
| scoped_refptr<URLIndexPrivateData> data_copy = new URLIndexPrivateData;
|
| data_copy->last_time_rebuilt_from_history_ = last_time_rebuilt_from_history_;
|
| @@ -685,7 +687,8 @@ bool URLIndexPrivateData::IndexRow(
|
| HistoryService* history_service,
|
| const URLRow& row,
|
| const std::string& languages,
|
| - const std::set<std::string>& scheme_whitelist) {
|
| + const std::set<std::string>& scheme_whitelist,
|
| + base::CancelableTaskTracker* tracker) {
|
| const GURL& gurl(row.url());
|
|
|
| // Index only URLs with a whitelisted scheme.
|
| @@ -730,8 +733,9 @@ bool URLIndexPrivateData::IndexRow(
|
| &recent_visits))
|
| UpdateRecentVisits(row_id, recent_visits);
|
| } else {
|
| + DCHECK(tracker);
|
| DCHECK(history_service);
|
| - ScheduleUpdateRecentVisits(history_service, row_id);
|
| + ScheduleUpdateRecentVisits(history_service, row_id, tracker);
|
| }
|
|
|
| return true;
|
|
|