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

Unified Diff: Tools/DumpRenderTree/chromium/TestRunner/src/SpellCheckClient.cpp

Issue 15806014: Reduce usage of WebString::data (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 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
« no previous file with comments | « Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp ('k') | public/platform/WebString.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/DumpRenderTree/chromium/TestRunner/src/SpellCheckClient.cpp
diff --git a/Tools/DumpRenderTree/chromium/TestRunner/src/SpellCheckClient.cpp b/Tools/DumpRenderTree/chromium/TestRunner/src/SpellCheckClient.cpp
index 68800538462f43be24a8e182214f690c869eea6a..5ef329434150bac75dfb1f7f66ab556fd3c91796 100644
--- a/Tools/DumpRenderTree/chromium/TestRunner/src/SpellCheckClient.cpp
+++ b/Tools/DumpRenderTree/chromium/TestRunner/src/SpellCheckClient.cpp
@@ -85,12 +85,11 @@ void SpellCheckClient::checkTextOfParagraph(const WebString& text, WebTextChecki
vector<WebTextCheckingResult> results;
if (mask & WebTextCheckingTypeSpelling) {
size_t offset = 0;
- size_t length = text.length();
- const WebUChar* data = text.data();
- while (offset < length) {
+ string16 data = text;
+ while (offset < data.length()) {
int misspelledPosition = 0;
int misspelledLength = 0;
- m_spellcheck.spellCheckWord(WebString(&data[offset], length - offset), &misspelledPosition, &misspelledLength);
+ m_spellcheck.spellCheckWord(data.substr(offset), &misspelledPosition, &misspelledLength);
if (!misspelledLength)
break;
WebTextCheckingResult result;
« no previous file with comments | « Tools/DumpRenderTree/chromium/TestRunner/src/EventSender.cpp ('k') | public/platform/WebString.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698