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

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: Resync 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
« no previous file with comments | « chrome/installer/util/shell_util.cc ('k') | chromeos/system/name_value_pairs_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6bca11293b9b4ff5229ab9344c1c409cf4767630..8c32b5d14b5bed9018850b2cc80605960e8489a5 100644
--- a/chrome/renderer/chrome_render_view_observer.cc
+++ b/chrome/renderer/chrome_render_view_observer.cc
@@ -569,9 +569,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);
}
}
« no previous file with comments | « chrome/installer/util/shell_util.cc ('k') | chromeos/system/name_value_pairs_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698