| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/web_contents/debug_urls.h" | 5 #include "content/browser/web_contents/debug_urls.h" |
| 6 | 6 |
| 7 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 7 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
| 8 #include "content/public/common/url_constants.h" | 8 #include "content/public/common/url_constants.h" |
| 9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 bool HandleDebugURL(const GURL& url, content::PageTransition transition) { | 13 bool HandleDebugURL(const GURL& url, PageTransition transition) { |
| 14 // Ensure that the user explicitly navigated to this URL. | 14 // Ensure that the user explicitly navigated to this URL. |
| 15 if (!(transition & content::PAGE_TRANSITION_FROM_ADDRESS_BAR)) | 15 if (!(transition & PAGE_TRANSITION_FROM_ADDRESS_BAR)) |
| 16 return false; | 16 return false; |
| 17 | 17 |
| 18 if (url.host() == chrome::kChromeUIBrowserCrashHost) { | 18 if (url.host() == chrome::kChromeUIBrowserCrashHost) { |
| 19 // Induce an intentional crash in the browser process. | 19 // Induce an intentional crash in the browser process. |
| 20 CHECK(false); | 20 CHECK(false); |
| 21 return true; | 21 return true; |
| 22 } | 22 } |
| 23 | 23 |
| 24 if (url == GURL(chrome::kChromeUIGpuCleanURL)) { | 24 if (url == GURL(chrome::kChromeUIGpuCleanURL)) { |
| 25 GpuProcessHostUIShim* shim = GpuProcessHostUIShim::GetOneInstance(); | 25 GpuProcessHostUIShim* shim = GpuProcessHostUIShim::GetOneInstance(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 39 GpuProcessHostUIShim* shim = GpuProcessHostUIShim::GetOneInstance(); | 39 GpuProcessHostUIShim* shim = GpuProcessHostUIShim::GetOneInstance(); |
| 40 if (shim) | 40 if (shim) |
| 41 shim->SimulateHang(); | 41 shim->SimulateHang(); |
| 42 return true; | 42 return true; |
| 43 } | 43 } |
| 44 | 44 |
| 45 return false; | 45 return false; |
| 46 } | 46 } |
| 47 | 47 |
| 48 } // namespace content | 48 } // namespace content |
| OLD | NEW |