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

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

Issue 2373273002: Run unload handlers when navigating to about:blank using PlzNavigate. (Closed)
Patch Set: review comments Created 4 years, 3 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..35c32eccea5c802fd3484ec2565281ddf9c24667 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)) {
Charlie Reis 2016/09/30 22:54:42 Interesting. This is somewhat independent of the
jam 2016/09/30 23:07:50 yeah I looked for other usages of javascript schem
// 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
@@ -1033,12 +1034,12 @@ void NavigatorImpl::RequestNavigation(FrameTreeNode* frame_tree_node,
is_history_navigation_in_new_child, navigation_start, controller_);
NavigationRequest* navigation_request = scoped_request.get();
- // Navigation to a javascript URL is not a "real" navigation so there is no
+ // Navigation to a debug URLs is not a "real" navigation so there is no
Charlie Reis 2016/09/30 22:54:42 nit: debug URL
jam 2016/09/30 23:07:50 Done.
// need to create a NavigationHandle. The navigation commits immediately and
// the NavigationRequest is not assigned to the FrameTreeNode as navigating to
- // a Javascript URL should not interrupt a previous navigation.
+ // a debug URL should not interrupt a previous navigation.
// Note: The scoped_request will be destroyed at the end of this function.
- if (dest_url.SchemeIs(url::kJavaScriptScheme)) {
+ if (IsRendererDebugURL(dest_url)) {
RenderFrameHostImpl* render_frame_host =
frame_tree_node->render_manager()->GetFrameHostForNavigation(
*navigation_request);
@@ -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) {
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