From a2027fb609835a3f95557b39611e3d11b89fca03 Mon Sep 17 00:00:00 2001 From: brettw Date: Mon, 13 Jul 2015 19:24:50 -0700 Subject: Remove CaseInsensitiveCompare from string_util.h There were a number of callers in net using this for HTTP headers. I think these callers actually just need ASCII case-insensitive comparisons so these were changed. The omnibox code used this functor. I added a new omnibox-specific one which does not have the locale issues of the old string_util one, but which still has the UTF-16 and combining accent issues (described in great detail in the comment for this). The Windows installer code can't depend on ICU so it calls the Win32 function to do case-insensitive comparisons. This should match the system comparison for registry keys better anyway. I also changed a caller of StartsWith to use this version. I wrote this StartsWith call using ToLower in a previous patch, but it turns out that the lengths of case-mapped strings do change in practice, making the offset computations of the suyrrounding code incorrect. This new version will be like the old version (will miss some cases of case-insensitive equality) but will handle 0x80-0xFF properly. BUG=24917 Review URL: https://codereview.chromium.org/1230583014 Cr-Commit-Position: refs/heads/master@{#338624} --- win8/test/ui_automation_client.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'win8') diff --git a/win8/test/ui_automation_client.cc b/win8/test/ui_automation_client.cc index 9aa4237..22c1af1 100644 --- a/win8/test/ui_automation_client.cc +++ b/win8/test/ui_automation_client.cc @@ -323,10 +323,11 @@ void UIAutomationClient::Context::HandleWindowOpen( base::string16 class_name(V_BSTR(var.ptr())); - // Window class names are atoms, which are case-insensitive. + // Window class names are atoms, which are case-insensitive. Assume that + // the window in question only needs ASCII case-insensitivity. if (class_name.size() == class_name_.size() && std::equal(class_name.begin(), class_name.end(), class_name_.begin(), - base::CaseInsensitiveCompare())) { + base::CaseInsensitiveCompareASCII())) { RemoveWindowObserver(); ProcessWindow(window); } -- cgit v1.1