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

Unified Diff: chrome/browser/errorpage_browsertest.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/browser/errorpage_browsertest.cc
diff --git a/chrome/browser/errorpage_browsertest.cc b/chrome/browser/errorpage_browsertest.cc
index c23c7d04d8fa770c9fc1d2a2063e10a9e7158aca..025492f300e95059a351698a9980cdcda2789854 100644
--- a/chrome/browser/errorpage_browsertest.cc
+++ b/chrome/browser/errorpage_browsertest.cc
@@ -89,8 +89,9 @@ bool WARN_UNUSED_RESULT IsDisplayingNetError(Browser* browser,
net::Error error_code) {
// Get the error as a string, and remove the leading "net::", which is not
// included on error pages.
- std::string error_string = net::ErrorToString(error_code);
- base::RemoveChars(error_string, "net:", &error_string);
+ std::string error_string(net::ErrorToString(error_code));
+ DCHECK(StartsWithASCII(error_string, "net::", true));
+ error_string.erase(0, 5);
return IsDisplayingText(browser, error_string);
}

Powered by Google App Engine
This is Rietveld 408576698