Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Issue 7229012: Use extension match pattern syntax in content settings extension API (Closed)

Created:
9 years, 6 months ago by Bernhard Bauer
Modified:
9 years, 5 months ago
CC:
chromium-reviews, Aaron Boodman, Erik does not do reviews, Paweł Hajdan Jr., jochen (gone - plz use gerrit), markusheintz_
Visibility:
Public.

Description

Use extension match pattern syntax in content settings extension API. This requires adding a port to a URLPattern, but that shouldn't change existing behavior, as we already have a lenient parsing mode there. BUG=71067 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=91099

Patch Set 1 #

Patch Set 2 : cleanup #

Patch Set 3 : update api #

Patch Set 4 : unit test #

Total comments: 6

Patch Set 5 : review #

Total comments: 1

Patch Set 6 : fix #

Patch Set 7 : review #

Patch Set 8 : fix #

Patch Set 9 : fix #

Patch Set 10 : fix #

Patch Set 11 : unit test #

Patch Set 12 : fix #

Total comments: 19

Patch Set 13 : review #

Patch Set 14 : initialize port #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+481 lines, -306 lines) Patch
M chrome/browser/extensions/extension_content_settings_api.cc View 1 2 1 chunk +14 lines, -16 lines 0 comments Download
M chrome/browser/extensions/extension_content_settings_helpers.h View 1 1 chunk +9 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_content_settings_helpers.cc View 1 2 3 4 5 6 2 chunks +75 lines, -0 lines 0 comments Download
A chrome/browser/extensions/extension_content_settings_unittest.cc View 1 2 3 4 5 6 1 chunk +51 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_context_menu_api.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extension_prefs.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extension_webrequest_api.cc View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/user_script_master.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/tab_contents/render_view_context_menu_unittest.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M chrome/common/extensions/api/extension_api.json View 1 2 3 4 5 6 2 chunks +8 lines, -18 lines 0 comments Download
chrome/common/extensions/docs/examples/api/contentSettings.zip View 1 2 0 chunks +-1 lines, --1 lines 0 comments Download
M chrome/common/extensions/docs/examples/api/contentSettings/popup.html View 1 2 3 chunks +1 line, -14 lines 0 comments Download
M chrome/common/extensions/docs/experimental.contentSettings.html View 1 2 11 chunks +23 lines, -164 lines 0 comments Download
M chrome/common/extensions/docs/samples.json View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/extension.cc View 1 2 3 4 5 6 7 8 4 chunks +7 lines, -7 lines 0 comments Download
M chrome/common/extensions/extension_messages.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/url_pattern.h View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +23 lines, -4 lines 1 comment Download
M chrome/common/extensions/url_pattern.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 11 chunks +81 lines, -18 lines 0 comments Download
M chrome/common/extensions/url_pattern_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 20 chunks +159 lines, -46 lines 0 comments Download
M chrome/common/extensions/user_script.cc View 1 2 3 4 5 6 1 chunk +1 line, -1 line 0 comments Download
M chrome/common/extensions/user_script_unittest.cc View 1 2 3 4 5 6 6 chunks +8 lines, -8 lines 0 comments Download
M chrome/test/data/extensions/api_test/content_settings/standard/test.html View 1 2 3 chunks +14 lines, -4 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Bernhard Bauer
please review.
9 years, 6 months ago (2011-06-24 15:36:17 UTC) #1
Matt Perry
Sam, you did some work with ports in URLPatterns. Do you have an opinion on ...
9 years, 6 months ago (2011-06-24 18:53:58 UTC) #2
Bernhard Bauer
http://codereview.chromium.org/7229012/diff/8017/chrome/common/extensions/url_pattern.cc File chrome/common/extensions/url_pattern.cc (right): http://codereview.chromium.org/7229012/diff/8017/chrome/common/extensions/url_pattern.cc#newcode212 chrome/common/extensions/url_pattern.cc:212: if (!SetPort(host_.substr(port_pos + 1))) On 2011/06/24 18:53:58, Matt Perry ...
9 years, 6 months ago (2011-06-24 21:49:53 UTC) #3
Sam Kerner (Chrome)
http://codereview.chromium.org/7229012/diff/12001/chrome/common/extensions/url_pattern.h File chrome/common/extensions/url_pattern.h (right): http://codereview.chromium.org/7229012/diff/12001/chrome/common/extensions/url_pattern.h#newcode24 chrome/common/extensions/url_pattern.h:24: // * The port is only allowed when the ...
9 years, 6 months ago (2011-06-27 17:58:25 UTC) #4
Bernhard Bauer
Okay, but shouldn't we call it IGNORE_PORTS instead of FORBID? I don't see a big ...
9 years, 6 months ago (2011-06-27 18:05:03 UTC) #5
skerner
On Mon, Jun 27, 2011 at 2:04 PM, Bernhard Bauer <bauerb@chromium.org> wrote: > Okay, but ...
9 years, 6 months ago (2011-06-27 18:18:21 UTC) #6
Bernhard Bauer
SGTM, although I would prefer an enum (IGNORE_PORTS, ERROR_ON_PORTS, USE_PORTS?) so we don't have conflicting ...
9 years, 6 months ago (2011-06-27 18:36:53 UTC) #7
skerner
On Mon, Jun 27, 2011 at 2:36 PM, Bernhard Bauer <bauerb@chromium.org> wrote: > SGTM, although ...
9 years, 6 months ago (2011-06-27 19:40:01 UTC) #8
Bernhard Bauer
Ok, added a third ParseOption. PTAL? http://codereview.chromium.org/7229012/diff/8017/chrome/browser/extensions/extension_content_settings_unittest.cc File chrome/browser/extensions/extension_content_settings_unittest.cc (right): http://codereview.chromium.org/7229012/diff/8017/chrome/browser/extensions/extension_content_settings_unittest.cc#newcode19 chrome/browser/extensions/extension_content_settings_unittest.cc:19: { "file:///foo/bar/baz", "file:///foo/bar/baz" ...
9 years, 5 months ago (2011-06-28 16:46:31 UTC) #9
Sam Kerner (Chrome)
http://codereview.chromium.org/7229012/diff/20003/chrome/common/extensions/url_pattern.cc File chrome/common/extensions/url_pattern.cc (right): http://codereview.chromium.org/7229012/diff/20003/chrome/common/extensions/url_pattern.cc#newcode85 chrome/common/extensions/url_pattern.cc:85: int parsed_port; I think you need to set an ...
9 years, 5 months ago (2011-06-28 18:12:39 UTC) #10
Matt Perry
http://codereview.chromium.org/7229012/diff/20003/chrome/common/extensions/url_pattern.cc File chrome/common/extensions/url_pattern.cc (right): http://codereview.chromium.org/7229012/diff/20003/chrome/common/extensions/url_pattern.cc#newcode203 chrome/common/extensions/url_pattern.cc:203: size_t port_pos = host_.find(':'); On 2011/06/28 18:12:39, Sam Kerner ...
9 years, 5 months ago (2011-06-28 21:37:07 UTC) #11
bauerb at google
Thanks for the review I'll work on the rest of the comments tomorrow. http://codereview.chromium.org/7229012/diff/20003/chrome/common/extensions/url_pattern.cc File ...
9 years, 5 months ago (2011-06-28 22:36:52 UTC) #12
Sam Kerner (Chrome)
http://codereview.chromium.org/7229012/diff/20003/chrome/common/extensions/url_pattern.cc File chrome/common/extensions/url_pattern.cc (right): http://codereview.chromium.org/7229012/diff/20003/chrome/common/extensions/url_pattern.cc#newcode85 chrome/common/extensions/url_pattern.cc:85: int parsed_port; On 2011/06/28 22:36:52, please use chromium account ...
9 years, 5 months ago (2011-06-29 13:36:34 UTC) #13
Bernhard Bauer
http://codereview.chromium.org/7229012/diff/20003/chrome/common/extensions/url_pattern.cc File chrome/common/extensions/url_pattern.cc (right): http://codereview.chromium.org/7229012/diff/20003/chrome/common/extensions/url_pattern.cc#newcode85 chrome/common/extensions/url_pattern.cc:85: int parsed_port; On 2011/06/29 13:36:34, Sam Kerner (Chrome) wrote: ...
9 years, 5 months ago (2011-06-29 13:53:18 UTC) #14
Matt Perry
LGTM http://codereview.chromium.org/7229012/diff/20003/chrome/common/extensions/url_pattern.cc File chrome/common/extensions/url_pattern.cc (right): http://codereview.chromium.org/7229012/diff/20003/chrome/common/extensions/url_pattern.cc#newcode337 chrome/common/extensions/url_pattern.cc:337: if (!IsValidPort(test)) On 2011/06/29 13:53:18, Bernhard Bauer wrote: ...
9 years, 5 months ago (2011-06-29 17:18:47 UTC) #15
Sam Kerner (Chrome)
9 years, 5 months ago (2011-06-30 02:36:52 UTC) #16
LGTM with one nit to add a comment.

http://codereview.chromium.org/7229012/diff/26001/chrome/common/extensions/ur...
File chrome/common/extensions/url_pattern.h (right):

http://codereview.chromium.org/7229012/diff/26001/chrome/common/extensions/ur...
chrome/common/extensions/url_pattern.h:28: //   host, which makes the pattern
effectively never match any URL.
Please point out that this seemingly silly behavior is needed because some users
have to maintain backward compatibility with the behavior patters used to have
before ports were parsed.

Powered by Google App Engine
This is Rietveld 408576698