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

Unified Diff: chrome/browser/net/url_fixer_upper.cc

Issue 267001: Separate out some more ICU from base and into base/i18n.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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/browser/download/save_package.cc ('k') | chrome/browser/shell_integration_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/net/url_fixer_upper.cc
===================================================================
--- chrome/browser/net/url_fixer_upper.cc (revision 28217)
+++ chrome/browser/net/url_fixer_upper.cc (working copy)
@@ -70,6 +70,20 @@
UTF8ComponentToWideComponent(text_utf8, parts_utf8.ref);
}
+TrimPositions TrimWhitespaceUTF8(const std::string& input,
+ TrimPositions positions,
+ std::string* output) {
+ // This implementation is not so fast since it converts the text encoding
+ // twice. Please feel free to file a bug if this function hurts the
+ // performance of Chrome.
+ DCHECK(IsStringUTF8(input));
+ std::wstring input_wide = UTF8ToWide(input);
+ std::wstring output_wide;
+ TrimPositions result = TrimWhitespace(input_wide, positions, &output_wide);
+ *output = WideToUTF8(output_wide);
+ return result;
+}
+
} // namespace
// does some basic fixes for input that we want to test for file-ness
« no previous file with comments | « chrome/browser/download/save_package.cc ('k') | chrome/browser/shell_integration_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698