app/sql/connection hygiene enforcement.

For awhile we had an error where an invalid page_size was being passed in, and SQLite silently ignored it.  No more!  Fix cache_size logging line.  Pull the exclusive locking up to fail more obviously in case someone else has the exclusive lock.

Also, I don't think our code is likely handling the SQLITE_BUSY case correctly.  Added some initial code to execute some sql with a timeout.

BUG=56559
TEST=unit tests

Review URL: http://codereview.chromium.org/3413028

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60799 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/app/sql/connection.h b/app/sql/connection.h
index 0bd28caa..680cf1d 100644
--- a/app/sql/connection.h
+++ b/app/sql/connection.h
@@ -12,6 +12,7 @@
 
 #include "base/basictypes.h"
 #include "base/ref_counted.h"
+#include "base/time.h"
 
 class FilePath;
 struct sqlite3;
@@ -339,6 +340,9 @@
   // The return value is the error code reflected back to client code.
   int OnSqliteError(int err, Statement* stmt);
 
+  // Like |Execute()|, but retries if the database is locked.
+  bool ExecuteWithTimeout(const char* sql, base::TimeDelta ms_timeout);
+
   // The actual sqlite database. Will be NULL before Init has been called or if
   // Init resulted in an error.
   sqlite3* db_;