Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Issue 4687005: Track permissions granted to extensions in prefs (Closed)

Created:
10 years, 1 month ago by jstritar
Modified:
9 years, 6 months ago
Reviewers:
Aaron Boodman
CC:
chromium-reviews, Erik does not do reviews, Paweł Hajdan Jr., pam+watch_chromium.org, ben+cc_chromium.org, rdsmith+dwatch_chromium.org, ncarter (slow), Raghu Simha, idana, tim (not reviewing), Aaron Boodman
Visibility:
Public.

Description

Track permissions granted to extensions in prefs Adds a section to the extension preferences to store the recognized permissions that the user has granted the extension. Ignores unknown permissions when installing extensions. Disables extension and prompts user to re-enable when unknown permissions become recognized (e.g., through browser upgrade). Allows extensions to remove a permission in one version, then add them back in the next without prompting the user. BUG=42742 TEST=ExtensionsServiceTest, ExtensionPrefsGrantedPermissions, ExtensionTest Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=67500 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=67544 Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=67616

Patch Set 1 #

Total comments: 31

Patch Set 2 : incorporate feedback #

Total comments: 21

Patch Set 3 : incorporate feedback #

Total comments: 2

Patch Set 4 : incorporate feedback #

Patch Set 5 : missed updating a method call #

Total comments: 2

Patch Set 6 : add Extension::HasFullPermissions #

Patch Set 7 : flaky test #

Patch Set 8 : flaky test #

Patch Set 9 : fix on chromeos #

Patch Set 10 : rebase #

Patch Set 11 : try to get rid of mac test flakiness #

Patch Set 12 : fix mac test failure #

