Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Unified Diff: extensions/common/permissions/usb_device_permission_data.cc

Issue 1485853003: Revert of Remove kuint16max. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@kint2
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 5d49487bbc19ce733205ded8b89d82f305c1de25..fbd442809af7c981ce500cade41b9569d33feb03 100644
--- a/extensions/common/permissions/usb_device_permission_data.cc
+++ b/extensions/common/permissions/usb_device_permission_data.cc
@@ -4,7 +4,6 @@
#include "extensions/common/permissions/usb_device_permission_data.h"
-#include <limits>
#include <string>
#include <tuple>
#include <vector>
@@ -31,12 +30,13 @@
: vendor_id_(0), product_id_(0), interface_id_(ANY_INTERFACE) {
}
-UsbDevicePermissionData::UsbDevicePermissionData(uint16_t vendor_id,
- uint16_t product_id,
+UsbDevicePermissionData::UsbDevicePermissionData(uint16 vendor_id,
+ uint16 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 @@
int temp;
if (!dict_value->GetInteger(kVendorIdKey, &temp))
return false;
- if (temp < 0 || temp > std::numeric_limits<uint16_t>::max())
+ if (temp < 0 || temp > kuint16max)
return false;
vendor_id_ = temp;
if (!dict_value->GetInteger(kProductIdKey, &temp))
return false;
- if (temp < 0 || temp > std::numeric_limits<uint16_t>::max())
+ if (temp < 0 || temp > kuint16max)
return false;
product_id_ = temp;
if (!dict_value->GetInteger(kInterfaceIdKey, &temp))
interface_id_ = ANY_INTERFACE;
- else if (temp < ANY_INTERFACE || temp > std::numeric_limits<uint8_t>::max())
+ else if (temp < ANY_INTERFACE || temp > kuint8max)
return false;
else
interface_id_ = temp;
« no previous file with comments | « extensions/common/permissions/usb_device_permission_data.h ('k') | jingle/notifier/communicator/single_login_attempt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698