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..3394daa7dfbfc215c1a36c3e8aa730329e9d35fe 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) { |
|
Charlie Reis
2017/04/26 19:52:55
Thanks-- I appreciate this check.
alex clarke (OOO till 29th)
2017/04/27 08:49:43
Acknowledged.
|
| + return ""; |
| + } |
| + return frame_tree_node->current_frame_host()->devtools_frame_id(); |
| +} |
| + |
| +// static |
| DevToolsAgentHost::List DevToolsAgentHost::GetOrCreateAll() { |
| List result; |
| SharedWorkerDevToolsAgentHost::List shared_list; |