Skip to content

Commit

Permalink
fixup: address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jkleinsc committed May 13, 2022
1 parent a044f68 commit 9983891
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions shell/browser/api/electron_api_web_contents.cc
Expand Up @@ -3494,16 +3494,16 @@ bool WebContents::DoesDeviceMatch(const base::Value* device,
if (permission_type ==
static_cast<content::PermissionType>(
WebContentsPermissionHelper::PermissionType::HID)) {
if (device->FindInt(kHidVendorIdKey) !=
device_to_compare->FindInt(kHidVendorIdKey) ||
device->FindInt(kHidProductIdKey) !=
device_to_compare->FindInt(kHidProductIdKey)) {
if (device->GetDict().FindInt(kHidVendorIdKey) !=
device_to_compare->GetDict().FindInt(kHidVendorIdKey) ||
device->GetDict().FindInt(kHidProductIdKey) !=
device_to_compare->GetDict().FindInt(kHidProductIdKey)) {
return false;
}

const auto* serial_number =
device_to_compare->FindString(kHidSerialNumberKey);
const auto* device_serial_number = device->FindString(kHidSerialNumberKey);
device_to_compare->GetDict().FindString(kHidSerialNumberKey);
const auto* device_serial_number = device->GetDict().FindString(kHidSerialNumberKey);

if (serial_number && device_serial_number &&
*device_serial_number == *serial_number)
Expand All @@ -3512,22 +3512,22 @@ bool WebContents::DoesDeviceMatch(const base::Value* device,
static_cast<content::PermissionType>(
WebContentsPermissionHelper::PermissionType::SERIAL)) {
#if BUILDFLAG(IS_WIN)
if (device->FindString(kDeviceInstanceIdKey) ==
device_to_compare->FindString(kDeviceInstanceIdKey))
if (device->GetDict().FindString(kDeviceInstanceIdKey) ==
device_to_compare->GetDict().FindString(kDeviceInstanceIdKey))
return true;
#else
if (device->FindInt(kVendorIdKey) !=
device_to_compare->FindInt(kVendorIdKey) ||
device->FindInt(kProductIdKey) !=
device_to_compare->FindInt(kProductIdKey) ||
*device->FindString(kSerialNumberKey) !=
*device_to_compare->FindString(kSerialNumberKey)) {
if (device->GetDict().FindInt(kVendorIdKey) !=
device_to_compare->GetDict().FindInt(kVendorIdKey) ||
device->GetDict().FindInt(kProductIdKey) !=
device_to_compare->GetDict().FindInt(kProductIdKey) ||
*device->GetDict().FindString(kSerialNumberKey) !=
*device_to_compare->GetDict().FindString(kSerialNumberKey)) {
return false;
}

#if BUILDFLAG(IS_MAC)
if (*device->FindString(kUsbDriverKey) !=
*device_to_compare->FindString(kUsbDriverKey)) {
if (*device->GetDict().FindString(kUsbDriverKey) !=
*device_to_compare->GetDict().FindString(kUsbDriverKey)) {
return false;
}
#endif // BUILDFLAG(IS_MAC)
Expand Down

0 comments on commit 9983891

Please sign in to comment.