Chromium Code Reviews| Index: content/browser/devtools/devtools_agent_host_impl.cc |
| diff --git a/content/browser/devtools/devtools_agent_host_impl.cc b/content/browser/devtools/devtools_agent_host_impl.cc |
| index a036c4c614c6b45e42d75fe5ab43feb7c1d980f3..e35d468ada25d1305154fb54d5b322d6653d99bf 100644 |
| --- a/content/browser/devtools/devtools_agent_host_impl.cc |
| +++ b/content/browser/devtools/devtools_agent_host_impl.cc |
| @@ -21,7 +21,9 @@ |
| #include "content/browser/devtools/service_worker_devtools_manager.h" |
| #include "content/browser/devtools/shared_worker_devtools_agent_host.h" |
| #include "content/browser/devtools/shared_worker_devtools_manager.h" |
| +#include "content/browser/frame_host/frame_tree_node.h" |
| #include "content/browser/loader/netlog_observer.h" |
| +#include "content/browser/renderer_host/render_view_host_impl.h" |
| #include "content/public/browser/browser_thread.h" |
| #include "content/public/browser/content_browser_client.h" |
| @@ -58,6 +60,24 @@ bool DevToolsAgentHost::IsSupportedProtocolVersion(const std::string& version) { |
| } |
| // static |
| +std::string DevToolsAgentHost::GetUntrustedDevToolsFrameIdForFrameTreeNodeId( |
| + int process_id, |
| + int frame_tree_node_id) { |
| + FrameTreeNode* frame_tree_node = |
| + FrameTreeNode::GloballyFindByID(frame_tree_node_id); |
| + if (!frame_tree_node) |
| + return ""; |
| + // Make sure |process_id| hasn't changed. |
| + RenderFrameHostImpl* render_frame_host_impl = |
| + frame_tree_node->current_frame_host(); |
| + if (!render_frame_host_impl || |
| + render_frame_host_impl->GetProcess()->GetID() != process_id) { |
| + return ""; |
| + } |
| + return frame_tree_node->current_frame_host()->untrusted_devtools_frame_id(); |
|
dgozman
2017/04/27 17:12:06
nit: use |render_frame_host_impl|.
alex clarke (OOO till 29th)
2017/04/28 09:14:44
Done.
|
| +} |
| + |
| +// static |
| DevToolsAgentHost::List DevToolsAgentHost::GetOrCreateAll() { |
| List result; |
| SharedWorkerDevToolsAgentHost::List shared_list; |