#include "content/browser/web_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) {
if (!(transition & content::PAGE_TRANSITION_FROM_ADDRESS_BAR))
return false;
if (url.host() == chrome::kChromeUIBrowserCrashHost) {
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;
}
}