This is a reland of commit 4e37d8b3fb
The CL uses a NOTREACHED_NORETURN which behaves like a CHECK
and eats stream params in official builds. This means that
instead of EXPECT_DEATH_IF_SUPPORTED, the correct macro to use for
a death test for NOTREACHED_NORETURN is EXPECT_CHECK_DEATH_WITH.
Patchset 2 updates the CL to this expectation.
BUG=1429117,1430341
Original change's description:
> Add ability to open cookie database file with exclusive flag.
>
> This CL adds the ability to specify that the sqlite file containing
> cookies be opened with the `exclusive` uri parameter. On Windows,
> this instructs sqlite to open it without the FILE_SHARE_READ and
> FILE_SHARE_WRITE sharing dispositions, meaning that handles can
> no longer be obtained to the file while the database is open.
>
> The flag is wired up through the net/extras/sqlite layer and into
> the network service, where it is exposed as an optional parameter
> on network_context.
>
> In //chrome, the flag is set on Windows for profile based cookie
> stores, based on the feature LockProfileCookieDatabase, which is
> disabled by default.
>
> Tests are added at each layer to verify the behavior:
> - sql_unittests ->
> that the new parameter enable_exclusive_database_file_lock is
> respected.
> - net_unittests ->
> that the new parameter to SQLitePersistentCookieStore is
> respected.
> - browser_tests ->
> that the feature LockProfileCookieDatabase successfully
> toggles the feature for the profile cookie store.
>
> BUG=1429117
>
> Change-Id: I2beaa0eab330535eecf733ecc8fd6a93f748227a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4378424
> Reviewed-by: Reilly Grant <reillyg@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Austin Sullivan <asully@chromium.org>
> Reviewed-by: Rohit Rao <rohitrao@chromium.org>
> Commit-Queue: Will Harris <wfh@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1125803}
Bug: 1429117
Change-Id: I3f8fa57527c6c15bccb5ef1b28d0f315165b883d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4396113
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1126252}
This reverts commit 4e37d8b3fb.
Reason for revert: Suspected culprit for sql_unittests failures on
ChromeOS
See e.g.:
https://ci.chromium.org/ui/p/chrome/builders/ci/linux-chromeos-chrome/31726/overview
Original change's description:
> Add ability to open cookie database file with exclusive flag.
>
> This CL adds the ability to specify that the sqlite file containing
> cookies be opened with the `exclusive` uri parameter. On Windows,
> this instructs sqlite to open it without the FILE_SHARE_READ and
> FILE_SHARE_WRITE sharing dispositions, meaning that handles can
> no longer be obtained to the file while the database is open.
>
> The flag is wired up through the net/extras/sqlite layer and into
> the network service, where it is exposed as an optional parameter
> on network_context.
>
> In //chrome, the flag is set on Windows for profile based cookie
> stores, based on the feature LockProfileCookieDatabase, which is
> disabled by default.
>
> Tests are added at each layer to verify the behavior:
> - sql_unittests ->
> that the new parameter enable_exclusive_database_file_lock is
> respected.
> - net_unittests ->
> that the new parameter to SQLitePersistentCookieStore is
> respected.
> - browser_tests ->
> that the feature LockProfileCookieDatabase successfully
> toggles the feature for the profile cookie store.
>
> BUG=1429117
>
> Change-Id: I2beaa0eab330535eecf733ecc8fd6a93f748227a
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4378424
> Reviewed-by: Reilly Grant <reillyg@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Reviewed-by: Austin Sullivan <asully@chromium.org>
> Reviewed-by: Rohit Rao <rohitrao@chromium.org>
> Commit-Queue: Will Harris <wfh@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1125803}
Bug: 1429117
Change-Id: I84b563c91ddfafecc28a10cfbe16a370854cc827
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4396349
Commit-Queue: Rune Lillesveen <futhark@chromium.org>
Auto-Submit: Rune Lillesveen <futhark@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1125865}
This CL adds the ability to specify that the sqlite file containing
cookies be opened with the `exclusive` uri parameter. On Windows,
this instructs sqlite to open it without the FILE_SHARE_READ and
FILE_SHARE_WRITE sharing dispositions, meaning that handles can
no longer be obtained to the file while the database is open.
The flag is wired up through the net/extras/sqlite layer and into
the network service, where it is exposed as an optional parameter
on network_context.
In //chrome, the flag is set on Windows for profile based cookie
stores, based on the feature LockProfileCookieDatabase, which is
disabled by default.
Tests are added at each layer to verify the behavior:
- sql_unittests ->
that the new parameter enable_exclusive_database_file_lock is
respected.
- net_unittests ->
that the new parameter to SQLitePersistentCookieStore is
respected.
- browser_tests ->
that the feature LockProfileCookieDatabase successfully
toggles the feature for the profile cookie store.
BUG=1429117
Change-Id: I2beaa0eab330535eecf733ecc8fd6a93f748227a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4378424
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Reviewed-by: Rohit Rao <rohitrao@chromium.org>
Commit-Queue: Will Harris <wfh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1125803}
clang plugin cannot read external files when used with goma so
this change transitions manual-field-to-ignore.txt entries to
RAW_PTR_EXCLUSION macros.
This change only covers files used in the linux build.
Change-Id: Idea1c8c7ab1aa1dc88ba4031e02fc81228f9f6d0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4335650
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Owners-Override: Keishi Hattori <keishi@chromium.org>
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1122242}
Add RAW_PTR_EXCLUSION to files in ui/ etc. where the rewriter could not automatically rewrite.
Change was generated by processing the output of the rewriter.
AX-Relnotes: n/a.
Bug: 1273182
Change-Id: I5f3a9e2a59629545b915d5344d54623fcd34fe94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4168832
Owners-Override: Keishi Hattori <keishi@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Commit-Queue: Keishi Hattori <keishi@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1121616}
Compiling with this flag is required to support the new built-in
corruption recovery module. This was undocumented until recently,
but the documentation now exists here:
https://www.sqlite.org/recovery.html#source_code_files
The SQLITE_DBPAGE virtual table is a powerful feature that should
be enabled with caution. See https://www.sqlite.org/dbpage.html
Its documentation suggests that use of this table "can very easily
cause unrecoverable database corruption" and to "not allow untrusted
components to access the SQLITE_DBPAGE table."
This CL therefore disables use of the table in WebSQL and suggests in
numerous places that the table is not to be used in Chrome code.
Bug: 1385500
Change-Id: Ida69f4854dcd69449e99b2f50ca6e516a58944f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4298063
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Commit-Queue: Evan Stade <estade@chromium.org>
Auto-Submit: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1113643}
VirtualCursor::FromSqliteCursor required that VirtualCursor had a
standard layout, but in fact VirtualCursor shouldn't have a standard
layout, and the fact that it does with libc++ is a deviation from the
C++ standard. This change:
1. Relaxes the requirement that VirtualCursor has a standard layout, and
2. Relaxes the requirement that the sqlite_cursor_ field has to be at
offset 0
by use of offsetof() and pointer subtraction. This change both improves
standards compliance and makes this code build with libstdc++.
Bug: 1380656
Change-Id: I9c47abd9197b187da0360ca5619ccf7dadab4f33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4292313
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Elly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1111925}
Also fix IWYU errors in files that transitively included
activity_tracker.h.
This does not remove the Try() call in LockImpl::Lock() because
base/allocator/partition_allocator/spinning_mutex.h is implemented
using the try-and-then-acquire pattern so its performance is well
known. Also removes the LIKELY annotation to match the
spinning_mutex.h implementation.
Bug: 1415328
Change-Id: Ia68184c931d8b13ae3cee46048338fdfc4242e0b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4273206
Reviewed-by: Will Harris <wfh@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Commit-Queue: Joe Mason <joenotcharles@google.com>
Cr-Commit-Position: refs/heads/main@{#1108550}
RecordReader always assumed PayloadReader was initialized properly so I
thought that may have been the issue, but it turns out that the
PayloadReader _was_ being initialized, but max_overflow_payload_size_
was not being set in some cases where it should be. I don't fully
understand this code or if the test case is valid, but failing the read
by returning early should at least be safe (and makes the fuzzer happy)
The extra initialization checks ended up not being needed, but it's
a nice change so I've kept it in the CL
Bug: 1417151
Change-Id: I16bbe4dafc5ddc4c688ca59922c176be36025cc0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4264791
Commit-Queue: Austin Sullivan <asully@chromium.org>
Reviewed-by: Ayu Ishii <ayui@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1106988}
This will help prevent erroneous usage that could lead to partial
schema initialization and therefore subsequent crashes or unintended
behavior.
All callers have been updated in crbug.com/1414055.
Bug: 1414055
Change-Id: Ia25051c34c239f23d12dbd598a895d0924fee54c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4227535
Quick-Run: Andrew Paseltiner <apaseltiner@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1102885}
An incorrect version number can cause issues with migrations, including
crashes, so Init should function atomically and only commit its
transaction if all meta table operations succeeded.
We accomplish this by returning success/failure from the two version-
setter methods, which also allows callers to return early from their
own migration code.
Change-Id: I2ed6ad38623ff46a53711e3d1041f8878a546cc1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4228100
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
Quick-Run: Andrew Paseltiner <apaseltiner@chromium.org>
Code-Coverage: Findit <findit-for-me@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1102399}
base::span will shortly require that length is unsigned.
This CL adds a checked_cast for `result_size` as it is a
value returned from `sqlite3_column_bytes` which cannot
be guaranteed to always be unsigned.
This is part of a larger CL https://crrev.com/c/4211460.
BUG=1385166
Change-Id: Ic1fb9a3b3f2ecd4ae86b85810892bc0fdb642e77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4214451
Commit-Queue: Will Harris <wfh@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1100265}
These helpers use the recommended approach to serialize/deserialize a
base::TimeDelta to/from int64.
These methods are added to encourage usage of built-in ways to insert
and retrieve a TimeDelta from a sql database, and discourage usage of
the `statement.BindInt64(delta.ToInternalValue())` pattern since TimeDelta::ToInternalValue is deprecated.
Bug: 1402777, 1195962
Change-Id: Ia6db6b8ff862be25d60b6ffa67f4e7e56204330d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4118621
Reviewed-by: Christos Froussios <cfroussios@chromium.org>
Reviewed-by: manuk hovanesian <manukh@chromium.org>
Commit-Queue: Kirubel Aklilu <kaklilu@chromium.org>
Reviewed-by: Evan Stade <estade@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1085968}
These compilation units had a transitive dependency on ostream via
base/numerics/safe_conversions.h. The ostream include in
safe_conversions.h is however unused and should be removed.
This CL was uploaded by git cl split.
R=asully@chromium.org
Bug: 1270812, 1372522
Change-Id: Id420de6fc4290a9d0bb52637d7571fb0f14b6010
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4057546
Auto-Submit: Jean-Philippe Gravel <jpgravel@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1076367}
The changes were generated by running
tools/clang/rewrite_raw_ref_fields/rewrite-multiple-platforms.sh with
tool-arg=--enable_raw_ref_rewrite
`raw_ref` is a smart pointer for a pointer which can not be null, and
which provides Use-after-Free protection in the same ways as raw_ptr.
This class acts like a combination of std::reference_wrapper and
raw_ptr.
See raw_ptr and //base/memory/raw_ptr.md for more details on the
Use-after-Free protection.
Bug: 1357022
Change-Id: Ibcd714bd5a8e408aa31f07a04c5fc67f7eff4e3e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4001524
Owners-Override: danakj <danakj@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1069181}
This CL is a partial revert of:
https://chromium-review.googlesource.com/c/chromium/src/+/3727775
Earlier this year, I changed SQLITE_ERROR to be non-catastrophic,
under the hypothesis that we had a wrong SQL statement in the code
somewhere.
We never found that wrong statement, and now I think it doesn't exist.
What we did find is:
1. A lot of failed transaction commits or begins.
2. A few database schemas that didn't match the reported version.
Both of those suggest genuine database corruption, so going back to
razing the database in those cases makes sense.
I DID implement a RAII singleton for the History long-running
transaction though, so we should have eliminated unintentional
transaction nesting at least.
Bug: 1321483, 1367850, 1354173
Change-Id: I7954da0add89e43644de2afc0e78d5f21314650a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4006396
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Tommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1067772}
This allows:
- features to be defined with a consistent set of qualifiers, and for
that set of qualifiers to be updated over time as appropriate.
- better PRESUBMIT checks to ensure that base::Features are not defined
in headers.
- simplifies things for scripts trying to extract feature definitions
out of C++ code.
The primary CL was generated using a script that automatically rewrites
base::Feature declarations and definitions to the macro form. Changes to
any files with known incompatibilities with the macros (base::Features
without static storage duration and base::Features declared as static
class members) were then fully reverted; those changes will be manually
handled in followups.
This CL was uploaded by git cl split.
R=asully@chromium.org
Bug: 1364289
Change-Id: Ib72314440a729540f22a58022fab85cab5dc6a19
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3923023
Auto-Submit: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1052139}
Assuming that transactions are primarily used for correctness with
respect to write atomicity, callers should be expected to check the
return value of Begin and retry at a higher level if necessary, rather
than silently proceed with non-transactional writes.
Note that we make a slight behavioral change to
chrome/browser/android/explore_sites/get_catalog_task.cc to account for
this, since it has an obvious implementation.
Change-Id: Ifebe9fc56ea9a26c9bcc054cfe1240de4ff79c7e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3895361
Reviewed-by: Austin Sullivan <asully@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Andrew Paseltiner <apaseltiner@chromium.org>
Quick-Run: Andrew Paseltiner <apaseltiner@chromium.org>
Reviewed-by: Justin DeWitt <dewittj@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1048231}
Adds the result of `Database::GetErrorMessage()` to the diagnostics
struct uploaded to Chrometto.
This is necessary because the existing data didn't allow us to
diagnose the error which occurs inside a transaction.
Google3 side CL that adds this field:
cl/473102826
Bug: 1321483
Change-Id: I67a2e5aa012cb95f001a50402248ab7f5f7c6936
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3885062
Reviewed-by: Stephen Nusko <nuskos@chromium.org>
Commit-Queue: Tommy Li <tommycli@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1046610}
This CL is a no-op.
Only fixing instances where base::Time (and Ticks/Delta) is used in
a statement (i.e. not as a parameter to avoid adding includes in mere
overrides). Skipping pointer and reference qualified instances.
i.e. matches this regex:
'(\n *[^/\n][^/\n][^/\n]*base::(Time|Thread)(Ticks|Delta)?\b[^*&][^)]*;)'
and skipping files that have any existing fwd-decl for any of the
variants.
This is a prereq to remove unused base/task/post_task.h includes in
https://chromium-review.googlesource.com/c/chromium/src/+/3555247
Bug: 1026641
Change-Id: I87b43a8dc92bdceb67f4bd59b327b54813aa72a6
AX-Relnotes: n/a.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3557354
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#987283}
This CL performs the following cleanups.
* SQLDatabaseTest.Rollback is deleted, because it's redundant with
SQLTransactionTest.ExplicitRollback and
SQLTransactionTest.NestedRollback.
* SQLDatabaseTest.RazeLock is broken into
SQLDatabaseTest.Raze_OtherConnectionHas{Read,Write}lock.
* SQLDatabaseTest.RazeEmptyDB is renamed to EmptyDatabaseFile
* SQLDatabaseTest.RazeAndClose and RazeAndClose_Diagostics are broken
into RazeAndClose, RazeAndClose_{DeletesData, IsOpen,
Reopen_NoChanges, OpenTransaction, Preload_NoCrash, DoesTableExist,
IsSQLValid, Execute, GetUniqueStatement, GetCachedStatement,
TransactionBegin} and Close_IsSQLValid.
* RazeAndClose_Invalidates{Unique,Cached}Statement are added, based on
the tests involving `valid_statement` in SQLDatabaseTest.Poison.
* SQLDatabaseTest.Poison is broken into sub-tests that parallel the
RazeAndClose_* tests.
* SQLDatabaseTest.AttachDatabase{WithOpenTransaction} are cleaned up and
ported away from sql::Database's direct transaction APIs.
* The modified tests have their SQL statements updated to follow the SQL
style guide.
This CL is intended to give us better coverage around
Database::RazeAndClose() and Database::Poison(), and start migrating
away from Database::{Begin,Rollback,Commit}Transaction() APIs.
Bug: 1310577, 1311718
Change-Id: I1c970988851dd098c0deddb297242e37f4654340
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3558074
Reviewed-by: Austin Sullivan <asully@chromium.org>
Auto-Submit: Victor Costan <pwnall@chromium.org>
Commit-Queue: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/main@{#987134}
This CL performs the following cleanups on sql::MetaTable.
* Replace all SELECT variants with PrepareGetStatement() and all INSERT
variants with PrepareSetStatement(). Asides from reducing code
duplication, this will reduce the number of prepared statements in the
database's cache.
* Move Prepare{Get,Set}Statement() from private static methods to
functions in the implementation file's anonymous namespace.
* Replace const char* arguments with base::StringPiece.
* Replace pointers with references for out arguments. This change is
currently scoped to internal APIs, because changing external APIs
would require updates across the whole codebase.
* Remove the SetValue() override that takes an int value. The C++
compiler's override selection will implicitly migrate callsites to the
SetValue() override that takes an int64_t.
* Migrate the GetValue() implementation from ColumnInt() to
ColumnInt64().
* Tighten SQL query syntax by removing unnecessary extra spaces.
* Add DCHECKs documenting (and checking) preconditions.
* IWYU fixes in both the header and the implementation file.
This CL does not change the meta table's schema. While that is
suboptimal, fixing it will require migration code, which would be best
done in a separate CL.
Bug: 1228463, 1299863
Change-Id: I1f8bfed7aa021470d5ae47cd94bfa0acc9f11ecf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3556693
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#986697}
https://crrev.com/c/3520185 removed error checks in the code calling
sqlite3_backup_init(), based on a DCHECK that suggested the function
should not error out given our usage.
Crash data from the field proved this assumption was incorrect. This
CL adds a test demonstrating one failure case, and adds error handling
back in the code calling sqlite3_backup_init().
Bug: 1308325
Change-Id: I6c54a521faeb7812d01f7c9645646aba4ccb693f
Tested: New test hit the deleted DCHECK (before it was deleted).
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3554638
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#986071}
sqlite3_sql() returns a short-lived buffer. Copying the buffer contents
into a std::string immediately spares us from having to reason about
that buffer's lifetime.
Change-Id: I934d459aeef54f846804373c51c9b1ee629b8891
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3544494
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#984309}
This CL moves ReadPageSize() from an anonymous namespace to
to ensure that SQLite is indeed using the indicated page size.
sql: :test:ReadDatabasePageSize() and uses it in DatabaseOptions's test
Change-Id: If037ed19e96a88d7a199bb98685e7bd6b561730a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3541048
Auto-Submit: Victor Costan <pwnall@chromium.org>
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#983717}