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

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

Issue 16510002: Better ActivityLog error handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup before review 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/dom_actions.cc
diff --git a/chrome/browser/extensions/activity_log/dom_actions.cc b/chrome/browser/extensions/activity_log/dom_actions.cc
index ea2486cdb26cb04070c15b481e53cd49219c924d..15fff88d36138076202b632c08b3fe0c56ebb28d 100644
--- a/chrome/browser/extensions/activity_log/dom_actions.cc
+++ b/chrome/browser/extensions/activity_log/dom_actions.cc
@@ -106,7 +106,7 @@ bool DOMAction::InitializeTable(sql::Connection* db) {
return initialized;
}
-void DOMAction::Record(sql::Connection* db) {
+bool DOMAction::Record(sql::Connection* db) {
std::string sql_str = "INSERT INTO " + std::string(kTableName) +
" (extension_id, time, url_action_type, url, url_title, api_call, args,"
" extra) VALUES (?,?,?,?,?,?,?,?)";
@@ -120,8 +120,12 @@ void DOMAction::Record(sql::Connection* db) {
statement.BindString(5, api_call_);
statement.BindString(6, args_);
statement.BindString(7, extra_);
- if (!statement.Run())
+ if (!statement.Run()) {
LOG(ERROR) << "Activity log database I/O failed: " << sql_str;
+ statement.Clear();
Matt Perry 2013/06/07 20:58:01 The Statement destructor resets and frees its reso
+ return false;
+ }
+ return true;
}
std::string DOMAction::PrintForDebug() {

Powered by Google App Engine
This is Rietveld 408576698