Unified diffs Side-by-side diffs Delta from patch set Stats (+968 lines, -218 lines) Patch
M chrome/browser/automation/automation_provider.cc View 1 2 3 4 5 2 chunks +0 lines, -2 lines 0 comments Download
M chrome/browser/download/download_util.cc View 1 2 3 4 5 1 chunk +0 lines, -1 line 0 comments Download
M chrome/browser/extensions/crx_installer.h View 1 2 3 4 5 2 chunks +0 lines, -13 lines 0 comments Download
M chrome/browser/extensions/crx_installer.cc View 1 2 3 4 5 2 chunks +1 line, -2 lines 0 comments Download
M chrome/browser/extensions/extension_disabled_infobar_delegate.cc View 1 1 chunk +1 line, -3 lines 0 comments Download
M chrome/browser/extensions/extension_prefs.h View 1 2 3 3 chunks +40 lines, -1 line 0 comments Download
M chrome/browser/extensions/extension_prefs.cc View 1 2 3 4 5 6 7 8 9 10 6 chunks +131 lines, -21 lines 0 comments Download
M chrome/browser/extensions/extension_prefs_unittest.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +122 lines, -0 lines 0 comments Download
M chrome/browser/extensions/extensions_service.h View 1 2 3 4 5 3 chunks +15 lines, -4 lines 0 comments Download
M chrome/browser/extensions/extensions_service.cc View 1 2 3 4 5 12 chunks +129 lines, -66 lines 0 comments Download
M chrome/browser/extensions/extensions_service_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 6 chunks +314 lines, -4 lines 0 comments Download
M chrome/common/extensions/extension.h View 1 2 3 4 5 4 chunks +19 lines, -2 lines 0 comments Download
M chrome/common/extensions/extension.cc View 1 2 3 4 5 6 7 8 9 10 5 chunks +75 lines, -63 lines 0 comments Download
M chrome/common/extensions/extension_manifests_unittest.cc View 1 2 chunks +6 lines, -8 lines 0 comments Download
M chrome/common/extensions/extension_unittest.cc View 1 2 3 5 chunks +74 lines, -27 lines 0 comments Download
M chrome/test/data/extensions/good/Preferences View 1 2 3 3 chunks +12 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/permissions/unknown.pem View 1 2 1 chunk +16 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/permissions/unknown/manifest.json View 1 1 chunk +9 lines, -0 lines 0 comments Download
A chrome/test/data/extensions/permissions/unknown/test.js View 1 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/test/live_sync/live_extensions_sync_test_base.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 11 (0 generated)
jstritar
Aaron, could you take a look at this one? I could use some feedback, since ...
10 years, 1 month ago (2010-11-09 21:14:14 UTC) #1
Aaron Boodman
The way we're losing error handling stinks. I've created a new bug to track the ...
10 years, 1 month ago (2010-11-12 00:05:24 UTC) #2
jstritar
I uploaded a new CL that incorporates your feedback. A nice side effect of these ...
10 years, 1 month ago (2010-11-19 21:38:36 UTC) #3
Aaron Boodman
Cool. We can talk about the tests on IRC tomorrow. http://codereview.chromium.org/4687005/diff/1/chrome/browser/extensions/extension_prefs.h File chrome/browser/extensions/extension_prefs.h (right): http://codereview.chromium.org/4687005/diff/1/chrome/browser/extensions/extension_prefs.h#newcode129 ...
10 years, 1 month ago (2010-11-22 07:57:53 UTC) #4
jstritar
Uploaded a new CL. http://codereview.chromium.org/4687005/diff/12001/chrome/browser/extensions/extension_prefs.cc File chrome/browser/extensions/extension_prefs.cc (right): http://codereview.chromium.org/4687005/diff/12001/chrome/browser/extensions/extension_prefs.cc#newcode486 chrome/browser/extensions/extension_prefs.cc:486: DCHECK(Extension::IdIsValid(extension_id)); On 2010/11/22 07:57:53, Aaron ...
10 years, 1 month ago (2010-11-22 23:01:08 UTC) #5
Aaron Boodman
Sorry a few more changes. http://codereview.chromium.org/4687005/diff/12001/chrome/browser/extensions/extension_prefs.cc File chrome/browser/extensions/extension_prefs.cc (right): http://codereview.chromium.org/4687005/diff/12001/chrome/browser/extensions/extension_prefs.cc#newcode513 chrome/browser/extensions/extension_prefs.cc:513: UpdateExtensionPref(extension_id, kPrefGrantedPermissionsInitialized, On 2010/11/22 ...
10 years, 1 month ago (2010-11-23 00:06:38 UTC) #6
jstritar
I realized we don't need the migration code after adding the "full permissions" bit, since ...
10 years, 1 month ago (2010-11-24 20:08:25 UTC) #7
Aaron Boodman
LGTM This is good for a first commit. For my two comments below, you can ...
10 years, 1 month ago (2010-11-24 21:08:04 UTC) #8
jstritar
On 2010/11/24 21:08:04, Aaron Boodman wrote: http://codereview.chromium.org/4687005/diff/30001/chrome/browser/extensions/extensions_service.cc#newcode1653 > chrome/browser/extensions/extensions_service.cc:1653: // CrxInstaller should > have guaranteed ...
10 years ago (2010-11-29 19:25:19 UTC) #9
Aaron Boodman
On 2010/11/29 19:25:19, jstritar1 wrote: > On 2010/11/24 21:08:04, Aaron Boodman wrote: > http://codereview.chromium.org/4687005/diff/30001/chrome/browser/extensions/extensions_service.cc#newcode1653 > ...
10 years ago (2010-11-29 20:23:27 UTC) #10
jstritar
10 years ago (2010-11-29 20:53:03 UTC) #11
On 2010/11/29 20:23:27, Aaron Boodman wrote:
> On 2010/11/29 19:25:19, jstritar1 wrote:
> > On 2010/11/24 21:08:04, Aaron Boodman wrote:
> >
>
http://codereview.chromium.org/4687005/diff/30001/chrome/browser/extensions/e...
> > > chrome/browser/extensions/extensions_service.cc:1653: // CrxInstaller
should
> > > have guaranteed that we aren't downgrading.
> > > This should be done for EXTERNAL_* extension too (basically location() !=
> > > INTERNAL). Your change actually changes the current behavior which is also
> > > wrong, because it runs for location() == INTERNAL when it should not. See
> bug
> > > 63980 for more info.
> > 
> > Which part is this referring to? The whole "if (is_extension_upgrade)"
block?
> 
> No, just CHECK(extension->version()->CompareTo(*(old->version())) >= 0);

I'm pretty sure the old code was running this for location() == INTERNAL (I
think it was run for all extension types, since extensions_enabled() would be
true). From the bug you referred me to, it sounds like unpacked extensions
should be able to downgrade. Should all external extensions be able to
downgrade? In that case it should be "if (location() == INTERNAL)" instead of
"if (location() != INTERNAL)".

Powered by Google App Engine
This is Rietveld 408576698