This is a preparation for publishing to crates.io. Changes include:
- Add `servo-` prefixes to avoid name collisions on crates.io
- Use `-` instead of `_` in package names.
- Rename the crates to their original names in Cargo.toml,
to keep the diff minimal
- Rename `media` to `servo-media-thread` to avoid name collision with
`servo-media` (originally from the media repository).
This is an outcome of the previous discussion at [#general > Switch
remaining git dependencies to
crates.io](https://servo.zulipchat.com/#narrow/channel/263398-general/topic/Switch.20remaining.20git.20dependencies.20to.20crates.2Eio/with/576336288)
Testing: This should be mostly covered by our CI, but some amount of
breakage is to be expected, since some package names could still be
referenced from scripts which are not tested or run in CI. [mach try
run](https://github.com/jschwe/servo/actions/runs/22502945949)
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This changes does three things:
- Updates all specification links to reflect version 3 of the
specification
- Renames the `IDBDatabase::close` member to
`IDBDatabase::close_pending` to better match the specification
- Adds a `OpenRequest::processed` member, again to better match the
specification
Testing: This should not change behavior, so is covered by existing
IndexedDB WPT tests.
Fixes: Part of #40983
---------
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Indexeddb: transaction lifecycle
Testing: more Indexeddb test should pass
part of #40983
---------
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
#42442 triggered a bunch of intermittent panics due to DBs being cleaned
up while tests were still trying to use them. This is very difficult to
test reliably, but replacing calls to unwrap with sending error values
to the script thread is clearly an improvement.
Testing: Some intermittent crashes now turn into intermittent timeouts.
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
`local_storage_origins` is ~2-3kb of memory, which is probably large
enough to be included in the report, given that it likely can grow much
more. A much bigger memory user is sqlite3, but I'm still working on
finding a way to extract memory usage for it.
Testing: Manual
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Retrieve already stored indexes from the backend when querying for other
object store data.
Also removes the extraneous blocking IPC call when creating an
`IDBObjectStore` object by batching all the info into a single struct.
Testing: WPT
Fixes: #42438
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Implements `createIndex` and `deleteIndex`, they have already been
implemented in the backend.
Testing: WPT
Fixes: Partially #38100
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Implement the full connection lifecycle, from opening and potentially
upgrading a database, waiting on existing connections to close, firing
the versionchange and blocked events, and updating pending open requests
when connections close.
Testing: WPT
Fixes: Part of https://github.com/servo/servo/issues/40983
---------
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Bug that would result in local storage changes being overwritten by
session storage ones.
Testing: Added a unit test
Fixes: #41324
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Track open requests by their ID, so that specific requests can be
aborted instead of aborting all request for a given db name. This is
important because worker and windows at the same origin could be opening
databases and aborting their opening, but this should not affect other
scopes at the origin.
Testing: Existing WPT test suites.
Fixes: None, but part of https://github.com/servo/servo/issues/40983
---------
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
sessionStorage entries are identified via their associated origins and
removed
across all browsing contexts. This brings sessionStorage in line with
cookies,
which were already handled by the API.
Both public and private browsing contexts are included in the clearing
operation.
The necessary support has been added to the storage crate to clear
WebStorage
data.
Testing: A new integration test has been added.
Signed-off-by: Jan Varga <jvarga@igalia.com>
Moves the concept of databases closer to the 3.0 spec, by implementing
the delete functionality, and the method returning current databases to
script.
Testing: WPT tests with new passes
Fixes: The "Implement databases deletion and `databases`" item of
https://github.com/servo/servo/issues/40983
---------
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
This PR adds an initial `site_data` API to `SiteDataManager`, allowing
embedders to obtain a unified list of sites that have associated site
data.
The implementation introduces supporting infrastructure across storage
and
`SiteDataManager` layers, including a small helper for obtaining
WebStorage
origins and initial support for filtering by storage type. At this
stage,
sites correspond directly to origins, future work will extend this to
higher
level grouping (e.g. domain or eTLD+1).
Testing: Added a new integration test covering site data behavior across
localStorage and sessionStorage.
---------
Signed-off-by: Jan Varga <jvarga@igalia.com>
I added error handling for handle_open_db but I also added it to
SqliteEngine::new and handle_sync_operation because we also open db
there, so I am not sure about these two.
part of #40983
---------
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
This PR adds support for listing origins that have associated WebStorage
data.
Both localStorage and sessionStorage are supported. For sessionStorage,
origins are reported if data exists in any browsing context, while only
localStorage origins persist across restarts.
The implementation introduces an internal origin descriptor abstraction
to support future extensions, such as reporting perorigin usage.
This functionality is primarily intended to be used by
`SiteDataManager`.
Testing: Added a unit test covering origin listing before and after
restart.
---------
Signed-off-by: Jan Varga <jvarga@igalia.com>
Moving IndexedDB to use the generic channel methods.
Of note is the change in 'IDBRequest::execute_async'. This method
previously added a channel that was constructed from the callsite in put
into the AsyncOperation. Now we do not take a function but take a
'FnOnce(GenericCallback<BackendResult<T>>) -> AsyncOperation'. With this
the callsite can construct the AsyncOperation to give in the
'IndexedDBThreadMsg::Async'.
The rest are mostly just type changes.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Testing: WPT tests on the IndexedDB subset still pass.
---------
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This PR introduces a new storage coordination thread, intended to serve
as the central point for managing all current and future storage
endpoints in Servo.
In addition to the new coordination thread, this PR also lays the
infrastructure required to develop a parallel, next-generation IndexedDB
implementation under the indexeddb_next feature flag living on a
separate branch.
Testing: Unit and WPT tests continue to pass
---------
Signed-off-by: Jan Varga <jvarga@igalia.com>
Allows for key ranges to be deleted, as per spec.
Testing: WPT
---------
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
move unit tests to a separate mod test
Testing: existing unit test still runs with mach test-unit.
This change will reduce the amount of code that the compiler has to
compile when we are not running tests.
Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
Clarifies the remaining references to `storage` that actually refer to
`webstorage`.
Testing: Refactor
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Add the prefix of "WebStorage" instead of "Storage" for all webstorage
spec related things. For example, a `struct` called `StorageManager`:
this could refer to either webstorage's thread manager or to the backend
for [the storage manager
interface](https://storage.spec.whatwg.org/#storagemanager). webstorage
is the full name of the spec, so I chose to keep that in the names of
files/structs to prevent confusion when storage manager is implemented.
Signed-off-by: Ashwin Naren <arihant2math@gmail.com>