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

Unified Diff: content/renderer/render_view_impl.cc

Issue 9349010: Move handling of debug urls like chrome://crash, chrome://gpuclean to content. These are for test... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 10 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: content/renderer/render_view_impl.cc
===================================================================
--- content/renderer/render_view_impl.cc (revision 120733)
+++ content/renderer/render_view_impl.cc (working copy)
@@ -325,6 +325,29 @@
WebKit::WebReferrerPolicyDefault;
}
+static void MaybeHandleDebugURL(const GURL& url) {
+ if (!url.SchemeIs(chrome::kChromeUIScheme))
+ return;
+ if (url == GURL(chrome::kChromeUICrashURL)) {
+ // NOTE(shess): Crash directly rather than using NOTREACHED() so
+ // that the signature is easier to triage in crash reports.
+ volatile int* zero = NULL;
+ *zero = 0;
+
+ // Just in case the compiler decides the above is undefined and
+ // optimizes it away.
+ NOTREACHED();
+ } else if (url == GURL(chrome::kChromeUIKillURL)) {
+ base::KillProcess(base::GetCurrentProcessHandle(), 1, false);
+ } else if (url == GURL(chrome::kChromeUIHangURL)) {
+ for (;;) {
+ base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(1));
+ }
+ } else if (url == GURL(chrome::kChromeUIShorthangURL)) {
+ base::PlatformThread::Sleep(base::TimeDelta::FromSeconds(20));
+ }
+}
+
///////////////////////////////////////////////////////////////////////////////
struct RenderViewImpl::PendingFileChooser {
@@ -789,6 +812,7 @@
}
void RenderViewImpl::OnNavigate(const ViewMsg_Navigate_Params& params) {
+ MaybeHandleDebugURL(params.url);
if (!webview())
return;

Powered by Google App Engine
This is Rietveld 408576698