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

Unified Diff: chrome/browser/extensions/activity_log/blocked_actions.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/blocked_actions.cc
diff --git a/chrome/browser/extensions/activity_log/blocked_actions.cc b/chrome/browser/extensions/activity_log/blocked_actions.cc
index aa35f70041c2832736723dbd9cc4530617a160bd..ec4ae446d5a8543c15172a51ad23d2bfbbcc57a2 100644
--- a/chrome/browser/extensions/activity_log/blocked_actions.cc
+++ b/chrome/browser/extensions/activity_log/blocked_actions.cc
@@ -95,7 +95,7 @@ bool BlockedAction::InitializeTable(sql::Connection* db) {
arraysize(kTableContentFields));
}
-void BlockedAction::Record(sql::Connection* db) {
+bool BlockedAction::Record(sql::Connection* db) {
std::string sql_str = "INSERT INTO " + std::string(kTableName)
+ " (extension_id, time, api_call, args, reason, extra)"
" VALUES (?,?,?,?,?,?)";
@@ -107,8 +107,13 @@ void BlockedAction::Record(sql::Connection* db) {
statement.BindString(3, args_);
statement.BindInt(4, static_cast<int>(reason_));
statement.BindString(5, extra_);
- if (!statement.Run())
+ if (!statement.Run()) {
LOG(ERROR) << "Activity log database I/O failed: " << sql_str;
+ statement.Clear();
+ return false;
+ } else {
+ return true;
+ }
}
std::string BlockedAction::PrintForDebug() {
« no previous file with comments | « chrome/browser/extensions/activity_log/blocked_actions.h ('k') | chrome/browser/extensions/activity_log/dom_actions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698