Index: chrome/browser/guest_view/web_view/web_view_guest.cc |
diff --git a/chrome/browser/guest_view/web_view/web_view_guest.cc b/chrome/browser/guest_view/web_view/web_view_guest.cc |
index 981e16626e6b37000aa396729277e901b29a915c..f5997d4a14f60337983e7a42a2031718b4ffaa6d 100644 |
--- a/chrome/browser/guest_view/web_view/web_view_guest.cc |
+++ b/chrome/browser/guest_view/web_view/web_view_guest.cc |
@@ -822,8 +822,9 @@ void WebViewGuest::DidFailProvisionalLoad( |
const base::string16& error_description, |
content::RenderViewHost* render_view_host) { |
// Translate the |error_code| into an error string. |
- std::string error_type; |
- base::RemoveChars(net::ErrorToString(error_code), "net::", &error_type); |
+ std::string error_type(net::ErrorToString(error_code)); |
+ DCHECK(StartsWithASCII(error_type, "net::", true)); |
+ error_type.erase(0, 5); |
LoadAbort(is_main_frame, validated_url, error_type); |
} |
@@ -1073,9 +1074,9 @@ void WebViewGuest::NavigateGuest(const std::string& src) { |
!url.SchemeIs(content::kAboutScheme)) || |
url.SchemeIs(url::kJavaScriptScheme); |
if (scheme_is_blocked || !url.is_valid()) { |
- std::string error_type; |
- base::RemoveChars(net::ErrorToString(net::ERR_ABORTED), "net::", |
- &error_type); |
+ std::string error_type(net::ErrorToString(net::ERR_ABORTED)); |
+ DCHECK(StartsWithASCII(error_type, "net::", true)); |
+ error_type.erase(0, 5); |
LoadAbort(true /* is_top_level */, url, error_type); |
return; |
} |