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

Unified Diff: chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.cc

Issue 224893002: device/bluetooth: Rename device::bluetooth_utils::UUID to device::BluetoothUUID (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months 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: chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.cc
diff --git a/chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.cc b/chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.cc
index 4b46256d0364e79400a218e9e892db5b32e24074..c5ead3c52a083df49a099e71762512a5e0a8b24a 100644
--- a/chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.cc
+++ b/chrome/common/extensions/api/bluetooth/bluetooth_manifest_permission.cc
@@ -10,7 +10,7 @@
#include "base/values.h"
#include "chrome/common/extensions/api/bluetooth/bluetooth_manifest_data.h"
#include "chrome/common/extensions/api/manifest_types.h"
-#include "device/bluetooth/bluetooth_utils.h"
+#include "device/bluetooth/bluetooth_uuid.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/extension_messages.h"
#include "extensions/common/manifest_constants.h"
@@ -31,8 +31,8 @@ namespace {
bool ParseUuid(BluetoothManifestPermission* permission,
const std::string& uuid,
base::string16* error) {
- std::string canonical_uuid = device::bluetooth_utils::CanonicalUuid(uuid);
- if (canonical_uuid.empty()) {
+ device::BluetoothUUID bt_uuid(uuid);
+ if (!bt_uuid.IsValid()) {
*error = ErrorUtils::FormatErrorMessageUTF16(
errors::kErrorInvalidUuid, uuid);
return false;
@@ -83,13 +83,12 @@ bool BluetoothManifestPermission::CheckRequest(
const Extension* extension,
const BluetoothPermissionRequest& request) const {
- std::string canonical_param_uuid =
- device::bluetooth_utils::CanonicalUuid(request.uuid);
+ device::BluetoothUUID param_uuid(request.uuid);
for (BluetoothUuidSet::const_iterator it = uuids_.begin();
it != uuids_.end();
++it) {
- std::string canonical_uuid = device::bluetooth_utils::CanonicalUuid(*it);
- if (canonical_uuid == canonical_param_uuid)
+ device::BluetoothUUID uuid(*it);
+ if (param_uuid == uuid)
return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698