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

Side by Side Diff: content/browser/frame_host/render_frame_host_impl.cc

Issue 1374053002: Remove AboutToNavigateRenderFrame, issue custom notification for DevTools. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/frame_host/render_frame_host_impl.h" 5 #include "content/browser/frame_host/render_frame_host_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/containers/hash_tables.h" 9 #include "base/containers/hash_tables.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/process/kill.h" 12 #include "base/process/kill.h"
13 #include "base/time/time.h" 13 #include "base/time/time.h"
14 #include "content/browser/accessibility/accessibility_mode_helper.h" 14 #include "content/browser/accessibility/accessibility_mode_helper.h"
15 #include "content/browser/accessibility/ax_tree_id_registry.h" 15 #include "content/browser/accessibility/ax_tree_id_registry.h"
16 #include "content/browser/accessibility/browser_accessibility_manager.h" 16 #include "content/browser/accessibility/browser_accessibility_manager.h"
17 #include "content/browser/accessibility/browser_accessibility_state_impl.h" 17 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
18 #include "content/browser/bad_message.h" 18 #include "content/browser/bad_message.h"
19 #include "content/browser/child_process_security_policy_impl.h" 19 #include "content/browser/child_process_security_policy_impl.h"
20 #include "content/browser/devtools/render_frame_devtools_agent_host.h"
20 #include "content/browser/frame_host/cross_process_frame_connector.h" 21 #include "content/browser/frame_host/cross_process_frame_connector.h"
21 #include "content/browser/frame_host/cross_site_transferring_request.h" 22 #include "content/browser/frame_host/cross_site_transferring_request.h"
22 #include "content/browser/frame_host/frame_mojo_shell.h" 23 #include "content/browser/frame_host/frame_mojo_shell.h"
23 #include "content/browser/frame_host/frame_tree.h" 24 #include "content/browser/frame_host/frame_tree.h"
24 #include "content/browser/frame_host/frame_tree_node.h" 25 #include "content/browser/frame_host/frame_tree_node.h"
25 #include "content/browser/frame_host/navigation_handle_impl.h" 26 #include "content/browser/frame_host/navigation_handle_impl.h"
26 #include "content/browser/frame_host/navigation_request.h" 27 #include "content/browser/frame_host/navigation_request.h"
27 #include "content/browser/frame_host/navigator.h" 28 #include "content/browser/frame_host/navigator.h"
28 #include "content/browser/frame_host/navigator_impl.h" 29 #include "content/browser/frame_host/navigator_impl.h"
29 #include "content/browser/frame_host/render_frame_host_delegate.h" 30 #include "content/browser/frame_host/render_frame_host_delegate.h"
(...skipping 1667 matching lines...) Expand 10 before | Expand all | Expand 10 after
1697 // second navigation occurs, RenderFrameHostManager will cancel this pending 1698 // second navigation occurs, RenderFrameHostManager will cancel this pending
1698 // RFH and create a new pending RFH. 1699 // RFH and create a new pending RFH.
1699 DCHECK(!suspended_nav_params_.get()); 1700 DCHECK(!suspended_nav_params_.get());
1700 suspended_nav_params_.reset( 1701 suspended_nav_params_.reset(
1701 new NavigationParams(common_params, start_params, request_params)); 1702 new NavigationParams(common_params, start_params, request_params));
1702 } else { 1703 } else {
1703 // Get back to a clean state, in case we start a new navigation without 1704 // Get back to a clean state, in case we start a new navigation without
1704 // completing a RFH swap or unload handler. 1705 // completing a RFH swap or unload handler.
1705 SetState(RenderFrameHostImpl::STATE_DEFAULT); 1706 SetState(RenderFrameHostImpl::STATE_DEFAULT);
1706 1707
1708 RenderFrameDevToolsAgentHost::OnBeforeNavigation(
1709 frame_tree_node_->current_frame_host(), this);
1707 Send(new FrameMsg_Navigate(routing_id_, common_params, start_params, 1710 Send(new FrameMsg_Navigate(routing_id_, common_params, start_params,
yurys 2015/09/28 23:37:30 Let's extract this into a method to avoid FrameMsg
dgozman 2015/10/01 20:15:26 Done.
1708 request_params)); 1711 request_params));
1709 } 1712 }
1710 1713
1711 // Force the throbber to start. This is done because Blink's "started loading" 1714 // Force the throbber to start. This is done because Blink's "started loading"
1712 // message will be received asynchronously from the UI of the browser. But the 1715 // message will be received asynchronously from the UI of the browser. But the
1713 // throbber needs to be kept in sync with what's happening in the UI. For 1716 // throbber needs to be kept in sync with what's happening in the UI. For
1714 // example, the throbber will start immediately when the user navigates even 1717 // example, the throbber will start immediately when the user navigates even
1715 // if the renderer is delayed. There is also an issue with the throbber 1718 // if the renderer is delayed. There is also an issue with the throbber
1716 // starting because the WebUI (which controls whether the favicon is 1719 // starting because the WebUI (which controls whether the favicon is
1717 // displayed) happens synchronously. If the start loading messages was 1720 // displayed) happens synchronously. If the start loading messages was
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
2101 2104
2102 if (!suspend && suspended_nav_params_) { 2105 if (!suspend && suspended_nav_params_) {
2103 // There's navigation message params waiting to be sent. Now that we're not 2106 // There's navigation message params waiting to be sent. Now that we're not
2104 // suspended anymore, resume navigation by sending them. If we were swapped 2107 // suspended anymore, resume navigation by sending them. If we were swapped
2105 // out, we should also stop filtering out the IPC messages now. 2108 // out, we should also stop filtering out the IPC messages now.
2106 SetState(RenderFrameHostImpl::STATE_DEFAULT); 2109 SetState(RenderFrameHostImpl::STATE_DEFAULT);
2107 2110
2108 DCHECK(!proceed_time.is_null()); 2111 DCHECK(!proceed_time.is_null());
2109 suspended_nav_params_->request_params.browser_navigation_start = 2112 suspended_nav_params_->request_params.browser_navigation_start =
2110 proceed_time; 2113 proceed_time;
2114 RenderFrameDevToolsAgentHost::OnBeforeNavigation(
2115 frame_tree_node_->current_frame_host(), this);
2111 Send(new FrameMsg_Navigate(routing_id_, 2116 Send(new FrameMsg_Navigate(routing_id_,
2112 suspended_nav_params_->common_params, 2117 suspended_nav_params_->common_params,
2113 suspended_nav_params_->start_params, 2118 suspended_nav_params_->start_params,
2114 suspended_nav_params_->request_params)); 2119 suspended_nav_params_->request_params));
2115 suspended_nav_params_.reset(); 2120 suspended_nav_params_.reset();
2116 } 2121 }
2117 } 2122 }
2118 2123
2119 void RenderFrameHostImpl::CancelSuspendedNavigations() { 2124 void RenderFrameHostImpl::CancelSuspendedNavigations() {
2120 // Clear any state if a pending navigation is canceled or preempted. 2125 // Clear any state if a pending navigation is canceled or preempted.
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
2246 BrowserPluginInstanceIDToAXTreeID(value))); 2251 BrowserPluginInstanceIDToAXTreeID(value)));
2247 break; 2252 break;
2248 case AX_CONTENT_INT_ATTRIBUTE_LAST: 2253 case AX_CONTENT_INT_ATTRIBUTE_LAST:
2249 NOTREACHED(); 2254 NOTREACHED();
2250 break; 2255 break;
2251 } 2256 }
2252 } 2257 }
2253 } 2258 }
2254 2259
2255 } // namespace content 2260 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/navigator_impl.cc ('k') | content/browser/web_contents/web_contents_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698