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

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

Issue 8291005: HQP Refactoring (in Preparation for SQLite Cache) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Rattle those Bots Senseless Created 9 years, 2 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
« no previous file with comments | « chrome/browser/history/in_memory_history_backend.h ('k') | chrome/browser/history/in_memory_url_index.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
}
« no previous file with comments | « chrome/browser/history/in_memory_history_backend.h ('k') | chrome/browser/history/in_memory_url_index.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698