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

Issue 10831008: Refactor and fix declarative webRequest API permissions (Closed)

Created:
8 years, 5 months ago by battre
Modified:
8 years, 4 months ago
Reviewers:
Yoyo Zhou, Matt Perry
CC:
chromium-reviews, ncarter (slow), mihaip-chromium-reviews_chromium.org, akalin, Raghu Simha, Aaron Boodman, rginda+watch_chromium.org, tim (not reviewing)
Visibility:
Public.

Description

Refactor and fix declarative webRequest API permissions This CL introduces proper host permission checking for the declarative webRequest API. It moves the permission checking code from web_request_api.cc into a separate class that is shared with the declarative WebRequest API. BUG=112155 TEST=no TBR=mirandac@chromium.org,akalin@chromium.org,ben@chromium.org Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=148965

Patch Set 1 #

Patch Set 2 : Nits #

Total comments: 31

Patch Set 3 : Addressed comments #

Patch Set 4 : Added browser tests #

Patch Set 5 : Merged with ToT #

Patch Set 6 : Fix compliation #

Patch Set 7 : Fix android compilation #

Patch Set 8 : Fix unit test, in which extension_info_map is null #

Patch Set 9 : Fix ChromeOS unit test #

Patch Set 10 : Addressed a comment #

Patch Set 11 : Fixed license headers #

Unified diffs Side-by-side diffs Delta from patch set Stats (+662 lines, -280 lines) Patch
M chrome/browser/extensions/api/declarative/rules_registry_service.cc View 1 2 4 chunks +13 lines, -7 lines 0 comments Download
M chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.cc View 1 2 3 4 5 6 7 8 9 4 chunks +38 lines, -5 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_action.h View 1 2 6 chunks +23 lines, -14 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_action.cc View 1 2 6 chunks +31 lines, -29 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc View 1 2 1 chunk +6 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_rule.h View 1 2 3 chunks +7 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_rule.cc View 1 2 2 chunks +7 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.h View 1 2 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry.cc View 1 2 4 chunks +4 lines, -5 lines 0 comments Download
M chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/browser/extensions/api/web_request/web_request_api.h View 1 2 4 chunks +11 lines, -1 line 0 comments Download
M chrome/browser/extensions/api/web_request/web_request_api.cc View 1 2 3 4 5 6 7 8 9 14 chunks +109 lines, -76 lines 0 comments Download
M chrome/browser/extensions/api/web_request/web_request_api_helpers.h View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -3 lines 0 comments Download
M chrome/browser/extensions/api/web_request/web_request_api_helpers.cc View 1 2 3 4 5 6 7 8 9 1 chunk +0 lines, -58 lines 0 comments Download
M chrome/browser/extensions/api/web_request/web_request_api_unittest.cc View 1 chunk +0 lines, -45 lines 0 comments Download
M chrome/browser/extensions/api/web_request/web_request_apitest.cc View 1 2 3 4 3 chunks +93 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/web_request/web_request_permissions.h View 1 2 1 chunk +36 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/web_request/web_request_permissions.cc View 1 2 3 4 5 6 7 1 chunk +105 lines, -0 lines 0 comments Download
A chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc View 1 chunk +59 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extension_info_map.h View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extension_info_map.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/extensions/extension_system.h View 1 2 3 4 5 chunks +6 lines, -4 lines 0 comments Download
M chrome/browser/extensions/extension_system.cc View 1 2 3 4 5 6 7 8 7 chunks +19 lines, -12 lines 0 comments Download
M chrome/browser/extensions/test_extension_system.h View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/profiles/off_the_record_profile_impl.cc View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/profiles/profile_manager.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -1 line 0 comments Download
M chrome/browser/sync/glue/extension_data_type_controller.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/extension_setting_data_type_controller.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/glue/theme_data_type_controller.cc View 1 chunk +1 line, -1 line 0 comments Download
M chrome/browser/sync/test/integration/sync_app_helper.cc View 1 2 3 4 5 1 chunk +4 lines, -2 lines 0 comments Download
M chrome/browser/sync/test/integration/sync_extension_helper.cc View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 3 4 5 6 2 chunks +3 lines, -0 lines 0 comments Download
M chrome/chrome_tests.gypi View 1 2 3 4 5 6 7 8 9 1 chunk +1 line, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/webrequest_permissions/spanning/background.js View 1 2 3 4 5 6 7 8 9 10 1 chunk +19 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/webrequest_permissions/spanning/manifest.json View 1 2 3 1 chunk +11 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/webrequest_permissions/split/background.js View 1 2 3 4 5 6 7 8 9 10 1 chunk +30 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/api_test/webrequest_permissions/split/manifest.json View 1 2 3 1 chunk +11 lines, -0 lines 0 comments Download

