From a7ff1b291cd328e9584779a4bb9101fa9a3c01ad Mon Sep 17 00:00:00 2001 From: brettw Date: Thu, 16 Jul 2015 10:49:29 -0700 Subject: Remove some legacy versions of StartsWith and EndsWith. This just replaces true -> base::CompareCase::SENSITIVE false -> base::CompareCase::INSENSITIVE_ASCII I checked the insensitive cases to make sure they're not doing anything suspicious. The old version is a sometimes-correct Unicode comparison so converting to INSENSTITIVE_ASCII isn't a no-op. However, generally the prefix/suffix checking is done against a hardcoded string so there were very few cases to actually look at. extensions/browser/api/declarative_webrequest/webrequest_condition_attribute.cc has a not-quite search-and-replace change where I changed the type of a class variable. BUG=506255 TBR=jam Reland of http://crrev.com/1239493005 Review URL: https://codereview.chromium.org/1233043003 Cr-Commit-Position: refs/heads/master@{#339071} --- dbus/string_util.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'dbus') diff --git a/dbus/string_util.cc b/dbus/string_util.cc index 0b07786..16e483a 100644 --- a/dbus/string_util.cc +++ b/dbus/string_util.cc @@ -8,13 +8,10 @@ namespace dbus { +// This implementation is based upon D-Bus Specification Version 0.19. bool IsValidObjectPath(const std::string& value) { - // This implementation is based upon D-Bus Specification Version 0.19. - - const bool kCaseSensitive = true; - // A valid object path begins with '/'. - if (!base::StartsWithASCII(value, "/", kCaseSensitive)) + if (!base::StartsWith(value, "/", base::CompareCase::SENSITIVE)) return false; // Elements are pieces delimited by '/'. For instance, "org", "chromium", @@ -39,7 +36,8 @@ bool IsValidObjectPath(const std::string& value) { } // A trailing '/' character is not allowed unless the path is the root path. - if (value.size() > 1 && base::EndsWith(value, "/", kCaseSensitive)) + if (value.size() > 1 && + base::EndsWith(value, "/", base::CompareCase::SENSITIVE)) return false; return true; -- cgit v1.1