Chromium Code Reviews| Index: sql/connection.cc |
| diff --git a/sql/connection.cc b/sql/connection.cc |
| index d220c8e8d78906aad8f9064bd752ea811ec43cf6..a86af5d8bec36dd1317883819e7d8265c3709c87 100644 |
| --- a/sql/connection.cc |
| +++ b/sql/connection.cc |
| @@ -33,6 +33,7 @@ |
| #include "sql/connection_memory_dump_provider.h" |
| #include "sql/meta_table.h" |
| #include "sql/statement.h" |
| +#include "sql/vfs_wrapper.h" |
| #include "third_party/sqlite/sqlite3.h" |
| #if defined(OS_IOS) && defined(USE_SYSTEM_SQLITE) |
| @@ -1690,7 +1691,12 @@ bool Connection::OpenInternal(const std::string& file_name, |
| DLOG_IF(FATAL, poisoned_) << "sql::Connection is already open."; |
| poisoned_ = false; |
| - int err = sqlite3_open(file_name.c_str(), &db_); |
| + // Custom memory-mapping VFS which reads pages using regular I/O on first hit. |
| + sqlite3_vfs* vfs = VFSWrapper(); |
| + const char* vfs_name = (vfs ? vfs->zName : NULL); |
|
Marijn Kruisselbrink
2017/01/23 23:32:46
nit: this should probably also be nullptr (sorry,
Scott Hess - ex-Googler
2017/01/23 23:47:06
Sorry should be at my end - when you mentioned it
|
| + int err = sqlite3_open_v2(file_name.c_str(), &db_, |
| + SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, |
| + vfs_name); |
| if (err != SQLITE_OK) { |
| // Extended error codes cannot be enabled until a handle is |
| // available, fetch manually. |