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

Side by Side Diff: content/browser/tab_contents/debug_urls.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 unified diff | Download patch | Annotate | Revision Log
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/browser/tab_contents/debug_urls.h"
6
7 #include "content/browser/gpu/gpu_process_host_ui_shim.h"
8 #include "content/public/common/url_constants.h"
9 #include "googleurl/src/gurl.h"
10
11 namespace content {
12
13 bool HandleDebugURL(const GURL& url, content::PageTransition transition) {
14 content::PageTransition base_transition =
15 content::PageTransitionStripQualifier(transition);
16 if (base_transition != content::PAGE_TRANSITION_TYPED)
17 return false;
18
19 // 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
20 if (url.host() == chrome::kChromeUIBrowserCrashHost) {
21 // Induce an intentional crash in the browser process.
22 CHECK(false);
23 return true;
24 }
25
26 if (url == GURL(chrome::kChromeUIGpuCleanURL)) {
27 GpuProcessHostUIShim* shim = GpuProcessHostUIShim::GetOneInstance();
28 if (shim)
29 shim->SimulateRemoveAllContext();
30 return true;
31 }
32
33 if (url == GURL(chrome::kChromeUIGpuCrashURL)) {
34 GpuProcessHostUIShim* shim = GpuProcessHostUIShim::GetOneInstance();
35 if (shim)
36 shim->SimulateCrash();
37 return true;
38 }
39
40 if (url == GURL(chrome::kChromeUIGpuHangURL)) {
41 GpuProcessHostUIShim* shim = GpuProcessHostUIShim::GetOneInstance();
42 if (shim)
43 shim->SimulateHang();
44 return true;
45 }
46
47 return false;
48 }
49
50 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698