Index: sql/error_delegate_util.cc |
diff --git a/sql/error_delegate_util.cc b/sql/error_delegate_util.cc |
index 37fe006947e0afcd8e8f329d62666fef5b287983..2c232aafe35da48eee7ec1e6ad510762fb620e05 100644 |
--- a/sql/error_delegate_util.cc |
+++ b/sql/error_delegate_util.cc |
@@ -4,6 +4,7 @@ |
#include "sql/error_delegate_util.h" |
+#include "base/strings/stringprintf.h" |
#include "third_party/sqlite/sqlite3.h" |
namespace sql { |
@@ -77,4 +78,16 @@ bool IsErrorCatastrophic(int error) { |
return false; |
} |
+void AppendCorruptFileInfoToDiagnostics( |
+ const base::FilePath& corrupted_file_path, |
+ std::string* diagnostics) { |
+ DCHECK(diagnostics); |
+ |
+ const std::string corrupted_file_name = |
+ corrupted_file_path.DirName().BaseName().AsUTF8Unsafe() + "/" + |
+ corrupted_file_path.BaseName().AsUTF8Unsafe(); |
+ base::StringAppendF(diagnostics, "Corrupted file: %s\n", |
+ corrupted_file_name.c_str()); |
+} |
+ |
} // namespace sql |