Repository navigation
chore: rebase the custom-scheme code cache patch onto upstream's checks - #53676
Merged
Merged
Conversation
feat_allow_code_cache_in_custom_schemes.patch rewrote CheckSecurityForAccessingCodeCacheData and the two DCHECK helpers in generated_code_cache.cc wholesale, and in doing so dropped the CommonSchemeRegistry::IsExtensionScheme branches Chromium added later and refused http(s) script caching for any process not locked to http(s) or an embedder scheme (file:// pages, standard custom schemes without codeCache). Keep upstream's logic verbatim and only add the embedder-scheme cases via a new url::IsCodeCacheScheme() helper.
deepak1556
approved these changes
Sep 7, 2026
|
Release Notes Persisted
|
Contributor
|
I was unable to backport this PR to "43-x-y" cleanly; |
This was referenced Sep 8, 2026
Contributor
|
I have automatically backported this PR to "44-x-y", please check out #53745 |
Contributor
|
I have automatically backported this PR to "45-x-y", please check out #53746 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
feat_allow_code_cache_in_custom_schemes.patch(#40544, from crrev.com/c/5019665) replacedCheckSecurityForAccessingCodeCacheDataincode_cache_host_impl.ccand theCheckValidResource/CheckValidContextDCHECK helpers ingenerated_code_cache.ccwholesale. Upstream has kept editing those functions since, and the rewrite had drifted from them in two ways:blink::CommonSchemeRegistry::IsExtensionSchemebranches Chromium added for extension script and wasm caching were gone from all three functions (only the one inGetOriginLocksurvived), so achrome-extension://resource write reachedmojo::ReportBadMessage("Invalid URL scheme for code cache.")instead of being cached.file://or on a standard custom scheme registered withoutcodeCache: truelost V8 code caching for scripts they load over https.This rebuilds the patch as upstream's code plus the embedder additions only: a
url::IsCodeCacheScheme()helper next toAddCodeCacheScheme/GetCodeCacheSchemes, one extra disjunct in each DCHECK, one extra branch inCheckSecurityForAccessingCodeCacheData(embedder-scheme scripts are cached only for processes locked to an embedder scheme, as before) and one inGetOriginLock. Thecontent_client.h,url_schemes.cc, header comment and browsertest parts are unchanged. The patch goes from 210 to about 90 changed lines, which should also make the re-upload of the upstream CL easier.feat_allow_enabling_extensions_on_custom_protocols.patchonly shifts context inurl/url_util.cc.Verified on Linux: builds,
protocol.registerSchemesAsPrivileged codeCachespecs pass (disabled by default, enabled withcodeCache: true).Checklist
npm testpassesRelease Notes
Notes: Fixed V8 code caching for https scripts loaded by
file://and custom-scheme pages.