Index: chrome/browser/history/in_memory_history_backend.cc |
=================================================================== |
--- chrome/browser/history/in_memory_history_backend.cc (revision 105497) |
+++ chrome/browser/history/in_memory_history_backend.cc (working copy) |
@@ -13,11 +13,9 @@ |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/history/history_notifications.h" |
#include "chrome/browser/history/in_memory_database.h" |
-#include "chrome/browser/history/in_memory_url_index.h" |
#include "chrome/browser/history/url_database.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/common/chrome_notification_types.h" |
-#include "chrome/common/chrome_switches.h" |
#include "content/common/notification_details.h" |
#include "content/common/notification_source.h" |
@@ -27,23 +25,14 @@ |
: profile_(NULL) { |
} |
-InMemoryHistoryBackend::~InMemoryHistoryBackend() { |
- if (index_.get()) |
- index_->ShutDown(); |
-} |
+InMemoryHistoryBackend::~InMemoryHistoryBackend() {} |
bool InMemoryHistoryBackend::Init(const FilePath& history_filename, |
const FilePath& history_dir, |
URLDatabase* db, |
const std::string& languages) { |
db_.reset(new InMemoryDatabase); |
- bool success = db_->InitFromDisk(history_filename); |
- if (!CommandLine::ForCurrentProcess()->HasSwitch( |
- switches::kDisableHistoryQuickProvider)) { |
- index_.reset(new InMemoryURLIndex(history_dir)); |
- index_->Init(db, languages); |
- } |
- return success; |
+ return db_->InitFromDisk(history_filename); |
} |
void InMemoryHistoryBackend::AttachToHistoryService(Profile* profile) { |
@@ -129,36 +118,25 @@ |
db_->UpdateURLRow(id, *i); |
else |
id = db_->AddURL(*i); |
- if (index_.get()) |
- index_->UpdateURL(id, *i); |
} |
} |
void InMemoryHistoryBackend::OnURLsDeleted(const URLsDeletedDetails& details) { |
- DCHECK(db_.get()); |
- |
if (details.all_history) { |
// When all history is deleted, the individual URLs won't be listed. Just |
// create a new database to quickly clear everything out. |
db_.reset(new InMemoryDatabase); |
if (!db_->InitFromScratch()) |
db_.reset(); |
- if (index_.get()) |
- index_->ReloadFromHistory(db_.get(), true); |
return; |
} |
// Delete all matching URLs in our database. |
- for (std::set<GURL>::const_iterator i = details.urls.begin(); |
- i != details.urls.end(); ++i) { |
- URLID id = db_->GetRowForURL(*i, NULL); |
- if (id) { |
- // We typically won't have most of them since we only have a subset of |
- // history, so ignore errors. |
- db_->DeleteURLRow(id); |
- if (index_.get()) |
- index_->DeleteURL(id); |
- } |
+ for (std::vector<URLRow>::const_iterator row = details.rows.begin(); |
+ row != details.rows.end(); ++row) { |
+ // We typically won't have most of them since we only have a subset of |
+ // history, so ignore errors. |
+ db_->DeleteURLRow(row->id()); |
} |
} |