• Devlin Cronin's avatar
    [Extensions] Improve semantic intersection of URLPatternSet · 6d16f50c
    Devlin Cronin authored
    Improve the semantic intersection logic in URLPatternSet to utilize
    URLPattern::CreateIntersection(). This allows callers to create an
    intersection between two sets that will include patterns that were
    not explicitly in either set, such as constructing the pattern
    `http://chromium.org/*` from `http://*/*` and `*://chromium.org/*`.
    
    Since not all callers may want this behavior, and in order to
    introduce three separately named Create*Intersection methods in
    URLPatternSet, add an enum, IntersectionBehavior, for callers to
    specify the type of intersection behavior to use. This includes
    string comparison (STL-set-style intersection), patterns explicitly
    contained by both sets (the old semantic intersection), and detailed
    (the new and improved semantic intersection).
    
    Add unit tests for the same.
    
    Bug: 867549
    
    Change-Id: Ic80bec8c8c8bbac188efcf2862d92582379c5a7c
    Reviewed-on: https://chromium-review.googlesource.com/1150919
    Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
    Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#578731}
    6d16f50c
url_pattern_set.cc 9.73 KB