Chromium Code Reviews| 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); |