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

Unified Diff: chrome/browser/extensions/activity_log/activity_log.cc

Issue 16510002: Better ActivityLog error handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reinstating the command line Created 7 years, 6 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/extensions/activity_log/activity_log.cc
diff --git a/chrome/browser/extensions/activity_log/activity_log.cc b/chrome/browser/extensions/activity_log/activity_log.cc
index 59108407e366eb9b3771a056361e549c5e0e542a..9403318e2f53e710fbcbd18069b2e858356bf717 100644
--- a/chrome/browser/extensions/activity_log/activity_log.cc
+++ b/chrome/browser/extensions/activity_log/activity_log.cc
@@ -21,7 +21,6 @@
#include "chrome/common/extensions/extension.h"
#include "content/public/browser/web_contents.h"
#include "googleurl/src/gurl.h"
-#include "sql/error_delegate_util.h"
#include "third_party/re2/re2/re2.h"
namespace {
@@ -131,13 +130,14 @@ ActivityLog::ActivityLog(Profile* profile) : profile_(profile) {
base::FilePath base_dir = profile->GetPath();
base::FilePath database_name = base_dir.Append(
chrome::kExtensionActivityLogFilename);
- db_->SetErrorCallback(base::Bind(&ActivityLog::DatabaseErrorCallback,
- base::Unretained(this)));
ScheduleAndForget(&ActivityDatabase::Init, database_name);
}
ActivityLog::~ActivityLog() {
- ScheduleAndForget(&ActivityDatabase::Close);
+ if (dispatch_thread_ == BrowserThread::UI) // Cleanup fast in a unittest.
+ db_->Close();
+ else
+ ScheduleAndForget(&ActivityDatabase::Close);
}
void ActivityLog::SetArgumentLoggingForTesting(bool log_arguments) {
@@ -359,9 +359,4 @@ void ActivityLog::OnScriptsExecuted(
}
}
-void ActivityLog::DatabaseErrorCallback(int error, sql::Statement* stmt) {
- if (sql::IsErrorCatastrophic(error))
- ScheduleAndForget(&ActivityDatabase::KillDatabase);
-}
-
} // namespace extensions
« no previous file with comments | « chrome/browser/extensions/activity_log/activity_log.h ('k') | chrome/browser/extensions/activity_log/activity_log_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698