sqlite_common_configuration_flags.gni 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Compile-time options passed to SQLite when compiling and building
  2. # the Chromium amalgamations.
  3. sqlite_common_configuration_flags = [
  4. "SQLITE_ENABLE_FTS3",
  5. # New unicode61 tokenizer with built-in tables.
  6. "SQLITE_DISABLE_FTS3_UNICODE",
  7. # Chrome does not enable fts4, disable extra code.
  8. "SQLITE_DISABLE_FTS4_DEFERRED",
  9. "SQLITE_ENABLE_ICU",
  10. # Defaults the secure_delete pragma to 1.
  11. #
  12. # This causes SQLite to overwrite all deleted information with zeroes,
  13. # trading additional I/O for better privacy guarantees.
  14. "SQLITE_SECURE_DELETE",
  15. # TODO(pwnall): SQLite adds mutexes to protect structures which cross
  16. # threads. In theory Chrome should be able to turn this to "2" which
  17. # should give a slight speed boost. "2" is safe as long as a single
  18. # connection is not used by more than one thread at a time.
  19. "SQLITE_THREADSAFE=1",
  20. # SQLite can spawn threads to sort in parallel if configured
  21. # appropriately. Chrome doesn't configure SQLite for that, and would
  22. # prefer to control distribution to worker threads.
  23. "SQLITE_MAX_WORKER_THREADS=0",
  24. # Allow 256MB mmap footprint per connection. Should not be too open-ended
  25. # as that could cause memory fragmentation. 50MB encompasses the 99th
  26. # percentile of Chrome databases in the wild.
  27. # TODO(pwnall): A 64-bit-specific value could be 1G or more.
  28. # TODO(pwnall): Figure out if exceeding this is costly.
  29. "SQLITE_MAX_MMAP_SIZE=268435456",
  30. # The default POSIX permissions for a newly created SQLite database.
  31. #
  32. # If unspecified, this defaults to 0644. All the data stored by Chrome is
  33. # private, so our databases use stricter settings.
  34. "SQLITE_DEFAULT_FILE_PERMISSIONS=0600",
  35. # Databases are opened in EXCLUSIVE mode by default.
  36. #
  37. # NORMAL mode, where a database can be used by multiple processes
  38. # simultaneously, can be enabled by executing "PRAGMA locking_mode=0".
  39. #
  40. # https://www.sqlite.org/compile.html#default_locking_mode
  41. # https://www.sqlite.org/pragma.html#pragma_locking_mode
  42. "SQLITE_DEFAULT_LOCKING_MODE=1",
  43. # Needed by the SQL MemoryDumpProvider.
  44. #
  45. # Setting this to 1 is needed to collect the information reported by
  46. # sqlite3_status64(SQLITE_STATUS_MEMORY_USED). Without this setting, the API
  47. # still exists, but does not work as promised.
  48. "SQLITE_DEFAULT_MEMSTATUS=1",
  49. # Must match sql::Database::kDefaultPageSize.
  50. "SQLITE_DEFAULT_PAGE_SIZE=4096",
  51. # By default SQLite pre-allocates 100 pages of pcache data, which will not
  52. # be released until the handle is closed. This is contrary to Chrome's
  53. # memory-usage goals.
  54. "SQLITE_DEFAULT_PCACHE_INITSZ=0",
  55. # The flags below are recommended in the SQLite documentation.
  56. "SQLITE_LIKE_DOESNT_MATCH_BLOBS",
  57. "SQLITE_OMIT_DEPRECATED",
  58. "SQLITE_OMIT_PROGRESS_CALLBACK",
  59. "SQLITE_OMIT_SHARED_CACHE",
  60. "SQLITE_USE_ALLOCA",
  61. # Chrome does not use sqlite3_column_decltype().
  62. "SQLITE_OMIT_DECLTYPE",
  63. # Chrome does not use SQLite's JSON support.
  64. "SQLITE_OMIT_JSON",
  65. # Chrome does not use sqlite3_{enable_}load_extension().
  66. # Asides from giving us fairly minor code savings, this option disables code
  67. # that breaks our method for renaming SQLite's exported symbols. Last,
  68. # there's a tiny security benefit to knowing that WebSQL can't possibly
  69. # reach extension loading code.
  70. "SQLITE_OMIT_LOAD_EXTENSION",
  71. # Uses isnan() in the C99 standard library.
  72. "SQLITE_HAVE_ISNAN",
  73. ]