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

Unified Diff: chrome/common/localized_error.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/browser/ui/omnibox/location_bar_util.cc ('k') | chrome/installer/setup/install.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/localized_error.cc
diff --git a/chrome/common/localized_error.cc b/chrome/common/localized_error.cc
index 1645d1188ada7ab6c703282c9a62e2e1833f9423..ecff88ff9ced20dd5db90d30fa2557c76ceee9f4 100644
--- a/chrome/common/localized_error.cc
+++ b/chrome/common/localized_error.cc
@@ -580,7 +580,8 @@ void LocalizedError::GetStrings(int error_code,
// Non-internationalized error string, for debugging Chrome itself.
std::string ascii_error_string = net::ErrorToString(error_code);
// Remove the leading "net::" from the returned string.
- base::RemoveChars(ascii_error_string, "net:", &ascii_error_string);
+ DCHECK(StartsWithASCII(ascii_error_string, "net::", true));
+ ascii_error_string.erase(0, 5);
error_string = base::ASCIIToUTF16(ascii_error_string);
} else if (error_domain == chrome_common_net::kDnsProbeErrorDomain) {
std::string ascii_error_string =
« no previous file with comments | « chrome/browser/ui/omnibox/location_bar_util.cc ('k') | chrome/installer/setup/install.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698