Index: sql/connection.h |
diff --git a/sql/connection.h b/sql/connection.h |
index 7d2ab6a355bfc9d448f4f58fd18480b2e3d1d722..fa36a002e298f2e1c4c5d9a3834744a35e0b2377 100644 |
--- a/sql/connection.h |
+++ b/sql/connection.h |
@@ -470,6 +470,23 @@ class SQL_EXPORT Connection : public base::trace_event::MemoryDumpProvider { |
const base::trace_event::MemoryDumpArgs& args, |
base::trace_event::ProcessMemoryDump* process_memory_dump) override; |
+ // Helper to prevent uploading too many diagnostic dumps for a given database, |
+ // since every dump will likely show the same problem. Returns |true| if this |
+ // function was not previously called for this database, and the persistent |
+ // storage which tracks state was updated. |
+ // |
+ // |false| is returned if the function was previously called for this |
+ // database, even across restarts. |false| is also returned if the persistent |
+ // storage cannot be updated, possibly indicating problems requiring user or |
+ // admin intervention, such as filesystem corruption or disk full. |false| is |
+ // also returned if the persistent storage contains invalid data or is not |
+ // readable. |
+ // |
+ // TODO(shess): It would make sense to reset the persistent state if the |
+ // database is razed or recovered, or if the diagnostic code adds new |
+ // capabilities. |
+ bool RegisterIntentToUpload() const; |
+ |
private: |
// For recovery module. |
friend class Recovery; |
@@ -504,7 +521,7 @@ class SQL_EXPORT Connection : public base::trace_event::MemoryDumpProvider { |
// Check whether the current thread is allowed to make IO calls, but only |
// if database wasn't open in memory. Function is inlined to be a no-op in |
// official build. |
- void AssertIOAllowed() { |
+ void AssertIOAllowed() const { |
if (!in_memory_) |
base::ThreadRestrictions::AssertIOAllowed(); |
} |
@@ -653,6 +670,10 @@ class SQL_EXPORT Connection : public base::trace_event::MemoryDumpProvider { |
// which do not participate in the total-rows-changed tracking. |
void ReleaseCacheMemoryIfNeeded(bool implicit_change_performed); |
+ // Returns the results of sqlite3_db_filename(), which should match the path |
+ // passed to Open(). |
+ base::FilePath DbPath() const; |
+ |
// The actual sqlite database. Will be NULL before Init has been called or if |
// Init resulted in an error. |
sqlite3* db_; |