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 a22158bbfd509b7e5500cdf0b570b68ae76ca881..3307123c0c594ba4508845ffbca22c22ce1cd9b0 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,25 @@ void RenderFrameDevToolsAgentHost::OnBeforeNavigation( |
agent_host->AboutToNavigate(navigation_handle); |
} |
+// static |
+std::unique_ptr<NavigationThrottle> |
+RenderFrameDevToolsAgentHost::GetThrottleForNavigation( |
+ NavigationHandle* navigation_handle) { |
+ // NOTE a single throttle registered by Page.setControlNavigations is intended |
nasko
2016/07/13 22:37:34
This comment is not entirely correct. Each navigat
alex clarke (OOO till 29th)
2016/07/14 16:06:05
Acknowledged.
|
+ // to control navigations in the main frame and all child frames. |
+ FrameTreeNode* frame_tree_node = |
+ static_cast<NavigationHandleImpl*>(navigation_handle)->frame_tree_node(); |
+ while (frame_tree_node && frame_tree_node->parent()) { |
+ frame_tree_node = frame_tree_node->parent(); |
+ } |
+ RenderFrameDevToolsAgentHost* agent_host = FindAgentHost(frame_tree_node); |
+ if (agent_host && agent_host->page_handler_) { |
nasko
2016/07/13 22:37:34
After offline chat with dgozman@, it became more c
alex clarke (OOO till 29th)
2016/07/14 16:06:05
Done.
|
+ return agent_host->page_handler_->GetThrottleForNavigation( |
+ navigation_handle); |
+ } |
+ return nullptr; |
+} |
+ |
RenderFrameDevToolsAgentHost::RenderFrameDevToolsAgentHost( |
RenderFrameHostImpl* host) |
: browser_handler_(new devtools::browser::BrowserHandler()), |