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

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: 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/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));
darin (slow to review) 2014/05/22 23:49:46 This case seems fine since the code is calling Err
Peter Kasting 2014/05/22 23:54:50 I'm confused. Both other cases are also calling E
+ 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 =

Powered by Google App Engine
This is Rietveld 408576698