Chromium Code Reviews| Index: content/browser/devtools/render_frame_devtools_agent_host.cc |
| diff --git a/content/browser/devtools/render_frame_devtools_agent_host.cc b/content/browser/devtools/render_frame_devtools_agent_host.cc |
| index 6646dcdbf47c312cb9b59f53c6a4341c49b66388..46edcdec42bda32396174b2dc68d487e0536031d 100644 |
| --- a/content/browser/devtools/render_frame_devtools_agent_host.cc |
| +++ b/content/browser/devtools/render_frame_devtools_agent_host.cc |
| @@ -13,6 +13,7 @@ |
| #include "content/browser/child_process_security_policy_impl.h" |
| #include "content/browser/devtools/devtools_frame_trace_recorder.h" |
| #include "content/browser/devtools/devtools_protocol_handler.h" |
| +#include "content/browser/devtools/page_navigation_throttle.h" |
| #include "content/browser/devtools/protocol/browser_handler.h" |
| #include "content/browser/devtools/protocol/dom_handler.h" |
| #include "content/browser/devtools/protocol/emulation_handler.h" |
| @@ -345,6 +346,20 @@ void RenderFrameDevToolsAgentHost::OnBeforeNavigation( |
| agent_host->AboutToNavigate(navigation_handle); |
| } |
| +// static |
| +std::unique_ptr<NavigationThrottle> |
| +RenderFrameDevToolsAgentHost::GetThrottleForNavigation( |
| + NavigationHandle* navigation_handle) { |
| + FrameTreeNode* frame_tree_node = |
| + static_cast<NavigationHandleImpl*>(navigation_handle)->frame_tree_node(); |
| + RenderFrameDevToolsAgentHost* agent_host = FindAgentHost(frame_tree_node); |
|
dgozman
2016/07/07 19:25:58
Do you want to throttle navigations in subframes a
alex clarke (OOO till 29th)
2016/07/08 10:37:58
Yes we do :) Is it better to go via the WebConten
dgozman
2016/07/08 19:19:59
OOPIFs step in here: we should go up the tree to t
alex clarke (OOO till 29th)
2016/07/08 20:55:37
I'm not up to speed with these trees but it looks
|
| + if (agent_host) { |
| + return agent_host->page_handler_->GetThrottleForNavigation( |
| + navigation_handle); |
| + } |
| + return nullptr; |
| +} |
| + |
| RenderFrameDevToolsAgentHost::RenderFrameDevToolsAgentHost( |
| RenderFrameHostImpl* host) |
| : browser_handler_(new devtools::browser::BrowserHandler()), |