New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 778458 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug
Team-Security-UX



Sign in to add a comment

Remove manual conversions to/from mojo types in permission_service_impl.cc

Project Member Reported by dcheng@chromium.org, Oct 25 2017

Issue description

Ideally 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.
 
Components: -Internals>Permissions Internals>Permissions>Model

Comment 2 Deleted

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;
    }




Comment 4 by est...@chromium.org, Nov 10 2017

Labels: Hotlist-EnamelAndFriendsFixIt

Comment 5 Deleted

@dominickn
Could you please check and update 

Comment 7 by raymes@chromium.org, Nov 27 2017

Status: WontFix (was: Available)
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.


Comment 8 by timloh@chromium.org, 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...

Comment 9 by raymes@chromium.org, Nov 27 2017

Status: Available (was: WontFix)
Good point timloh. We probably can change PermissionName to match permissionType but it would probably require some code changes.
Labels: -Hotlist-EnamelAndFriendsFixIt

Sign in to add a comment