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

Unified Diff: sql/connection.cc

Issue 1637683003: Add flag to disable mmap in all sql connection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
« no previous file with comments | « sql/connection.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sql/connection.cc
diff --git a/sql/connection.cc b/sql/connection.cc
index 003005a8e6294247df3d5bbea887a54ccd365cd7..20dfb323ee2d4100f2ab80b23ff8a00256634843 100644
--- a/sql/connection.cc
+++ b/sql/connection.cc
@@ -43,6 +43,8 @@ namespace {
// TODO(shess): Better story on this. http://crbug.com/56559
const int kBusyTimeoutSeconds = 1;
+bool mmap_disabled_default = false;
Scott Hess - ex-Googler 2016/01/26 21:51:08 Probably needs to be g_mmap_disabled_default, I th
vichang1 2016/01/27 15:19:16 done.
+
class ScopedBusyTimeout {
public:
explicit ScopedBusyTimeout(sqlite3* db)
@@ -254,6 +256,12 @@ bool Connection::ShouldIgnoreSqliteCompileError(int error) {
basic_error == SQLITE_CORRUPT;
}
+// static
+void Connection::set_mmap_disabled_by_default() {
+ mmap_disabled_default = true;
+}
+
+
void Connection::ReportDiagnosticInfo(int extended_error, Statement* stmt) {
AssertIOAllowed();
@@ -339,7 +347,7 @@ Connection::Connection()
needs_rollback_(false),
in_memory_(false),
poisoned_(false),
- mmap_disabled_(false),
+ mmap_disabled_(mmap_disabled_default),
mmap_enabled_(false),
total_changes_at_last_release_(0),
stats_histogram_(NULL),
« no previous file with comments | « sql/connection.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698