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

Unified Diff: chrome/renderer/chrome_render_view_observer.cc

Issue 296593003: Make various string_util functions take StringPieces instead of char[]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 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
Index: chrome/renderer/chrome_render_view_observer.cc
diff --git a/chrome/renderer/chrome_render_view_observer.cc b/chrome/renderer/chrome_render_view_observer.cc
index ea3d0c50bcd1488ea72b1419a6c70d6f72488097..03eee04556a062248efc3c5e9914a790b6dadace 100644
--- a/chrome/renderer/chrome_render_view_observer.cc
+++ b/chrome/renderer/chrome_render_view_observer.cc
@@ -558,9 +558,8 @@ void ChromeRenderViewObserver::CaptureText(WebFrame* frame,
// terminate the string at the last space to ensure no words are clipped.
if (contents->size() == kMaxIndexChars) {
size_t last_space_index = contents->find_last_of(base::kWhitespaceUTF16);
- if (last_space_index == base::string16::npos)
- return; // don't index if we got a huge block of text with no spaces
- contents->resize(last_space_index);
+ if (last_space_index != base::string16::npos)
+ contents->resize(last_space_index);
}
}

Powered by Google App Engine
This is Rietveld 408576698