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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2425663002: Add an error page for resources blocked via XSS Auditor. (Closed)
Patch Set: Created 4 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 | « content/renderer/render_frame_impl.h ('k') | net/base/net_error_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 8f75c8c80271d9285366d8ccd3a3188ed594ff00..d8b05a7d9908f15a68f59d75142ea7e0f0ef40e9 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2479,6 +2479,22 @@ void RenderFrameImpl::LoadURLExternally(const blink::WebURLRequest& request,
loadURLExternally(request, policy, WebString(), false);
}
+void RenderFrameImpl::loadErrorPage(int reason) {
+ blink::WebURLError error;
+ error.unreachableURL = frame_->document().url();
+ error.domain = WebString::fromUTF8(net::kErrorDomain);
+ error.reason = reason;
+
+ std::string error_html;
+ GetContentClient()->renderer()->GetNavigationErrorStrings(
+ this, frame_->dataSource()->request(), error, &error_html, nullptr);
+
+ frame_->loadData(error_html, WebString::fromUTF8("text/html"),
+ WebString::fromUTF8("UTF-8"), GURL(kUnreachableWebDataURL),
Tom Sepez 2016/10/20 18:26:58 Maybe truncate the ? and # portions of the url?
+ error.unreachableURL, true, blink::WebFrameLoadType::Standard,
+ blink::WebHistoryItem(), blink::WebHistoryDifferentDocumentLoad, true);
+}
+
void RenderFrameImpl::ExecuteJavaScript(const base::string16& javascript) {
OnJavaScriptExecuteRequest(javascript, 0, false);
}
« no previous file with comments | « content/renderer/render_frame_impl.h ('k') | net/base/net_error_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698