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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2425663002: Add an error page for resources blocked via XSS Auditor. (Closed)
Patch Set: Test. Created 4 years, 1 month 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 593d5755c04a9acec50d2382b64e560eafe1ec75..0f1eeca5d7aebbafe22c68bb5991e66eae602fa2 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -2478,6 +2478,23 @@ 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),
+ 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