forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add sql::DatabaseOptions to encapsulate its configuration options
sql::Database uses internal state to manage its configuration options like page size, journal mode etc. These options need to be set before Database::Open() is called. Any change to this state has no effect if done after the database has already been opened. There are also some SQLite subtleties around different behaviour of this state depending on whether the database is being opened for the first time or being re-opened. This change encapsulates all such state into a sql::DatabaseOptions struct which is passed to the sql::Database constructor. This ensures that the required options have been configured before calling Open(). We migrate sql/ to use the new constructor instead of the setters for the state. In upcoming changes, we plan to remove the setters for this state. This will make the Database API enforce that the options are set only once and stay the same over the lifetime of the object. Bug: 1126968 Change-Id: Id44b6b3883f7a695f3b5cd96ad071e15cb1dc44a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2427035 Commit-Queue: Shubham Aggarwal <shuagga@microsoft.com> Reviewed-by: Victor Costan <pwnall@chromium.org> Cr-Commit-Position: refs/heads/master@{#817386}
- Loading branch information
Shubham Aggarwal
authored and
Commit Bot
committed
Oct 15, 2020
1 parent
afa39cc
commit 7b60fe6
Showing
7 changed files
with
140 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.