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

Unified Diff: chrome/browser/extensions/api/messaging/native_messaging_host_manifest.cc

Issue 1878083002: Implement IsAsciiUpper and IsAsciiLower in base/strings/string_util.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: git sync Created 4 years, 8 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/browser/extensions/api/messaging/native_messaging_host_manifest.cc
diff --git a/chrome/browser/extensions/api/messaging/native_messaging_host_manifest.cc b/chrome/browser/extensions/api/messaging/native_messaging_host_manifest.cc
index 27a6f99a2c18a37b2a1c3a358e2ed7689836bf71..e54984f45d9bdd288e1c4d3ba4d942a3a29c5dab 100644
--- a/chrome/browser/extensions/api/messaging/native_messaging_host_manifest.cc
+++ b/chrome/browser/extensions/api/messaging/native_messaging_host_manifest.cc
@@ -8,6 +8,7 @@
#include "base/json/json_file_value_serializer.h"
#include "base/logging.h"
+#include "base/strings/string_util.h"
#include "base/values.h"
namespace extensions {
@@ -24,8 +25,8 @@ bool NativeMessagingHostManifest::IsValidName(const std::string& name) {
char c = name[i];
// Verify that only the following characters are used: [a-z0-9._].
- if (!((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9') ||
- c == '.' || c == '_')) {
+ if (!(base::IsAsciiLower(c) || base::IsAsciiDigit(c) || c == '.' ||
+ c == '_')) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698