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

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

Issue 2373273002: Run unload handlers when navigating to about:blank using PlzNavigate. (Closed)
Patch Set: undo incorrect change that broke chrome://crash Created 4 years, 2 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 | « chrome/browser/ui/browser_browsertest.cc ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 50787510ac49e81c23c39e6ca723f4163e07075d..cfb7e4bdfebc8f1453a22173c3aa07f23e625ad8 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -9,6 +9,7 @@
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/time/time.h"
+#include "content/browser/frame_host/debug_urls.h"
#include "content/browser/frame_host/frame_tree.h"
#include "content/browser/frame_host/frame_tree_node.h"
#include "content/browser/frame_host/navigation_controller_impl.h"
@@ -410,10 +411,10 @@ bool NavigatorImpl::NavigateToEntry(
CHECK_EQ(controller_->GetPendingEntry(), &entry);
if (controller_->GetPendingEntryIndex() == -1 &&
- dest_url.SchemeIs(url::kJavaScriptScheme)) {
+ IsRendererDebugURL(dest_url)) {
// If the pending entry index is -1 (which means a new navigation rather
- // than a history one), and the user typed in a javascript: URL, don't add
- // it to the session history.
+ // than a history one), and the user typed in a debug URL, don't add it to
+ // the session history.
//
// This is a hack. What we really want is to avoid adding to the history any
// URL that doesn't generate content, and what would be great would be if we
@@ -1054,12 +1055,9 @@ void NavigatorImpl::RequestNavigation(FrameTreeNode* frame_tree_node,
navigation_request->CreateNavigationHandle(entry.GetUniqueID());
// Have the current renderer execute its beforeunload event if needed. If it
- // is not needed (when beforeunload dispatch is not needed or this navigation
- // is synchronous and same-site) then NavigationRequest::BeginNavigation
- // should be directly called instead.
- if (should_dispatch_beforeunload &&
- ShouldMakeNetworkRequestForURL(
- navigation_request->common_params().url)) {
+ // is not needed then NavigationRequest::BeginNavigation should be directly
+ // called instead.
+ if (should_dispatch_beforeunload && !IsRendererDebugURL(dest_url)) {
navigation_request->SetWaitingForRendererResponse();
frame_tree_node->current_frame_host()->DispatchBeforeUnload(
true, reload_type != ReloadType::NONE);
« no previous file with comments | « chrome/browser/ui/browser_browsertest.cc ('k') | content/browser/frame_host/render_frame_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698