Issue metadata
Sign in to add a comment
|
Remove manual conversions to/from mojo types in permission_service_impl.cc |
||||||||||||||||||||||
Issue descriptionIdeally we'd use the mojo enums directly--or failing that, typemap them with EnumTraits. For reference, the conversions I'm talking about are in https://cs.chromium.org/chromium/src/content/browser/permissions/permission_service_impl.cc?rcl=5e580c764d6ce523a2cbd2b6502b196e9efcf121&l=31.
,
Nov 9 2017
If i understand correctly, initial conversion from mojo to permission type in permission_service_impl.cc
PermissionType PermissionDescriptorToPermissionType(
const PermissionDescriptorPtr& descriptor) {
}
later this permission type is converted to content setting in permission_manager.cc
ContentSettingsType PermissionTypeToContentSetting(PermissionType permission) {
}
This bug requests to avoid first conversion in permission_service_impl.cc and directly use "blink::mojom::PermissionName" in permission_manager.cc for conversion?
Plz correct me.
one more doubt is about MIDI. How to handle below condition. is it fine to consider it as MIDI always?
case PermissionName::MIDI: {
if (descriptor->extension && descriptor->extension->is_midi() &&
descriptor->extension->get_midi()->sysex) {
return PermissionType::MIDI_SYSEX;
}
return PermissionType::MIDI;
}
,
Nov 10 2017
,
Nov 24 2017
@dominickn Could you please check and update
,
Nov 27 2017
Yeah right now there isn't a 1:1 mapping between PermissionName and PermissionType as you note. PermissionName is the web platform representation of the permission name, but PermissionType is an internal representation. That currently simplifies IPC because we don't have to send the entire struct over to determine how to treat the permission. I'm going to close this as WontFix now. We can revisit if we decide it would be better to transfer the entire PermissionDescriptor over in some form.
,
Nov 27 2017
Do we need PermissionName to match the web platform representation? If it's just used for permission requests from the renderer to the browser, it seems like we might be able to simplify it to match what the browser wants, and have the conversion in the renderer. For MIDI we could add a MIDI_SYSEX to PermissionName. I'm not sure about the allowWithoutGesture flag for clipboard though...
,
Nov 27 2017
Good point timloh. We probably can change PermissionName to match permissionType but it would probably require some code changes.
,
Feb 18 2018
|
|||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||
Comment 1 by dominickn@chromium.org
, Oct 26 2017