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

Unified Diff: sql/test/test_helpers.h

Issue 1176653002: mandoline filesystem: add a sqlite3 vfs to proxy filesystem usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch cleanup now that gn check passes. Created 5 years, 6 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/test/test_helpers.h
diff --git a/sql/test/test_helpers.h b/sql/test/test_helpers.h
index e93b207c566b855e88e9650495a6c5f2b965e8f6..931bf9d2d66769a9078f77790ccc1469171aa392 100644
--- a/sql/test/test_helpers.h
+++ b/sql/test/test_helpers.h
@@ -23,14 +23,11 @@ class Connection;
namespace sql {
namespace test {
-// SQLite stores the database size in the header, and if the actual
-// OS-derived size is smaller, the database is considered corrupt.
-// [This case is actually a common form of corruption in the wild.]
-// This helper sets the in-header size to one page larger than the
-// actual file size. The resulting file will return SQLITE_CORRUPT
-// for most operations unless PRAGMA writable_schema is turned ON.
-//
-// Returns false if any error occurs accessing the file.
+unsigned ReadBigEndian(unsigned char* buf, size_t bytes);
+void WriteBigEndian(unsigned val, unsigned char* buf, size_t bytes);
+
+// Raw version of CorruptSizeInHeader that operates on local files. This is
+// exposed because there's a lot of code outside of //sql/ which uses this.
bool CorruptSizeInHeader(const base::FilePath& db_path) WARN_UNUSED_RESULT;
// Frequently corruption is a result of failure to atomically update

Powered by Google App Engine
This is Rietveld 408576698