• David Van Cleve's avatar
    Revert "Revert URLPattern wildcard to again match some invalid URLs" · 757854e1
    David Van Cleve authored
    This reverts commit 6fbca674.
    
    Reason for revert: This was a short-term bandaid pending a riskier
    but architecturally better fix that has now landed (crrev.com/c/2023047
    by Lukasz).
    
    Original change's description:
    > Revert URLPattern wildcard to again match some invalid URLs
    >
    > This is a partial revert of r715320, which changed
    > URLPattern::MatchesURL to decline to match all invalid
    > (!GURL::is_valid) URLs. This was an inadvertent behavior change;
    > it wasn't clear what the intended behavior was in this case.
    >
    > Reverting this seems to resolve crbug.com/1041880, a bug involving
    > some PDF loads from blob: URLs getting stuck as gray boxes. While
    > r715320 was originally made to resolve a crash---namely, MatchesURL
    > would crash on URLs with empty paths---the follow-up commit r718423
    > adds logic that will still suffice to prevent this crash (this
    > is tested by ExtensionURLPatternTest.WildcardMatchesPathlessUrl and
    > ExtensionURLPatternTest.NonwildcardDoesntMatchPathlessUrl).
    >
    > Changes:
    > - URLPattern: revert the behavior change and update documentation
    > to reflect that intended behavior is actually to allow the wildcard
    > '<all_urls>' pattern to match invalid URLs
    > - URLPattern tests: update to reflect the intended new behavior
    >
    > Bug: 1041880
    >
    > R=​devlin
    >
    > Change-Id: I4f4571c70d0f0dbd7b52cdadbf96a7ea6854cfe0
    > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2022251
    > Reviewed-by: Charlie Reis <creis@chromium.org>
    > Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
    > Commit-Queue: David Van Cleve <davidvc@chromium.org>
    > Commit-Queue: Charlie Reis <creis@chromium.org>
    > Cr-Commit-Position: refs/heads/master@{#735510}
    
    R=rdevlin.cronin@chromium.org
    CC=​creis@chromium.org,lukasza@chromium.org
    
    Bug: 1046397
    Change-Id: I3fd02ac96e3120eb15e1e8bf43ce7dad8185aa03
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2036792Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
    Commit-Queue: David Van Cleve <davidvc@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#738357}
    757854e1
url_pattern.cc 25.6 KB