-PassRefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::GenericTypes::SearchMatch>> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex)
+Ref<Inspector::Protocol::Array<Inspector::Protocol::GenericTypes::SearchMatch>> searchInTextByLines(const String& text, const String& query, const bool caseSensitive, const bool isRegex)
JSC::Yarr::RegularExpression regex = ContentSearchUtilities::createSearchRegex(query, caseSensitive, isRegex);
Vector<std::pair<size_t, String>> matches = getRegularExpressionMatchesByLines(regex, text);
JSC::Yarr::RegularExpression regex = ContentSearchUtilities::createSearchRegex(query, caseSensitive, isRegex);
Vector<std::pair<size_t, String>> matches = getRegularExpressionMatchesByLines(regex, text);
- for (const auto& match : matches)
- result->addItem(buildObjectForSearchMatch(match.first, match.second));
+ for (const auto& match : matches) {
+ Ref<Inspector::Protocol::GenericTypes::SearchMatch> matchObject = buildObjectForSearchMatch(match.first, match.second);
+ result->addItem(WTF::move(matchObject));
+ }
const char* error = nullptr;
JSC::Yarr::YarrPattern pattern(patternString, false, true, &error);
ASSERT(!error);
BumpPointerAllocator regexAllocator;
const char* error = nullptr;
JSC::Yarr::YarrPattern pattern(patternString, false, true, &error);
ASSERT(!error);
BumpPointerAllocator regexAllocator;