Bug 310393
| Summary: | Reduce memory overhead of user scripts and user styles in extensions with many distinct match patterns | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ben Nham <nham> |
| Component: | New Bugs | Assignee: | Ben Nham <nham> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | commit-queue, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | 310651 | ||
| Bug Blocks: | |||
Ben Nham
Extensions can specify user scripts and user styles with many distinct match patterns, either directly via the extension manifest or due to user behavior (e.g. if the user decides to load extensions only selectively on certain origins and that origin list is very long). In the current implementation of web extensions, this can lead to memory explosion because each distinct match pattern carries its own copy of the same exact user script and user style strings (see how `WebExtensionContext::addInjectedContent` loops over each pattern and creates an `API::UserScript` object for each pattern).
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ben Nham
rdar://169436824
Ben Nham
https://github.com/WebKit/WebKit/pull/61039
EWS
Committed 309775@main (4ed5ff4bf1ee): <https://commits.webkit.org/309775@main>
Reviewed commits have been landed. Closing PR #61039 and removing active labels.
WebKit Commit Bot
Re-opened since this is blocked by bug 310651
Ben Nham
Pull request: https://github.com/WebKit/WebKit/pull/61422
EWS
Committed 310050@main (2bea83cfe53c): <https://commits.webkit.org/310050@main>
Reviewed commits have been landed. Closing PR #61422 and removing active labels.
EWS
Committed 305413.598@safari-7624-branch (8c2beed1f79f): <https://commits.webkit.org/305413.598@safari-7624-branch>
Reviewed commits have been landed. Closing PR #4846 and removing active labels.