Chromium Code Reviews| Index: content/browser/tab_contents/debug_urls.cc |
| =================================================================== |
| --- content/browser/tab_contents/debug_urls.cc (revision 0) |
| +++ content/browser/tab_contents/debug_urls.cc (revision 0) |
| @@ -0,0 +1,50 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "content/browser/tab_contents/debug_urls.h" |
| + |
| +#include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| +#include "content/public/common/url_constants.h" |
| +#include "googleurl/src/gurl.h" |
| + |
| +namespace content { |
| + |
| +bool HandleDebugURL(const GURL& url, content::PageTransition transition) { |
| + content::PageTransition base_transition = |
| + content::PageTransitionStripQualifier(transition); |
| + if (base_transition != content::PAGE_TRANSITION_TYPED) |
| + return false; |
| + |
| + // Handle URLs to crash the browser or wreck the gpu process. |
|
Avi (use Gerrit)
2012/02/08 03:46:41
Move to be function comment rather than a comment
|
| + if (url.host() == chrome::kChromeUIBrowserCrashHost) { |
| + // Induce an intentional crash in the browser process. |
| + CHECK(false); |
| + return true; |
| + } |
| + |
| + if (url == GURL(chrome::kChromeUIGpuCleanURL)) { |
| + GpuProcessHostUIShim* shim = GpuProcessHostUIShim::GetOneInstance(); |
| + if (shim) |
| + shim->SimulateRemoveAllContext(); |
| + return true; |
| + } |
| + |
| + if (url == GURL(chrome::kChromeUIGpuCrashURL)) { |
| + GpuProcessHostUIShim* shim = GpuProcessHostUIShim::GetOneInstance(); |
| + if (shim) |
| + shim->SimulateCrash(); |
| + return true; |
| + } |
| + |
| + if (url == GURL(chrome::kChromeUIGpuHangURL)) { |
| + GpuProcessHostUIShim* shim = GpuProcessHostUIShim::GetOneInstance(); |
| + if (shim) |
| + shim->SimulateHang(); |
| + return true; |
| + } |
| + |
| + return false; |
| +} |
| + |
| +} // namespace content |
| Property changes on: content\browser\tab_contents\debug_urls.cc |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |