| Index: extensions/common/permissions/usb_device_permission_data.cc
|
| diff --git a/extensions/common/permissions/usb_device_permission_data.cc b/extensions/common/permissions/usb_device_permission_data.cc
|
| index fbd442809af7c981ce500cade41b9569d33feb03..5d49487bbc19ce733205ded8b89d82f305c1de25 100644
|
| --- a/extensions/common/permissions/usb_device_permission_data.cc
|
| +++ b/extensions/common/permissions/usb_device_permission_data.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "extensions/common/permissions/usb_device_permission_data.h"
|
|
|
| +#include <limits>
|
| #include <string>
|
| #include <tuple>
|
| #include <vector>
|
| @@ -30,13 +31,12 @@ UsbDevicePermissionData::UsbDevicePermissionData()
|
| : vendor_id_(0), product_id_(0), interface_id_(ANY_INTERFACE) {
|
| }
|
|
|
| -UsbDevicePermissionData::UsbDevicePermissionData(uint16 vendor_id,
|
| - uint16 product_id,
|
| +UsbDevicePermissionData::UsbDevicePermissionData(uint16_t vendor_id,
|
| + uint16_t product_id,
|
| int interface_id)
|
| - : vendor_id_(vendor_id),
|
| - product_id_(product_id),
|
| - interface_id_(interface_id) {
|
| -}
|
| + : vendor_id_(vendor_id),
|
| + product_id_(product_id),
|
| + interface_id_(interface_id) {}
|
|
|
| bool UsbDevicePermissionData::Check(
|
| const APIPermission::CheckParam* param) const {
|
| @@ -69,19 +69,19 @@ bool UsbDevicePermissionData::FromValue(const base::Value* value) {
|
| int temp;
|
| if (!dict_value->GetInteger(kVendorIdKey, &temp))
|
| return false;
|
| - if (temp < 0 || temp > kuint16max)
|
| + if (temp < 0 || temp > std::numeric_limits<uint16_t>::max())
|
| return false;
|
| vendor_id_ = temp;
|
|
|
| if (!dict_value->GetInteger(kProductIdKey, &temp))
|
| return false;
|
| - if (temp < 0 || temp > kuint16max)
|
| + if (temp < 0 || temp > std::numeric_limits<uint16_t>::max())
|
| return false;
|
| product_id_ = temp;
|
|
|
| if (!dict_value->GetInteger(kInterfaceIdKey, &temp))
|
| interface_id_ = ANY_INTERFACE;
|
| - else if (temp < ANY_INTERFACE || temp > kuint8max)
|
| + else if (temp < ANY_INTERFACE || temp > std::numeric_limits<uint8_t>::max())
|
| return false;
|
| else
|
| interface_id_ = temp;
|
|
|