Index: content/browser/frame_host/debug_urls.cc |
diff --git a/content/browser/frame_host/debug_urls.cc b/content/browser/frame_host/debug_urls.cc |
index ae454ae64a73f25687a0f72cdae5804771ea7e11..b3840984e79ac0d41bff47dae284f0b31e165ece 100644 |
--- a/content/browser/frame_host/debug_urls.cc |
+++ b/content/browser/frame_host/debug_urls.cc |
@@ -6,9 +6,11 @@ |
#include <vector> |
+#include "base/command_line.h" |
#include "base/debug/asan_invalid_access.h" |
#include "base/debug/profiler.h" |
#include "base/strings/utf_string_conversions.h" |
+#include "cc/base/switches.h" |
#include "content/browser/gpu/gpu_process_host_ui_shim.h" |
#include "content/browser/ppapi_plugin_process_host.h" |
#include "content/public/browser/browser_thread.h" |
@@ -106,13 +108,16 @@ bool HandleAsanDebugURL(const GURL& url) { |
} // namespace |
bool HandleDebugURL(const GURL& url, PageTransition transition) { |
- // Ensure that the user explicitly navigated to this URL. |
- if (!(transition & PAGE_TRANSITION_FROM_ADDRESS_BAR)) |
+ // Ensure that the user explicitly navigated to this URL, unless |
+ // kEnableGpuBenchmarking is enabled by Telemetry. |
+ bool is_telemetry_navigation = CommandLine::ForCurrentProcess()->HasSwitch( |
+ cc::switches::kEnableGpuBenchmarking) && |
+ (transition & PAGE_TRANSITION_TYPED); |
+ |
+ if (!(transition & PAGE_TRANSITION_FROM_ADDRESS_BAR) && |
+ !is_telemetry_navigation) |
return false; |
- // NOTE: when you add handling of any URLs to this function, also |
- // update IsDebugURL, below. |
- |
if (IsAsanDebugURL(url)) |
return HandleAsanDebugURL(url); |
@@ -153,19 +158,6 @@ bool HandleDebugURL(const GURL& url, PageTransition transition) { |
return false; |
} |
-bool IsDebugURL(const GURL& url) { |
- // NOTE: when you add any URLs to this list, also update |
- // HandleDebugURL, above. |
- return IsRendererDebugURL(url) || IsAsanDebugURL(url) || |
- (url.is_valid() && |
- (url.host() == kChromeUIBrowserCrashHost || |
- url == GURL(kChromeUIGpuCleanURL) || |
- url == GURL(kChromeUIGpuCrashURL) || |
- url == GURL(kChromeUIGpuHangURL) || |
- url == GURL(kChromeUIPpapiFlashCrashURL) || |
- url == GURL(kChromeUIPpapiFlashHangURL))); |
-} |
- |
bool IsRendererDebugURL(const GURL& url) { |
if (!url.is_valid()) |
return false; |