Bug 1297773 - Fix thread filter to use case insensitive substring matching. r=mstange

MozReview-Commit-ID: 9umKsSQ9a73

--HG--
extra : rebase_source : 4358a4cf8d8b6e613097449e90a1cbb92f668552
This commit is contained in:
Benoit Girard 2016-08-24 16:22:53 -04:00
parent c7b987867a
commit 3011e2c2dd

View File

@ -18,6 +18,8 @@
#include "GeckoTaskTracer.h"
#endif
#include <algorithm>
namespace mozilla {
class ProfileGatherer;
} // namespace mozilla
@ -31,8 +33,15 @@ threadSelected(ThreadInfo* aInfo, const ThreadNameFilterList &aThreadNameFilters
return true;
}
std::string name = aInfo->Name();
std::transform(name.begin(), name.end(), name.begin(), ::tolower);
for (uint32_t i = 0; i < aThreadNameFilters.length(); ++i) {
if (aThreadNameFilters[i] == aInfo->Name()) {
std::string filter = aThreadNameFilters[i];
std::transform(filter.begin(), filter.end(), filter.begin(), ::tolower);
// Crude, non UTF-8 compatible, case insensitive substring search
if (name.find(filter) != std::string::npos) {
return true;
}
}