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

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

Issue 343067: Unittest for fix to allow navigation when there is no history DB.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 1 month 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/history.h ('k') | chrome/browser/history/history_backend.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/history.cc
===================================================================
--- chrome/browser/history/history.cc (revision 30724)
+++ chrome/browser/history/history.cc (working copy)
@@ -130,7 +130,9 @@
HistoryService::HistoryService()
: thread_(new ChromeHistoryThread()),
profile_(NULL),
- backend_loaded_(false) {
+ backend_loaded_(false),
+ bookmark_service_(NULL),
+ no_db_(false) {
// Is NULL when running generate_profile.
if (NotificationService::current()) {
registrar_.Add(this, NotificationType::HISTORY_URLS_DELETED,
@@ -141,7 +143,9 @@
HistoryService::HistoryService(Profile* profile)
: thread_(new ChromeHistoryThread()),
profile_(profile),
- backend_loaded_(false) {
+ backend_loaded_(false),
+ bookmark_service_(NULL),
+ no_db_(false) {
registrar_.Add(this, NotificationType::HISTORY_URLS_DELETED,
Source<Profile>(profile_));
}
@@ -151,21 +155,6 @@
Cleanup();
}
-bool HistoryService::Init(const FilePath& history_dir,
- BookmarkService* bookmark_service) {
- if (!thread_->Start()) {
- Cleanup();
- return false;
- }
-
- history_dir_ = history_dir;
- bookmark_service_ = bookmark_service;
-
- // Create the history backend.
- LoadBackendIfNecessary();
- return true;
-}
-
bool HistoryService::BackendLoaded() {
// NOTE: We start the backend loading even though it completes asynchronously
// and thus won't affect the return value of this function. This is because
@@ -620,6 +609,23 @@
visited_links->DeleteURLs(deleted_details->urls);
}
+bool HistoryService::Init(const FilePath& history_dir,
+ BookmarkService* bookmark_service,
+ bool no_db) {
+ if (!thread_->Start()) {
+ Cleanup();
+ return false;
+ }
+
+ history_dir_ = history_dir;
+ bookmark_service_ = bookmark_service;
+ no_db_ = no_db;
+
+ // Create the history backend.
+ LoadBackendIfNecessary();
+ return true;
+}
+
void HistoryService::ScheduleAutocomplete(HistoryURLProvider* provider,
HistoryURLProviderParams* params) {
ScheduleAndForget(PRIORITY_UI, &HistoryBackend::ScheduleAutocomplete,
@@ -722,7 +728,7 @@
bookmark_service_));
history_backend_.swap(backend);
- ScheduleAndForget(PRIORITY_UI, &HistoryBackend::Init);
+ ScheduleAndForget(PRIORITY_UI, &HistoryBackend::Init, no_db_);
}
void HistoryService::OnDBLoaded() {
« no previous file with comments | « chrome/browser/history/history.h ('k') | chrome/browser/history/history_backend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698