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

Issue 1382783002: Store USB device permissions in website settings. (Closed)

Created:
5 years, 2 months ago by Reilly Grant (use Gerrit)
Modified:
5 years, 1 month ago
CC:
chromium-reviews, Jeffrey Yasskin, kcarattini, markusheintz_, raymes+watch_chromium.org, scheib, sebastian1433_gmail.com
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Store USB device permissions in website settings. This change adds a new class, ChooserContextBase, that stores a list of chosen objects for chooser-based permissions in website settings. It is similar to PermissionContextBase. UsbPermissionContext extends this and adds the concept of an ephemeral device permission (for devices that can't be recorded in persistent storage because they are not uniquely identifiable enough). WebUSB is the initial consumer of this new API. WebUSBPermissionProvider has been updated to check with the UsbPermissionContext and once there is a chooser UI to populate the list of allowed devices the --enable-webusb-on-any-origin flag can be removed. BUG=529950 Committed: https://crrev.com/551eaa4879fb89ca1798b1001e32608380e1405a Cr-Commit-Position: refs/heads/master@{#359001}

Patch Set 1 #

Total comments: 12

Patch Set 2 : Convert WebUSBPermissionStore to a PermissionContext. #

Total comments: 19

Patch Set 3 : Split permission contexts from chooser permission contexts. #

Total comments: 7

Patch Set 4 : Roll in updates from the UI patch. #

Patch Set 5 : Address bauerb@'s comments. #

Total comments: 1

Patch Set 6 : Remove UsbPermissionContext and add ChooserPermissionContext helper functions. #

Total comments: 44

Patch Set 7 : More chooser, less permission. #

Total comments: 2

Patch Set 8 : Removed ChooserType for now. #

Total comments: 2

Patch Set 9 : Remove virtual functions for now. #

Patch Set 10 : Fix Android build. #

Total comments: 3

Patch Set 11 : Address mlamouri@'s comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+588 lines, -4 lines) Patch
A chrome/browser/permissions/chooser_context_base.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +67 lines, -0 lines 0 comments Download
A chrome/browser/permissions/chooser_context_base.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +112 lines, -0 lines 0 comments Download
M chrome/browser/profiles/chrome_browser_main_extra_parts_profiles.cc View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -0 lines 0 comments Download
A chrome/browser/usb/usb_chooser_context.h View 1 2 3 4 5 6 7 8 1 chunk +55 lines, -0 lines 0 comments Download
A chrome/browser/usb/usb_chooser_context.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +127 lines, -0 lines 0 comments Download
A chrome/browser/usb/usb_chooser_context_factory.h View 1 2 3 4 5 6 1 chunk +35 lines, -0 lines 0 comments Download
A chrome/browser/usb/usb_chooser_context_factory.cc View 1 2 3 4 5 6 1 chunk +41 lines, -0 lines 0 comments Download
A chrome/browser/usb/usb_chooser_context_unittest.cc View 1 2 3 4 5 6 1 chunk +118 lines, -0 lines 0 comments Download
M chrome/browser/usb/web_usb_permission_provider.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +19 lines, -4 lines 0 comments Download
M chrome/chrome_browser.gypi View 1 2 3 4 5 6 7 8 9 10 2 chunks +6 lines, -0 lines 0 comments Download
M chrome/chrome_tests_unit.gypi View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download
M components/content_settings/core/browser/website_settings_registry.cc View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M components/content_settings/core/common/content_settings_types.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +1 line, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 58 (12 generated)
Reilly Grant (use Gerrit)
rockot@, please take a look at //chrome/browser/usb. I will probably have to modify this a ...
5 years, 2 months ago (2015-10-01 00:05:00 UTC) #2
Ken Rockot(use gerrit already)
lgtm https://chromiumcodereview.appspot.com/1382783002/diff/1/chrome/browser/usb/web_usb_permission_store.cc File chrome/browser/usb/web_usb_permission_store.cc (right): https://chromiumcodereview.appspot.com/1382783002/diff/1/chrome/browser/usb/web_usb_permission_store.cc#newcode103 chrome/browser/usb/web_usb_permission_store.cc:103: explicit USBDeviceEntry(scoped_refptr<UsbDevice> device) { nit: const scoped_refptr<UsbDevice>& here ...
5 years, 2 months ago (2015-10-01 01:26:33 UTC) #3
raymes
https://chromiumcodereview.appspot.com/1382783002/diff/1/chrome/browser/usb/web_usb_permission_store.h File chrome/browser/usb/web_usb_permission_store.h (right): https://chromiumcodereview.appspot.com/1382783002/diff/1/chrome/browser/usb/web_usb_permission_store.h#newcode24 chrome/browser/usb/web_usb_permission_store.h:24: class WebUSBPermissionStore : public KeyedService, I'd feel more comfortable ...
5 years, 2 months ago (2015-10-01 01:28:19 UTC) #5
raymes
5 years, 2 months ago (2015-10-01 01:28:53 UTC) #6
Bernhard Bauer
https://codereview.chromium.org/1382783002/diff/1/chrome/browser/usb/web_usb_permission_store.cc File chrome/browser/usb/web_usb_permission_store.cc (right): https://codereview.chromium.org/1382783002/diff/1/chrome/browser/usb/web_usb_permission_store.cc#newcode37 chrome/browser/usb/web_usb_permission_store.cc:37: static WebUSBPermissionStoreFactory* GetInstance() { You will need to add ...
5 years, 2 months ago (2015-10-01 08:31:25 UTC) #7
Reilly Grant (use Gerrit)
Adding felt@ for //chrome/browser/permissions and pfeldman@ for //content/public/browser. Please take another look as I've essentially ...
5 years, 2 months ago (2015-10-06 00:39:45 UTC) #9
Reilly Grant (use Gerrit)
A note for raymes@, the lines added in ContentSettingRegistry::Register are commented out because I'm not ...
5 years, 2 months ago (2015-10-06 00:59:30 UTC) #10
raymes
Thanks for digging into this Reilly! I think this is a good starting point. https://codereview.chromium.org/1382783002/diff/20001/chrome/browser/permissions/chooser_permission_context_base.cc ...
5 years, 2 months ago (2015-10-06 05:28:20 UTC) #12
Bernhard Bauer
https://codereview.chromium.org/1382783002/diff/20001/chrome/browser/usb/usb_permission_context_factory.h File chrome/browser/usb/usb_permission_context_factory.h (right): https://codereview.chromium.org/1382783002/diff/20001/chrome/browser/usb/usb_permission_context_factory.h#newcode18 chrome/browser/usb/usb_permission_context_factory.h:18: static UsbPermissionContextFactory* GetInstance(); I think you still need to ...
5 years, 2 months ago (2015-10-06 10:22:45 UTC) #13
mlamouri (slow - plz ping)
I'm not sure why you want to inherit from PermissionContextBase. This class is used to ...
5 years, 2 months ago (2015-10-06 11:03:17 UTC) #14
Reilly Grant (use Gerrit)
https://codereview.chromium.org/1382783002/diff/20001/chrome/browser/permissions/chooser_permission_context_base.cc File chrome/browser/permissions/chooser_permission_context_base.cc (right): https://codereview.chromium.org/1382783002/diff/20001/chrome/browser/permissions/chooser_permission_context_base.cc#newcode25 chrome/browser/permissions/chooser_permission_context_base.cc:25: const GURL& origin) { On 2015/10/06 05:28:20, raymes wrote: ...
5 years, 2 months ago (2015-10-06 20:45:30 UTC) #15
Reilly Grant (use Gerrit)
Alright, I now have a permission context for USB and a chooser permission context for ...
5 years, 2 months ago (2015-10-07 00:56:25 UTC) #16
raymes
Cool - again the direction look quite good to me :) I'll refrain from reviewing ...
5 years, 2 months ago (2015-10-07 04:48:29 UTC) #17
kcarattini
5 years, 2 months ago (2015-10-08 04:42:00 UTC) #18
raymes
ping mlamouri@ :) On Wed, 7 Oct 2015 at 15:48 <raymes@chromium.org> wrote: > Cool - ...
5 years, 2 months ago (2015-10-11 21:58:24 UTC) #19
mlamouri (slow - plz ping)
How do you expect PermissionType::USB to be modified? Is it only meant to be exposing ...
5 years, 2 months ago (2015-10-12 11:00:08 UTC) #20
Bernhard Bauer
https://codereview.chromium.org/1382783002/diff/20001/chrome/browser/permissions/chooser_permission_context_base.h File chrome/browser/permissions/chooser_permission_context_base.h (right): https://codereview.chromium.org/1382783002/diff/20001/chrome/browser/permissions/chooser_permission_context_base.h#newcode23 chrome/browser/permissions/chooser_permission_context_base.h:23: scoped_ptr<base::ListValue> GetChosenObjects(const GURL& origin); On 2015/10/07 04:48:29, raymes wrote: ...
5 years, 2 months ago (2015-10-12 11:03:48 UTC) #21
Reilly Grant (use Gerrit)
On 2015/10/12 11:00:08, Mounir Lamouri wrote: > How do you expect PermissionType::USB to be modified? ...
5 years, 2 months ago (2015-10-12 15:31:04 UTC) #22
Reilly Grant (use Gerrit)
https://codereview.chromium.org/1382783002/diff/20001/chrome/browser/permissions/chooser_permission_context_base.h File chrome/browser/permissions/chooser_permission_context_base.h (right): https://codereview.chromium.org/1382783002/diff/20001/chrome/browser/permissions/chooser_permission_context_base.h#newcode23 chrome/browser/permissions/chooser_permission_context_base.h:23: scoped_ptr<base::ListValue> GetChosenObjects(const GURL& origin); On 2015/10/12 11:03:48, Bernhard Bauer ...
5 years, 2 months ago (2015-10-12 15:37:48 UTC) #23
raymes
> My followup UI patch adds a virtual GetStringToDisplayForObject() method on this > class that ...
5 years, 2 months ago (2015-10-13 00:53:02 UTC) #24
Reilly Grant (use Gerrit)
https://codereview.chromium.org/1382783002/diff/40001/chrome/browser/permissions/chooser_permission_context_base.cc File chrome/browser/permissions/chooser_permission_context_base.cc (right): https://codereview.chromium.org/1382783002/diff/40001/chrome/browser/permissions/chooser_permission_context_base.cc#newcode17 chrome/browser/permissions/chooser_permission_context_base.cc:17: const char* const kObjectListKey = "chosen-objects"; On 2015/10/12 11:03:48, ...
5 years, 2 months ago (2015-10-13 01:32:24 UTC) #25
Bernhard Bauer
content settings LGTM https://codereview.chromium.org/1382783002/diff/80001/chrome/browser/permissions/chooser_permission_context_base.cc File chrome/browser/permissions/chooser_permission_context_base.cc (right): https://codereview.chromium.org/1382783002/diff/80001/chrome/browser/permissions/chooser_permission_context_base.cc#newcode71 chrome/browser/permissions/chooser_permission_context_base.cc:71: DCHECK(object && IsValidObject(*object)); Split this up ...
5 years, 2 months ago (2015-10-13 08:27:59 UTC) #26
mlamouri (slow - plz ping)
I still can't understand why you need CONTENT_SETTINGS_TYPE_USB. The requirements for CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA are clear given ...
5 years, 2 months ago (2015-10-13 10:34:03 UTC) #27
Reilly Grant (use Gerrit)
On 2015/10/13 10:34:03, Mounir Lamouri wrote: > I still can't understand why you need CONTENT_SETTINGS_TYPE_USB. ...
5 years, 2 months ago (2015-10-13 15:31:50 UTC) #28
mlamouri (slow - plz ping)
On 2015/10/13 at 15:31:50, reillyg wrote: > On 2015/10/13 10:34:03, Mounir Lamouri wrote: > > ...
5 years, 2 months ago (2015-10-13 15:42:51 UTC) #29
Reilly Grant (use Gerrit)
On 2015/10/13 15:42:51, Mounir Lamouri wrote: > On 2015/10/13 at 15:31:50, reillyg wrote: > > ...
5 years, 2 months ago (2015-10-13 15:45:38 UTC) #30
Reilly Grant (use Gerrit)
On 2015/10/13 15:45:38, Reilly Grant wrote: > On 2015/10/13 15:42:51, Mounir Lamouri wrote: > > ...
5 years, 2 months ago (2015-10-13 20:39:04 UTC) #31
raymes
On 2015/10/13 15:45:38, Reilly Grant wrote: > On 2015/10/13 15:42:51, Mounir Lamouri wrote: > > ...
5 years, 2 months ago (2015-10-13 23:41:33 UTC) #32
raymes
I finally found time to do a detailed review. I'm really sorry for the delay. ...
5 years, 2 months ago (2015-10-14 02:07:04 UTC) #33
Reilly Grant (use Gerrit)
https://codereview.chromium.org/1382783002/diff/100001/chrome/browser/permissions/chooser_permission_context.h File chrome/browser/permissions/chooser_permission_context.h (right): https://codereview.chromium.org/1382783002/diff/100001/chrome/browser/permissions/chooser_permission_context.h#newcode21 chrome/browser/permissions/chooser_permission_context.h:21: class ChooserPermissionContext { On 2015/10/14 02:07:04, raymes wrote: > ...
5 years, 2 months ago (2015-10-22 00:57:03 UTC) #34
raymes
Thanks! https://codereview.chromium.org/1382783002/diff/100001/chrome/browser/permissions/chooser_permission_context.h File chrome/browser/permissions/chooser_permission_context.h (right): https://codereview.chromium.org/1382783002/diff/100001/chrome/browser/permissions/chooser_permission_context.h#newcode21 chrome/browser/permissions/chooser_permission_context.h:21: class ChooserPermissionContext { I don't feel entirely convinced ...
5 years, 1 month ago (2015-10-29 06:14:41 UTC) #35
raymes
https://codereview.chromium.org/1382783002/diff/100001/chrome/browser/usb/usb_chooser_permission_context.h File chrome/browser/usb/usb_chooser_permission_context.h (right): https://codereview.chromium.org/1382783002/diff/100001/chrome/browser/usb/usb_chooser_permission_context.h#newcode16 chrome/browser/usb/usb_chooser_permission_context.h:16: class UsbChooserPermissionContext : public ChooserPermissionContextBase, On 2015/10/29 06:14:41, raymes ...
5 years, 1 month ago (2015-10-29 06:31:27 UTC) #36
Reilly Grant (use Gerrit)
https://codereview.chromium.org/1382783002/diff/100001/chrome/browser/permissions/chooser_permission_context.h File chrome/browser/permissions/chooser_permission_context.h (right): https://codereview.chromium.org/1382783002/diff/100001/chrome/browser/permissions/chooser_permission_context.h#newcode21 chrome/browser/permissions/chooser_permission_context.h:21: class ChooserPermissionContext { On 2015/10/29 06:14:40, raymes wrote: > ...
5 years, 1 month ago (2015-10-29 20:59:59 UTC) #37
Reilly Grant (use Gerrit)
CC palmer@ because he cares about choosers.
5 years, 1 month ago (2015-10-31 01:05:43 UTC) #38
raymes
lgtm with the following comment. If you would rather do further iterations in the current ...
5 years, 1 month ago (2015-11-02 03:00:13 UTC) #39
Reilly Grant (use Gerrit)
mlamouri@ and mmenke@ please take a look. https://codereview.chromium.org/1382783002/diff/140001/chrome/browser/permissions/chooser_context_base.h File chrome/browser/permissions/chooser_context_base.h (right): https://codereview.chromium.org/1382783002/diff/140001/chrome/browser/permissions/chooser_context_base.h#newcode39 chrome/browser/permissions/chooser_context_base.h:39: virtual ScopedVector<base::DictionaryValue> ...
5 years, 1 month ago (2015-11-02 21:14:51 UTC) #41
mlamouri (slow - plz ping)
First of all, I think the CL description is slightly out of date. You might ...
5 years, 1 month ago (2015-11-03 11:38:30 UTC) #42
Reilly Grant (use Gerrit)
On 2015/11/03 11:38:30, Mounir Lamouri wrote: > First of all, I think the CL description ...
5 years, 1 month ago (2015-11-03 16:36:48 UTC) #43
mlamouri (slow - plz ping)
I am giving lgtm here to unblock you but I would like to see: - ...
5 years, 1 month ago (2015-11-06 15:22:46 UTC) #45
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1382783002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1382783002/200001
5 years, 1 month ago (2015-11-11 00:29:22 UTC) #48
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/117323)
5 years, 1 month ago (2015-11-11 00:43:22 UTC) #50
Reilly Grant (use Gerrit)
Oops, erg@, can you look at chrome_browser_main_parts_profiles.cc?
5 years, 1 month ago (2015-11-11 00:50:19 UTC) #52
Elliot Glaysher
profiles lgtm
5 years, 1 month ago (2015-11-11 01:01:22 UTC) #54
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1382783002/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1382783002/200001
5 years, 1 month ago (2015-11-11 01:14:41 UTC) #56
commit-bot: I haz the power
Committed patchset #11 (id:200001)
5 years, 1 month ago (2015-11-11 01:29:28 UTC) #57
commit-bot: I haz the power
5 years, 1 month ago (2015-11-11 01:30:11 UTC) #58
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/551eaa4879fb89ca1798b1001e32608380e1405a
Cr-Commit-Position: refs/heads/master@{#359001}

Powered by Google App Engine
This is Rietveld 408576698