Deeper histogram for SQLITE_IOERR.

Sqlite.Error records the basic SQLite error codes.  Most of the
extended codes are under SQLITE_IOERR, add a new histogram to record
those.

[Relanding https://chromiumcodereview.appspot.com/14439007/]

BUG=none

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197385 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/sql/connection.cc b/sql/connection.cc
index 5f6b590..29708e4 100644
--- a/sql/connection.cc
+++ b/sql/connection.cc
@@ -714,6 +714,15 @@
 
   static size_t kSqliteErrorMax = 50;
   UMA_HISTOGRAM_ENUMERATION("Sqlite.Error", base_err, kSqliteErrorMax);
+  if (base_err == SQLITE_IOERR) {
+    // TODO(shess): Consider folding the IOERR range into the main
+    // histogram directly.  Perhaps 30..49?  The downside risk would
+    // be that SQLite core adds a bunch of codes and this becomes a
+    // complicated mapping.
+    static size_t kSqliteIOErrorMax = 20;
+    UMA_HISTOGRAM_ENUMERATION("Sqlite.Error.IOERR", err>>8, kSqliteIOErrorMax);
+  }
+
   if (!error_histogram_name_.empty()) {
     // TODO(shess): The histogram macros create a bit of static
     // storage for caching the histogram object.  Since SQLite is