summaryrefslogtreecommitdiffstats
path: root/content/browser/frame_host/navigation_controller_impl.cc
diff options
context:
space:
mode:
authorvmiura@chromium.org <vmiura@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-29 08:01:43 +0000
committervmiura@chromium.org <vmiura@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-07-29 08:01:43 +0000
commit47752987c8a9be45d303e29abd463bee159df34f (patch)
tree4d5ced0c95008391b5f8ebcb80026d3060eb31da /content/browser/frame_host/navigation_controller_impl.cc
parente93b006bd6523f0f36caf0d3e4fbfdf9d415a3db (diff)
downloadchromium_src-47752987c8a9be45d303e29abd463bee159df34f.zip
chromium_src-47752987c8a9be45d303e29abd463bee159df34f.tar.gz
chromium_src-47752987c8a9be45d303e29abd463bee159df34f.tar.bz2
Prevent duplicate navigation to debug URLs from Telemetry.
Previously Telemetry enabled navigation to Debug URLs by adding a custom URL handler. However, URL handlers can be called multiple times per Navigation, and Debug URL actions must happen only once. This CL enables Telemetry URL handling to be done by the normal NavigationControllerImpl::LoadURLWithParams() to HandleDebugURL() path. This also removes the prior workaround added in crrev.com/277113002 . BUG=395326 Review URL: https://codereview.chromium.org/418733002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@286117 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/frame_host/navigation_controller_impl.cc')
-rw-r--r--content/browser/frame_host/navigation_controller_impl.cc23
1 files changed, 9 insertions, 14 deletions
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index a25aeba..a602741 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -652,8 +652,13 @@ void NavigationControllerImpl::LoadURL(
void NavigationControllerImpl::LoadURLWithParams(const LoadURLParams& params) {
TRACE_EVENT0("browser", "NavigationControllerImpl::LoadURLWithParams");
- if (HandleDebugURL(params.url, params.transition_type))
- return;
+ if (HandleDebugURL(params.url, params.transition_type)) {
+ // If Telemetry is running, allow the URL load to proceed as if it's
+ // unhandled, otherwise Telemetry can't tell if Navigation completed.
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(
+ cc::switches::kEnableGpuBenchmarking))
+ return;
+ }
// Any renderer-side debug URLs or javascript: URLs should be ignored if the
// renderer process is not live, unless it is the initial navigation of the
@@ -1035,18 +1040,8 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
// update the virtual URL when replaceState is called after a pushState.
GURL url = params.url;
bool needs_update = false;
- // We call RewriteURLIfNecessary twice: once when page navigation
- // begins in CreateNavigationEntry, and once here when it commits.
- // With the kEnableGpuBenchmarking flag, the rewriting includes
- // handling debug URLs which cause an action to occur, and thus we
- // should not rewrite them a second time.
- bool skip_rewrite =
- IsDebugURL(url) && base::CommandLine::ForCurrentProcess()->HasSwitch(
- cc::switches::kEnableGpuBenchmarking);
- if (!skip_rewrite) {
- BrowserURLHandlerImpl::GetInstance()->RewriteURLIfNecessary(
- &url, browser_context_, &needs_update);
- }
+ BrowserURLHandlerImpl::GetInstance()->RewriteURLIfNecessary(
+ &url, browser_context_, &needs_update);
new_entry->set_update_virtual_url_with_url(needs_update);
// When navigating to a new page, give the browser URL handler a chance to