Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1709)

Unified Diff: chrome/browser/history/in_memory_url_index.cc

Issue 10909046: Boost HQP Scores for Bookmarks (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Minor edits. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/in_memory_url_index.cc
===================================================================
--- chrome/browser/history/in_memory_url_index.cc (revision 154855)
+++ chrome/browser/history/in_memory_url_index.cc (working copy)
@@ -58,9 +58,11 @@
InMemoryURLIndex::RebuildPrivateDataFromHistoryDBTask::
RebuildPrivateDataFromHistoryDBTask(
InMemoryURLIndex* index,
+ Profile* profile,
sky 2012/09/05 20:57:49 Are you using this on the db thread?
mrossetti 2012/09/05 22:35:40 No, it was not referenced on the db thread, howeve
const std::string& languages,
const std::set<std::string>& scheme_whitelist)
: index_(index),
+ profile_(profile),
languages_(languages),
scheme_whitelist_(scheme_whitelist),
succeeded_(false) {
@@ -69,7 +71,7 @@
bool InMemoryURLIndex::RebuildPrivateDataFromHistoryDBTask::RunOnDBThread(
HistoryBackend* backend,
HistoryDatabase* db) {
- data_ = URLIndexPrivateData::RebuildFromHistory(db, languages_,
+ data_ = URLIndexPrivateData::RebuildFromHistory(profile_, db, languages_,
scheme_whitelist_);
succeeded_ = data_.get() && !data_->Empty();
if (!succeeded_ && data_.get())
@@ -94,7 +96,7 @@
: profile_(profile),
history_dir_(history_dir),
languages_(languages),
- private_data_(new URLIndexPrivateData),
+ private_data_(new URLIndexPrivateData(profile)),
restore_cache_observer_(NULL),
save_cache_observer_(NULL),
shutdown_(false),
@@ -114,7 +116,7 @@
// Called only by unit tests.
InMemoryURLIndex::InMemoryURLIndex()
: profile_(NULL),
- private_data_(new URLIndexPrivateData),
+ private_data_(new URLIndexPrivateData(NULL)),
restore_cache_observer_(NULL),
save_cache_observer_(NULL),
shutdown_(false),
@@ -230,10 +232,10 @@
}
scoped_refptr<URLIndexPrivateData> restored_private_data =
- new URLIndexPrivateData;
+ new URLIndexPrivateData(profile_);
content::BrowserThread::PostTaskAndReply(
content::BrowserThread::FILE, FROM_HERE,
- base::Bind(&URLIndexPrivateData::RestoreFromFileTask, path,
+ base::Bind(&URLIndexPrivateData::RestoreFromFileTask, profile_, path,
restored_private_data, languages_),
base::Bind(&InMemoryURLIndex::OnCacheLoadDone, AsWeakPtr(),
restored_private_data));
@@ -274,7 +276,7 @@
Profile::EXPLICIT_ACCESS);
service->ScheduleDBTask(
new InMemoryURLIndex::RebuildPrivateDataFromHistoryDBTask(
- this, languages_, scheme_whitelist_),
+ this, profile_, languages_, scheme_whitelist_),
&cache_reader_consumer_);
}
@@ -296,7 +298,8 @@
}
void InMemoryURLIndex::RebuildFromHistory(HistoryDatabase* history_db) {
- private_data_ = URLIndexPrivateData::RebuildFromHistory(history_db,
+ private_data_ = URLIndexPrivateData::RebuildFromHistory(profile_,
+ history_db,
languages_,
scheme_whitelist_);
}

Powered by Google App Engine
This is Rietveld 408576698