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

Issue 6772022: Make <all_urls> and file:///* in permissions trigger "Allow file access" (Closed)

Created:
9 years, 8 months ago by Mihai Parparita -not on Chrome
Modified:
9 years, 6 months ago
Reviewers:
Aaron Boodman
CC:
chromium-reviews, Erik does not do reviews, Paweł Hajdan Jr., pam+watch_chromium.org, brettw-cc_chromium.org, darin-cc_chromium.org, Matt Perry, jstritar, Tom Sepez
Visibility:
Public.

Description

Make <all_urls> and file:///* in permissions trigger "Allow file access" Move ExtensionWantsFileAccess static functions to Extension::wants_file_access which is set as part of the Extension initialization process. When file:/// access is granted/revoked, instead of storing that in a bit on the UserScript (which didn't help with extension host permissions), we use that to filter down the list of valid schemes for permissions/content script match matterns. That way we don't have to manually exclude file:///* patterns at various call sites (e.g. in UserScriptSlave). BUG=76705 TEST=unit_tests R=aa@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=80213

Patch Set 1 #

Total comments: 1

Patch Set 2 : Fix test failures seen on try bots #

Patch Set 3 : Fix more failures seen on trybots #

Patch Set 4 : Fix ExtensionModuleApiTest.(In)CognitoNoFile. #

Total comments: 4

Patch Set 5 : Fix valid_user_script_schemes initialization #

Patch Set 6 : Fix valid_host_permission_schemes too #

Patch Set 7 : Remove InitWantsFileAccess and other cleanups. #

Patch Set 8 : Patch for landing #

Unified diffs Side-by-side diffs Delta from patch set Stats (+226 lines, -88 lines) Patch
M chrome/browser/extensions/extension_prefs.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/extensions/extension_prefs.cc View 1 2 3 4 5 6 4 chunks +12 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_service.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_service.cc View 1 2 3 4 5 6 5 chunks +23 lines, -9 lines 0 comments Download
M chrome/browser/extensions/extensions_ui.cc View 1 2 3 4 5 6 2 chunks +1 line, -16 lines 0 comments Download
M chrome/browser/extensions/user_script_master.cc View 2 chunks +0 lines, -6 lines 0 comments Download
M chrome/browser/ui/webui/options/extension_settings_handler.cc View 1 2 3 4 5 6 2 chunks +1 line, -16 lines 0 comments Download
M chrome/common/extensions/extension.h View 1 2 3 4 5 6 6 chunks +20 lines, -2 lines 0 comments Download
M chrome/common/extensions/extension.cc View 1 2 3 4 5 6 7 7 chunks +27 lines, -7 lines 0 comments Download
M chrome/common/extensions/extension_unittest.cc View 3 chunks +73 lines, -2 lines 0 comments Download
M chrome/common/extensions/url_pattern.cc View 1 2 3 4 5 6 7 3 chunks +5 lines, -5 lines 0 comments Download
M chrome/common/extensions/user_script.h View 4 chunks +1 line, -8 lines 0 comments Download
M chrome/common/extensions/user_script.cc View 1 2 3 4 5 6 7 6 chunks +12 lines, -7 lines 0 comments Download
M chrome/renderer/user_script_slave.cc View 3 chunks +3 lines, -10 lines 0 comments Download
A chrome/test/data/extensions/permissions/content_script_all_urls.json View 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/permissions/content_script_file_scheme.json View 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/permissions/content_script_http_scheme.json View 1 chunk +10 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/permissions/permissions_all_urls.json View 1 chunk +5 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/permissions/permissions_file_scheme.json View 1 chunk +5 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/permissions/permissions_http_scheme.json View 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Mihai Parparita -not on Chrome
9 years, 8 months ago (2011-03-29 23:12:01 UTC) #1
Aaron Boodman
lgtm Some design ideas below. Feel free to ignore. http://codereview.chromium.org/6772022/diff/1/chrome/common/extensions/extension.cc File chrome/common/extensions/extension.cc (right): http://codereview.chromium.org/6772022/diff/1/chrome/common/extensions/extension.cc#newcode623 chrome/common/extensions/extension.cc:623: ...
9 years, 8 months ago (2011-03-30 01:24:54 UTC) #2
Mihai Parparita -not on Chrome
On Tue, Mar 29, 2011 at 6:24 PM, <aa@chromium.org> wrote: > 1. Instead of parsing ...
9 years, 8 months ago (2011-03-30 23:00:49 UTC) #3
Aaron Boodman
http://codereview.chromium.org/6772022/diff/8001/chrome/browser/extensions/extension_prefs.cc File chrome/browser/extensions/extension_prefs.cc (right): http://codereview.chromium.org/6772022/diff/8001/chrome/browser/extensions/extension_prefs.cc#newcode587 chrome/browser/extensions/extension_prefs.cc:587: if (!allow_file_access && pattern.MatchesScheme(chrome::kFileScheme)) { I'm not sure why ...
9 years, 8 months ago (2011-03-31 16:04:57 UTC) #4
Mihai Parparita -not on Chrome
http://codereview.chromium.org/6772022/diff/8001/chrome/browser/extensions/extension_prefs.cc File chrome/browser/extensions/extension_prefs.cc (right): http://codereview.chromium.org/6772022/diff/8001/chrome/browser/extensions/extension_prefs.cc#newcode587 chrome/browser/extensions/extension_prefs.cc:587: if (!allow_file_access && pattern.MatchesScheme(chrome::kFileScheme)) { On 2011/03/31 16:04:57, Aaron ...
9 years, 8 months ago (2011-03-31 21:56:30 UTC) #5
Mihai Parparita -not on Chrome
OK, re-did this a bit to leave the file scheme in the default permitted schemes, ...
9 years, 8 months ago (2011-04-01 00:08:10 UTC) #6
Aaron Boodman
9 years, 8 months ago (2011-04-01 00:17:03 UTC) #7
lgtm

Powered by Google App Engine
This is Rietveld 408576698