-
Notifications
You must be signed in to change notification settings - Fork 29
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
Conversation
`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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm w/ comment
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}
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}
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}
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>
… 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
… 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
… 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
… 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
… 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
… 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
selectURL()
currently has two per-page-load budgets that restrict that number of calls made toselectURL()
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 asavedQuery
parameter in the options forselectURL()
that will name the query.