Dump additional error info for thumbnail database.

The union of SQLite error messages and platform errno is a potentially
large space which may not be reasonable to histogram.  Instead,
randomly dump a crash report with diagnostic information which can be
correlated with histograms.

BUG=240396

Review URL: https://chromiumcodereview.appspot.com/15131008

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200759 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/sql/connection.cc b/sql/connection.cc
index 54aeb89..701a129 100644
--- a/sql/connection.cc
+++ b/sql/connection.cc
@@ -736,6 +736,13 @@
              << ", errno " << GetLastErrno()
              << ": " << GetErrorMessage();
 
+  if (!error_callback_.is_null()) {
+    error_callback_.Run(err, stmt);
+    return err;
+  }
+
+  // TODO(shess): Remove |error_delegate_| once everything is
+  // converted to |error_callback_|.
   if (error_delegate_.get())
     return error_delegate_->OnError(err, this, stmt);