OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/debug_urls.h" | 5 #include "content/browser/frame_host/debug_urls.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
| 9 #include "base/command_line.h" |
9 #include "base/debug/asan_invalid_access.h" | 10 #include "base/debug/asan_invalid_access.h" |
10 #include "base/debug/profiler.h" | 11 #include "base/debug/profiler.h" |
11 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "cc/base/switches.h" |
12 #include "content/browser/gpu/gpu_process_host_ui_shim.h" | 14 #include "content/browser/gpu/gpu_process_host_ui_shim.h" |
13 #include "content/browser/ppapi_plugin_process_host.h" | 15 #include "content/browser/ppapi_plugin_process_host.h" |
14 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
15 #include "content/public/common/content_constants.h" | 17 #include "content/public/common/content_constants.h" |
16 #include "content/public/common/url_constants.h" | 18 #include "content/public/common/url_constants.h" |
17 #include "ppapi/proxy/ppapi_messages.h" | 19 #include "ppapi/proxy/ppapi_messages.h" |
18 #include "url/gurl.h" | 20 #include "url/gurl.h" |
19 | 21 |
20 namespace content { | 22 namespace content { |
21 | 23 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 } | 101 } |
100 #endif | 102 #endif |
101 | 103 |
102 return true; | 104 return true; |
103 } | 105 } |
104 | 106 |
105 | 107 |
106 } // namespace | 108 } // namespace |
107 | 109 |
108 bool HandleDebugURL(const GURL& url, PageTransition transition) { | 110 bool HandleDebugURL(const GURL& url, PageTransition transition) { |
109 // Ensure that the user explicitly navigated to this URL. | 111 // Ensure that the user explicitly navigated to this URL, unless |
110 if (!(transition & PAGE_TRANSITION_FROM_ADDRESS_BAR)) | 112 // kEnableGpuBenchmarking is enabled by Telemetry. |
| 113 bool is_telemetry_navigation = CommandLine::ForCurrentProcess()->HasSwitch( |
| 114 cc::switches::kEnableGpuBenchmarking) && |
| 115 (transition & PAGE_TRANSITION_TYPED); |
| 116 |
| 117 if (!(transition & PAGE_TRANSITION_FROM_ADDRESS_BAR) && |
| 118 !is_telemetry_navigation) |
111 return false; | 119 return false; |
112 | 120 |
113 // NOTE: when you add handling of any URLs to this function, also | 121 // NOTE: when you add handling of any URLs to this function, also |
114 // update IsDebugURL, below. | 122 // update IsDebugURL, below. |
115 | 123 |
116 if (IsAsanDebugURL(url)) | 124 if (IsAsanDebugURL(url)) |
117 return HandleAsanDebugURL(url); | 125 return HandleAsanDebugURL(url); |
118 | 126 |
119 if (url.host() == kChromeUIBrowserCrashHost) { | 127 if (url.host() == kChromeUIBrowserCrashHost) { |
120 // Induce an intentional crash in the browser process. | 128 // Induce an intentional crash in the browser process. |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 return true; | 182 return true; |
175 | 183 |
176 return url == GURL(kChromeUICrashURL) || | 184 return url == GURL(kChromeUICrashURL) || |
177 url == GURL(kChromeUIDumpURL) || | 185 url == GURL(kChromeUIDumpURL) || |
178 url == GURL(kChromeUIKillURL) || | 186 url == GURL(kChromeUIKillURL) || |
179 url == GURL(kChromeUIHangURL) || | 187 url == GURL(kChromeUIHangURL) || |
180 url == GURL(kChromeUIShorthangURL); | 188 url == GURL(kChromeUIShorthangURL); |
181 } | 189 } |
182 | 190 |
183 } // namespace content | 191 } // namespace content |
OLD | NEW |