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

Unified Diff: content/browser/frame_host/debug_urls.cc

Issue 418733002: Prevent duplicate navigation to debug URLs from Telemetry. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix comment. Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/debug_urls.h ('k') | content/browser/frame_host/navigation_controller_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « content/browser/frame_host/debug_urls.h ('k') | content/browser/frame_host/navigation_controller_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698