| Index: chrome/browser/history/in_memory_history_backend.cc
|
| ===================================================================
|
| --- chrome/browser/history/in_memory_history_backend.cc (revision 117518)
|
| +++ 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/public/browser/notification_details.h"
|
| #include "content/public/browser/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) {
|
| @@ -131,8 +120,6 @@
|
| db_->UpdateURLRow(id, *i);
|
| else
|
| id = db_->AddURL(*i);
|
| - if (index_.get())
|
| - index_->UpdateURL(id, *i);
|
| }
|
| }
|
|
|
| @@ -145,22 +132,15 @@
|
| db_.reset(new InMemoryDatabase);
|
| if (!db_->InitFromScratch())
|
| db_.reset();
|
| - if (index_.get())
|
| - index_->ReloadFromHistory(db_.get());
|
| 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());
|
| }
|
| }
|
|
|
|
|