Skip to content

Commit

Permalink
fixup for lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jkleinsc committed May 23, 2022
1 parent b0b61b4 commit 66dfd99
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions shell/browser/api/electron_api_web_contents.cc
Expand Up @@ -3507,18 +3507,22 @@ bool WebContents::DoesDeviceMatch(const base::Value* device,
static_cast<blink::PermissionType>(
WebContentsPermissionHelper::PermissionType::SERIAL)) {
#if BUILDFLAG(IS_WIN)
const auto* instance_id = device->GetDict().FindString(kDeviceInstanceIdKey);
const auto* port_instance_id = device_to_compare->GetDict().FindString(kDeviceInstanceIdKey);
const auto* instance_id =
device->GetDict().FindString(kDeviceInstanceIdKey);
const auto* port_instance_id =
device_to_compare->GetDict().FindString(kDeviceInstanceIdKey);
if (instance_id && port_instance_id && *instance_id == *port_instance_id)
return true;
#else
const auto* serial_number = device->GetDict().FindString(kSerialNumberKey);
const auto* port_serial_number = device_to_compare->GetDict().FindString(kSerialNumberKey);
const auto* port_serial_number =
device_to_compare->GetDict().FindString(kSerialNumberKey);
if (device->GetDict().FindInt(kVendorIdKey) !=
device_to_compare->GetDict().FindInt(kVendorIdKey) ||
device->GetDict().FindInt(kProductIdKey) !=
device_to_compare->GetDict().FindInt(kProductIdKey) ||
(serial_number && port_serial_number && *port_serial_number != *serial_number)) {
(serial_number && port_serial_number &&
*port_serial_number != *serial_number)) {
return false;
}

Expand All @@ -3527,7 +3531,7 @@ bool WebContents::DoesDeviceMatch(const base::Value* device,
const auto* port_usb_driver_key =
device_to_compare->GetDict().FindString(kUsbDriverKey);
if (usb_driver_key && port_usb_driver_key &&
*usb_driver_key != *port_usb_driver_key) {
*usb_driver_key != *port_usb_driver_key) {
return false;
}
#endif // BUILDFLAG(IS_MAC)
Expand Down

0 comments on commit 66dfd99

Please sign in to comment.