New issue
Advanced search Search tips

Issue 867549 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 31
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 1
Type: Bug

Blocking:
issue 867547



Sign in to add a comment

Extensions: Better URLPattern intersections

Project Member Reported by rdevlin....@chromium.org, Jul 25

Issue description

We need to add support for better URLPattern intersection determination in order to handle issue 867547.

For instance, the intersection of http://*/maps and *://google.com/* should be http://google.com/maps.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jul 27

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/907d7969954bdb80c059a8790257235affbe0d6a

commit 907d7969954bdb80c059a8790257235affbe0d6a
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Jul 27 16:41:00 2018

[Extensions] Add URLPattern::CreateIntersection()

Add a URLPattern::CreateIntersection() method to return the
intersection of two URLPatterns, if any. This can construct a new
URLPattern in many cases.

For instance, the intersection returned between http://*.google.com/*
and *://google.com/maps is http://google.com/maps.

This CL does not add any (non-test) usages of the new method.

Bug:  867549 

Change-Id: I590081fa6d57bcc88c831095b50d21e20e9ec049
Reviewed-on: https://chromium-review.googlesource.com/1150413
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578669}
[modify] https://crrev.com/907d7969954bdb80c059a8790257235affbe0d6a/extensions/common/url_pattern.cc
[modify] https://crrev.com/907d7969954bdb80c059a8790257235affbe0d6a/extensions/common/url_pattern.h
[modify] https://crrev.com/907d7969954bdb80c059a8790257235affbe0d6a/extensions/common/url_pattern_unittest.cc

Project Member

Comment 2 by bugdroid1@chromium.org, Jul 27

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6d16f50c987d497132f22b1f69d04525be757c39

commit 6d16f50c987d497132f22b1f69d04525be757c39
Author: Devlin Cronin <rdevlin.cronin@chromium.org>
Date: Fri Jul 27 18:55:38 2018

[Extensions] Improve semantic intersection of URLPatternSet

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: Karan Bhatia <karandeepb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578731}
[modify] https://crrev.com/6d16f50c987d497132f22b1f69d04525be757c39/extensions/common/manifest_handlers/automation.cc
[modify] https://crrev.com/6d16f50c987d497132f22b1f69d04525be757c39/extensions/common/permissions/permission_set.cc
[modify] https://crrev.com/6d16f50c987d497132f22b1f69d04525be757c39/extensions/common/url_pattern_set.cc
[modify] https://crrev.com/6d16f50c987d497132f22b1f69d04525be757c39/extensions/common/url_pattern_set.h
[modify] https://crrev.com/6d16f50c987d497132f22b1f69d04525be757c39/extensions/common/url_pattern_set_unittest.cc

Status: Fixed (was: Started)

Sign in to add a comment