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

Unified Diff: chrome/browser/extensions/activity_log/api_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/api_actions.cc
diff --git a/chrome/browser/extensions/activity_log/api_actions.cc b/chrome/browser/extensions/activity_log/api_actions.cc
index 6a7cb654321469ab48fe33dc76e082a5c295b845..6004dd36ab4dd78b75956f3fe02c1b21fad181f5 100644
--- a/chrome/browser/extensions/activity_log/api_actions.cc
+++ b/chrome/browser/extensions/activity_log/api_actions.cc
@@ -186,7 +186,7 @@ bool APIAction::InitializeTable(sql::Connection* db) {
arraysize(kTableContentFields));
}
-void APIAction::Record(sql::Connection* db) {
+bool APIAction::Record(sql::Connection* db) {
std::string sql_str = "INSERT INTO " + std::string(kTableName)
+ " (extension_id, time, api_type, api_call, args, extra) VALUES"
" (?,?,?,?,?,?)";
@@ -198,8 +198,12 @@ void APIAction::Record(sql::Connection* db) {
statement.BindString(3, APINameMap::GetInstance()->ApiToShortname(api_call_));
statement.BindString(4, args_);
statement.BindString(5, extra_);
- if (!statement.Run())
+ if (!statement.Run()) {
LOG(ERROR) << "Activity log database I/O failed: " << sql_str;
+ statement.Clear();
+ return false;
+ }
+ return true;
}
// static
« no previous file with comments | « chrome/browser/extensions/activity_log/api_actions.h ('k') | chrome/browser/extensions/activity_log/blocked_actions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698