| OLD | NEW |
| 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 declare_args() { | 5 declare_args() { |
| 6 # Controls whether the build should uses the version of sqlite3 library | 6 # Controls whether the build should uses the version of sqlite3 library |
| 7 # shipped with the system (currently only supported on iOS) or the one | 7 # shipped with the system (currently only supported on iOS) or the one |
| 8 # shipped with Chromium source. | 8 # shipped with Chromium source. |
| 9 use_system_sqlite = is_ios | 9 use_system_sqlite = is_ios |
| 10 } | 10 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 # TODO(shess): SQLite adds mutexes to protect structures which cross | 61 # TODO(shess): SQLite adds mutexes to protect structures which cross |
| 62 # threads. In theory Chromium should be able to turn this off for a | 62 # threads. In theory Chromium should be able to turn this off for a |
| 63 # slight speed boost. | 63 # slight speed boost. |
| 64 "THREADSAFE", | 64 "THREADSAFE", |
| 65 | 65 |
| 66 # SQLite can spawn threads to sort in parallel if configured | 66 # SQLite can spawn threads to sort in parallel if configured |
| 67 # appropriately. Chromium doesn't configure SQLite for that, and would | 67 # appropriately. Chromium doesn't configure SQLite for that, and would |
| 68 # prefer to control distribution to worker threads. | 68 # prefer to control distribution to worker threads. |
| 69 "SQLITE_MAX_WORKER_THREADS=0", | 69 "SQLITE_MAX_WORKER_THREADS=0", |
| 70 | 70 |
| 71 # Allow 256MB mmap footprint per connection. Should not be too open-ended | |
| 72 # as that could cause memory fragmentation. 50MB encompasses the 99th | |
| 73 # percentile of Chrome databases in the wild. | |
| 74 # TODO(shess): A 64-bit-specific value could be 1G or more. | |
| 75 # TODO(shess): Figure out if exceeding this is costly. | |
| 76 "SQLITE_MAX_MMAP_SIZE=268435456", | |
| 77 | |
| 78 # Use a read-only memory map when mmap'ed I/O is enabled to prevent memory | 71 # Use a read-only memory map when mmap'ed I/O is enabled to prevent memory |
| 79 # stompers from directly corrupting the database. | 72 # stompers from directly corrupting the database. |
| 80 # TODO(shess): Upstream the ability to use this define. | 73 # TODO(shess): Upstream the ability to use this define. |
| 81 "SQLITE_MMAP_READ_ONLY=1", | 74 "SQLITE_MMAP_READ_ONLY=1", |
| 82 | 75 |
| 83 # NOTE(shess): Some defines can affect the amalgamation. Those should be | 76 # NOTE(shess): Some defines can affect the amalgamation. Those should be |
| 84 # added to google_generate_amalgamation.sh, and the amalgamation | 77 # added to google_generate_amalgamation.sh, and the amalgamation |
| 85 # re-generated. Usually this involves disabling features which include | 78 # re-generated. Usually this involves disabling features which include |
| 86 # keywords or syntax, for instance SQLITE_OMIT_VIRTUALTABLE omits the | 79 # keywords or syntax, for instance SQLITE_OMIT_VIRTUALTABLE omits the |
| 87 # virtual table syntax entirely. Missing an item usually results in | 80 # virtual table syntax entirely. Missing an item usually results in |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 } else if (is_android) { | 143 } else if (is_android) { |
| 151 defines += [ | 144 defines += [ |
| 152 "SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576", | 145 "SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576", |
| 153 "SQLITE_DEFAULT_AUTOVACUUM=1", | 146 "SQLITE_DEFAULT_AUTOVACUUM=1", |
| 154 "SQLITE_TEMP_STORE=3", | 147 "SQLITE_TEMP_STORE=3", |
| 155 "SQLITE_ENABLE_FTS3_BACKWARDS", | 148 "SQLITE_ENABLE_FTS3_BACKWARDS", |
| 156 "DSQLITE_DEFAULT_FILE_FORMAT=4", | 149 "DSQLITE_DEFAULT_FILE_FORMAT=4", |
| 157 ] | 150 ] |
| 158 } | 151 } |
| 159 | 152 |
| 153 if (defined(android_channel) && android_channel == "work") { |
| 154 defines += [ |
| 155 "SQLITE_MAX_MMAP_SIZE=0", |
| 156 ] |
| 157 } else { |
| 158 defines += [ |
| 159 # Allow 256MB mmap footprint per connection. Should not be too open-end
ed |
| 160 # as that could cause memory fragmentation. 50MB encompasses the 99th |
| 161 # percentile of Chrome databases in the wild. |
| 162 # TODO(shess): A 64-bit-specific value could be 1G or more. |
| 163 # TODO(shess): Figure out if exceeding this is costly. |
| 164 "SQLITE_MAX_MMAP_SIZE=268435456", |
| 165 ] |
| 166 } |
| 160 deps = [ | 167 deps = [ |
| 161 "//third_party/icu", | 168 "//third_party/icu", |
| 162 ] | 169 ] |
| 163 } | 170 } |
| 164 | 171 |
| 165 config("sqlite_export") { | 172 config("sqlite_export") { |
| 166 if (is_component_build && is_win) { | 173 if (is_component_build && is_win) { |
| 167 defines = [ "SQLITE_API=__declspec(dllimport)" ] | 174 defines = [ "SQLITE_API=__declspec(dllimport)" ] |
| 168 } | 175 } |
| 169 } | 176 } |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 "//third_party/icu", | 244 "//third_party/icu", |
| 238 ] | 245 ] |
| 239 if (is_clang) { | 246 if (is_clang) { |
| 240 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about | 247 # src/ext/icu/icu.c uses assert(!"string") which causes warnings about |
| 241 # conversion from string literal to bool. | 248 # conversion from string literal to bool. |
| 242 configs -= [ "//build/config/clang:extra_warnings" ] | 249 configs -= [ "//build/config/clang:extra_warnings" ] |
| 243 } | 250 } |
| 244 } | 251 } |
| 245 } | 252 } |
| 246 } | 253 } |
| OLD | NEW |