Chromium Code Reviews| Index: content/browser/frame_host/navigation_handle_impl.cc |
| diff --git a/content/browser/frame_host/navigation_handle_impl.cc b/content/browser/frame_host/navigation_handle_impl.cc |
| index d7dcbefabbf2f06121040f756c61a2c45587d524..75362728f5a869d53ac1146337e0c7527fe6d85b 100644 |
| --- a/content/browser/frame_host/navigation_handle_impl.cc |
| +++ b/content/browser/frame_host/navigation_handle_impl.cc |
| @@ -7,6 +7,7 @@ |
| #include <utility> |
| #include "base/logging.h" |
| +#include "content/browser/devtools/render_frame_devtools_agent_host.h" |
| #include "content/browser/frame_host/frame_tree_node.h" |
| #include "content/browser/frame_host/navigator.h" |
| #include "content/browser/frame_host/navigator_delegate.h" |
| @@ -323,6 +324,17 @@ void NavigationHandleImpl::WillStartRequest( |
| state_ = WILL_SEND_REQUEST; |
| complete_callback_ = callback; |
| + RegisterNavigationThrottles(); |
| + |
| + // Notify each throttle of the request. |
| + NavigationThrottle::ThrottleCheckResult result = CheckWillStartRequest(); |
| + |
| + // If the navigation is not deferred, run the callback. |
| + if (result != NavigationThrottle::DEFER) |
| + RunCompleteCallback(result); |
| +} |
| + |
| +void NavigationHandleImpl::RegisterNavigationThrottles() { |
|
clamy
2016/07/11 14:20:36
Please ensure that the order of the functions in t
alex clarke (OOO till 29th)
2016/07/11 21:21:12
Done.
|
| // Register the navigation throttles. The ScopedVector returned by |
| // GetNavigationThrottles is not assigned to throttles_ directly because it |
| // would overwrite any throttle previously added with |
| @@ -334,13 +346,10 @@ void NavigationHandleImpl::WillStartRequest( |
| throttles_to_register.end()); |
| throttles_to_register.weak_clear(); |
| } |
| - |
| - // Notify each throttle of the request. |
| - NavigationThrottle::ThrottleCheckResult result = CheckWillStartRequest(); |
| - |
| - // If the navigation is not deferred, run the callback. |
| - if (result != NavigationThrottle::DEFER) |
| - RunCompleteCallback(result); |
| + std::unique_ptr<NavigationThrottle> devtools_throttle = |
|
clamy
2016/07/11 14:20:36
Sanity check: this will mean that the devtools thr
alex clarke (OOO till 29th)
2016/07/11 21:21:12
That is what I intended. My thoughts where we'd w
|
| + RenderFrameDevToolsAgentHost::GetThrottleForNavigation(this); |
| + if (devtools_throttle) |
| + throttles_.push_back(devtools_throttle.release()); |
| } |
| void NavigationHandleImpl::WillRedirectRequest( |