Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(22)

Unified Diff: sql/connection.h

Issue 1393393007: [sql] Track uploads of diagnostic data to prevent duplication. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missing FILE_PATH_LITERAL Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sql/connection.h
diff --git a/sql/connection.h b/sql/connection.h
index 7d2ab6a355bfc9d448f4f58fd18480b2e3d1d722..b12e43f36be6dfe8a875ce1fc4d1e31b3b1cde40 100644
--- a/sql/connection.h
+++ b/sql/connection.h
@@ -470,6 +470,14 @@ 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 determine if it would be appropriate to upload a diagnostic crash
+ // dump for this database. Returns |false| if a previous dump was uploaded,
+ // or if the database directory is broken in a way which prevents recording
+ // the intention to upload (implying that the system is probably broken in a
+ // way which Chromium cannot address). Should return |true| only once for
+ // each unique histogram tag.
pkotwicz 2015/10/15 18:02:30 Nit: In the comment can you mention that calling S
Scott Hess - ex-Googler 2015/10/15 21:12:21 Changed to RegisterIntentToUpload(), with the retu
pkotwicz 2015/10/15 23:31:06 I like this function name better. Thanks for chang
+ bool ShouldUploadDiagnosticDump() const;
+
private:
// For recovery module.
friend class Recovery;
@@ -504,7 +512,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 +661,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);
+ // Return the results of sqlite3_db_filename(), which should match the path
+ // passed to Open().
pkotwicz 2015/10/15 18:02:30 Nit: Return -> Returns
Scott Hess - ex-Googler 2015/10/15 21:12:21 Acknowledged. Also moved impl to after ReleaseCac
+ 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_;

Powered by Google App Engine
This is Rietveld 408576698