Messages

Total messages: 11 (0 generated)
battre
Hi. Could you please have a look at this CL? The browser tests are still ...
8 years, 5 months ago (2012-07-25 18:12:01 UTC) #1
Matt Perry
https://chromiumcodereview.appspot.com/10831008/diff/2001/chrome/browser/extensions/api/declarative/rules_registry_service.cc File chrome/browser/extensions/api/declarative/rules_registry_service.cc (right): https://chromiumcodereview.appspot.com/10831008/diff/2001/chrome/browser/extensions/api/declarative/rules_registry_service.cc#newcode56 chrome/browser/extensions/api/declarative/rules_registry_service.cc:56: void RulesRegistryService::RegisterDefaultRulesRegistries(bool incognito) { The incognito parameter is redundant. ...
8 years, 5 months ago (2012-07-25 21:27:55 UTC) #2
Yoyo Zhou
http://codereview.chromium.org/10831008/diff/2001/chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.cc File chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.cc (right): http://codereview.chromium.org/10831008/diff/2001/chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.cc#newcode180 chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.cc:180: content::Source<Profile>(profile)); You probably want profile->GetOriginalProfile() here. http://codereview.chromium.org/10831008/diff/2001/chrome/browser/extensions/extension_service.cc File chrome/browser/extensions/extension_service.cc ...
8 years, 5 months ago (2012-07-25 21:44:45 UTC) #3
battre
http://codereview.chromium.org/10831008/diff/2001/chrome/browser/extensions/api/declarative/rules_registry_service.cc File chrome/browser/extensions/api/declarative/rules_registry_service.cc (right): http://codereview.chromium.org/10831008/diff/2001/chrome/browser/extensions/api/declarative/rules_registry_service.cc#newcode56 chrome/browser/extensions/api/declarative/rules_registry_service.cc:56: void RulesRegistryService::RegisterDefaultRulesRegistries(bool incognito) { On 2012/07/25 21:27:56, Matt Perry ...
8 years, 5 months ago (2012-07-26 16:38:42 UTC) #4
battre
I added some browser tests as well.
8 years, 5 months ago (2012-07-26 16:53:09 UTC) #5
Matt Perry
LGTM http://codereview.chromium.org/10831008/diff/2001/chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.cc File chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.cc (right): http://codereview.chromium.org/10831008/diff/2001/chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.cc#newcode181 chrome/browser/extensions/api/declarative/rules_registry_storage_delegate.cc:181: InitForOTRProfile(); On 2012/07/26 16:38:43, battre wrote: > On ...
8 years, 5 months ago (2012-07-26 18:42:40 UTC) #6
battre
I am going to TBR some stuff: - mirandac for chrome/browser/profiles (renamed a function, trigger ...
8 years, 4 months ago (2012-07-30 13:39:39 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/battre@chromium.org/10831008/9016
8 years, 4 months ago (2012-07-30 13:39:57 UTC) #8
commit-bot: I haz the power
Presubmit check for 10831008-9016 failed and returned exit status 1. Running presubmit commit checks ...
8 years, 4 months ago (2012-07-30 13:40:12 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/battre@chromium.org/10831008/12024
8 years, 4 months ago (2012-07-30 13:50:09 UTC) #10
commit-bot: I haz the power
8 years, 4 months ago (2012-07-30 17:21:44 UTC) #11
Change committed as 148965

Powered by Google App Engine
This is Rietveld 408576698