Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Explainer] Support Saved Queries in selectURL #176

Merged
merged 3 commits into from
Sep 17, 2024
Merged

Conversation

pythagoraskitty
Copy link
Collaborator

selectURL() currently has two per-page-load budgets that restrict that number of calls made to selectURL() on each page-load. We propose allowing queries to be saved and reused on a per-page basis, where the per-page-load budgets are charged the first time a saved query is run but not for subsequent runs of the saved query during the same page-load. This will be accomplished with a savedQuery parameter in the options for selectURL() that will name the query.

`selectURL()` currently has two per-page-load budgets that restrict that number of calls made to `selectURL()` on each page-load. 
We propose allowing queries to be saved and reused on a per-page basis, where the per-page-load budgets are charged the first time a saved query is run but not for subsequent runs of the saved query during the same page-load. This will be accomplished with a `savedQuery` parameter in the options for `selectURL()` that will name the query.
@@ -144,6 +144,13 @@ The shared storage worklet invocation methods (`addModule`, `run`, and `selectUR
* `keepAlive` (defaults to false), a boolean denoting whether the worklet should be retained after it completes work for this call.
* If `keepAlive` is false or not specified, the worklet will shutdown as soon as the operation finishes and subsequent calls to it will fail.
* To keep the worklet alive throughout multiple calls to `run()` and/or `selectURL()`, each of those calls must include `keepAlive: true` in the `options` dictionary.
* `savedQuery` (defaults to the empty string), a string naming the query to be saved or reused.
Copy link

@dmdabbs dmdabbs Sep 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The resolveToConfig attribute supported in options isn't described in this section.
It is described, but just above.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, thank you. We will address in a separate PR. Here is an issue to keep track: #177.

pythagoraskitty added a commit that referenced this pull request Sep 10, 2024
We update the spec to support saved queries, as a followup to #176.
README.md Outdated
* `savedQuery` (defaults to the empty string), a string naming the query to be saved or reused.
* If the value of `savedQuery` is nonempty and has not previously been associated with a [result index](#result-index) for call to `selectURL()` on the same page, and if the call to `selectURL()` succeeds:
* The pair of (`savedQuery`, [`index`](#result-index)) will be stored for the lifetime of the page.
* The shared storage data-owning origin's site can reuse the query from anywhere within the page.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use consistent terminology and call it the data origin.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Copy link
Collaborator

@jkarlin jkarlin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm w/ comment

@pythagoraskitty pythagoraskitty removed the request for review from xyaoinum September 17, 2024 17:19
@pythagoraskitty pythagoraskitty merged commit 194f076 into main Sep 17, 2024
1 check passed
@pythagoraskitty pythagoraskitty deleted the cammie-branch3 branch September 17, 2024 17:20
aarongable pushed a commit to chromium/chromium that referenced this pull request Oct 28, 2024
See explainer update at
WICG/shared-storage#176
and spec updates at
WICG/shared-storage#188
WICG/shared-storage#202

Currently the feature is disabled by default. We will enable by
default after the I2S has been sent and approved.

Bug: 367440966
Change-Id: I82d731a7e2d6bcc2368658a619a6eb1d4d751025
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5920781
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1374887}
aarongable pushed a commit to chromium/chromium that referenced this pull request Oct 29, 2024
We add support for saved queries, keyed by
(`data_origin`, `script_url`, `operation_name`, `query_name`).

When a named query is first invoked, the per page budgets are charged
as usual, the index result is stored for later in case the query is
reused from the same page.

On query reuse, the previously calculated and stored index result
will be used to select the URL at that index in the current list, and
the per page budgets will not be re-charged.

When the page is destroyed, all associated saved queries are also
destroyed.

See explainer update at
WICG/shared-storage#176
and spec updates at
WICG/shared-storage#188
WICG/shared-storage#202

Bug: 367440966
Change-Id: I89fd7e65cd14c9d60d6ac53906f95593a2259a37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5868889
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1375507}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 29, 2024
We add support for saved queries, keyed by
(`data_origin`, `script_url`, `operation_name`, `query_name`).

When a named query is first invoked, the per page budgets are charged
as usual, the index result is stored for later in case the query is
reused from the same page.

On query reuse, the previously calculated and stored index result
will be used to select the URL at that index in the current list, and
the per page budgets will not be re-charged.

When the page is destroyed, all associated saved queries are also
destroyed.

See explainer update at
WICG/shared-storage#176
and spec updates at
WICG/shared-storage#188
WICG/shared-storage#202

Bug: 367440966
Change-Id: I89fd7e65cd14c9d60d6ac53906f95593a2259a37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5868889
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1375507}
KyleJu pushed a commit to web-platform-tests/wpt that referenced this pull request Oct 30, 2024
We add support for saved queries, keyed by
(`data_origin`, `script_url`, `operation_name`, `query_name`).

When a named query is first invoked, the per page budgets are charged
as usual, the index result is stored for later in case the query is
reused from the same page.

On query reuse, the previously calculated and stored index result
will be used to select the URL at that index in the current list, and
the per page budgets will not be re-charged.

When the page is destroyed, all associated saved queries are also
destroyed.

See explainer update at
WICG/shared-storage#176
and spec updates at
WICG/shared-storage#188
WICG/shared-storage#202

Bug: 367440966
Change-Id: I89fd7e65cd14c9d60d6ac53906f95593a2259a37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5868889
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1375507}

Co-authored-by: Camillia Smith Barnes <cammie@chromium.org>
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Oct 30, 2024
… selectURL, a=testonly

Automatic update from web-platform-tests
Shared Storage: Support saved queries in selectURL (#48868)

We add support for saved queries, keyed by
(`data_origin`, `script_url`, `operation_name`, `query_name`).

When a named query is first invoked, the per page budgets are charged
as usual, the index result is stored for later in case the query is
reused from the same page.

On query reuse, the previously calculated and stored index result
will be used to select the URL at that index in the current list, and
the per page budgets will not be re-charged.

When the page is destroyed, all associated saved queries are also
destroyed.

See explainer update at
WICG/shared-storage#176
and spec updates at
WICG/shared-storage#188
WICG/shared-storage#202

Bug: 367440966
Change-Id: I89fd7e65cd14c9d60d6ac53906f95593a2259a37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5868889
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1375507}

Co-authored-by: Camillia Smith Barnes <cammie@chromium.org>
--

wpt-commits: 3c0bfa31dc842d0dbce0e377bfd39a4aa0ec4fd9
wpt-pr: 48868
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Oct 31, 2024
… selectURL, a=testonly

Automatic update from web-platform-tests
Shared Storage: Support saved queries in selectURL (#48868)

We add support for saved queries, keyed by
(`data_origin`, `script_url`, `operation_name`, `query_name`).

When a named query is first invoked, the per page budgets are charged
as usual, the index result is stored for later in case the query is
reused from the same page.

On query reuse, the previously calculated and stored index result
will be used to select the URL at that index in the current list, and
the per page budgets will not be re-charged.

When the page is destroyed, all associated saved queries are also
destroyed.

See explainer update at
WICG/shared-storage#176
and spec updates at
WICG/shared-storage#188
WICG/shared-storage#202

Bug: 367440966
Change-Id: I89fd7e65cd14c9d60d6ac53906f95593a2259a37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5868889
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1375507}

Co-authored-by: Camillia Smith Barnes <cammie@chromium.org>
--

wpt-commits: 3c0bfa31dc842d0dbce0e377bfd39a4aa0ec4fd9
wpt-pr: 48868
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Nov 1, 2024
… selectURL, a=testonly

Automatic update from web-platform-tests
Shared Storage: Support saved queries in selectURL (#48868)

We add support for saved queries, keyed by
(`data_origin`, `script_url`, `operation_name`, `query_name`).

When a named query is first invoked, the per page budgets are charged
as usual, the index result is stored for later in case the query is
reused from the same page.

On query reuse, the previously calculated and stored index result
will be used to select the URL at that index in the current list, and
the per page budgets will not be re-charged.

When the page is destroyed, all associated saved queries are also
destroyed.

See explainer update at
WICG/shared-storage#176
and spec updates at
WICG/shared-storage#188
WICG/shared-storage#202

Bug: 367440966
Change-Id: I89fd7e65cd14c9d60d6ac53906f95593a2259a37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5868889
Reviewed-by: Ken Buchanan <kenrbchromium.org>
Reviewed-by: Yao Xiao <yaoxiachromium.org>
Commit-Queue: Cammie Smith Barnes <cammiechromium.org>
Cr-Commit-Position: refs/heads/main{#1375507}

Co-authored-by: Camillia Smith Barnes <cammiechromium.org>
--

wpt-commits: 3c0bfa31dc842d0dbce0e377bfd39a4aa0ec4fd9
wpt-pr: 48868

UltraBlame original commit: be7ca250d6301d51162a3b8b73ec9f0fa1beecf0
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Nov 1, 2024
… selectURL, a=testonly

Automatic update from web-platform-tests
Shared Storage: Support saved queries in selectURL (#48868)

We add support for saved queries, keyed by
(`data_origin`, `script_url`, `operation_name`, `query_name`).

When a named query is first invoked, the per page budgets are charged
as usual, the index result is stored for later in case the query is
reused from the same page.

On query reuse, the previously calculated and stored index result
will be used to select the URL at that index in the current list, and
the per page budgets will not be re-charged.

When the page is destroyed, all associated saved queries are also
destroyed.

See explainer update at
WICG/shared-storage#176
and spec updates at
WICG/shared-storage#188
WICG/shared-storage#202

Bug: 367440966
Change-Id: I89fd7e65cd14c9d60d6ac53906f95593a2259a37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5868889
Reviewed-by: Ken Buchanan <kenrbchromium.org>
Reviewed-by: Yao Xiao <yaoxiachromium.org>
Commit-Queue: Cammie Smith Barnes <cammiechromium.org>
Cr-Commit-Position: refs/heads/main{#1375507}

Co-authored-by: Camillia Smith Barnes <cammiechromium.org>
--

wpt-commits: 3c0bfa31dc842d0dbce0e377bfd39a4aa0ec4fd9
wpt-pr: 48868

UltraBlame original commit: be7ca250d6301d51162a3b8b73ec9f0fa1beecf0
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Nov 1, 2024
… selectURL, a=testonly

Automatic update from web-platform-tests
Shared Storage: Support saved queries in selectURL (#48868)

We add support for saved queries, keyed by
(`data_origin`, `script_url`, `operation_name`, `query_name`).

When a named query is first invoked, the per page budgets are charged
as usual, the index result is stored for later in case the query is
reused from the same page.

On query reuse, the previously calculated and stored index result
will be used to select the URL at that index in the current list, and
the per page budgets will not be re-charged.

When the page is destroyed, all associated saved queries are also
destroyed.

See explainer update at
WICG/shared-storage#176
and spec updates at
WICG/shared-storage#188
WICG/shared-storage#202

Bug: 367440966
Change-Id: I89fd7e65cd14c9d60d6ac53906f95593a2259a37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5868889
Reviewed-by: Ken Buchanan <kenrbchromium.org>
Reviewed-by: Yao Xiao <yaoxiachromium.org>
Commit-Queue: Cammie Smith Barnes <cammiechromium.org>
Cr-Commit-Position: refs/heads/main{#1375507}

Co-authored-by: Camillia Smith Barnes <cammiechromium.org>
--

wpt-commits: 3c0bfa31dc842d0dbce0e377bfd39a4aa0ec4fd9
wpt-pr: 48868

UltraBlame original commit: be7ca250d6301d51162a3b8b73ec9f0fa1beecf0
i3roly pushed a commit to i3roly/firefox-dynasty that referenced this pull request Nov 1, 2024
… selectURL, a=testonly

Automatic update from web-platform-tests
Shared Storage: Support saved queries in selectURL (#48868)

We add support for saved queries, keyed by
(`data_origin`, `script_url`, `operation_name`, `query_name`).

When a named query is first invoked, the per page budgets are charged
as usual, the index result is stored for later in case the query is
reused from the same page.

On query reuse, the previously calculated and stored index result
will be used to select the URL at that index in the current list, and
the per page budgets will not be re-charged.

When the page is destroyed, all associated saved queries are also
destroyed.

See explainer update at
WICG/shared-storage#176
and spec updates at
WICG/shared-storage#188
WICG/shared-storage#202

Bug: 367440966
Change-Id: I89fd7e65cd14c9d60d6ac53906f95593a2259a37
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5868889
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Yao Xiao <yaoxia@chromium.org>
Commit-Queue: Cammie Smith Barnes <cammie@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1375507}

Co-authored-by: Camillia Smith Barnes <cammie@chromium.org>
--

wpt-commits: 3c0bfa31dc842d0dbce0e377bfd39a4aa0ec4fd9
wpt-pr: 48868
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants