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

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

Issue 277113002: Fixed flakiness of context_lost tests on GPU bots. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed more review feedback from creis. Created 6 years, 7 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.cc ('k') | content/common/gpu/client/gpu_channel_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl.cc
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 79e2c7b478ca89c52a53ec2bdc079c29fddcdae3..601f9a26e313050b38226bd8f518e76c0846bdc6 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -5,12 +5,14 @@
#include "content/browser/frame_host/navigation_controller_impl.h"
#include "base/bind.h"
+#include "base/command_line.h"
#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/strings/string_number_conversions.h" // Temporary
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
+#include "cc/base/switches.h"
#include "content/browser/browser_url_handler_impl.h"
#include "content/browser/dom_storage/dom_storage_context_wrapper.h"
#include "content/browser/dom_storage/session_storage_namespace_impl.h"
@@ -1012,8 +1014,18 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
// update the virtual URL when replaceState is called after a pushState.
GURL url = params.url;
bool needs_update = false;
- BrowserURLHandlerImpl::GetInstance()->RewriteURLIfNecessary(
- &url, browser_context_, &needs_update);
+ // 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);
+ }
new_entry->set_update_virtual_url_with_url(needs_update);
// When navigating to a new page, give the browser URL handler a chance to
« no previous file with comments | « content/browser/frame_host/debug_urls.cc ('k') | content/common/gpu/client/gpu_channel_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698