Chromium Code Reviews| Index: headless/lib/browser/headless_web_contents_impl.cc |
| diff --git a/headless/lib/browser/headless_web_contents_impl.cc b/headless/lib/browser/headless_web_contents_impl.cc |
| index 07492082253fda0adb7a0c103042b449294941c1..55aa7667eb33bbb7929f574e3fca59b3352aef2f 100644 |
| --- a/headless/lib/browser/headless_web_contents_impl.cc |
| +++ b/headless/lib/browser/headless_web_contents_impl.cc |
| @@ -216,6 +216,10 @@ void HeadlessWebContentsImpl::RenderFrameCreated( |
| browser()->BrowserMainThread()); |
| } |
| + browser_context_->SetFrameTreeNodeId(render_frame_host->GetProcess()->GetID(), |
| + render_frame_host->GetRoutingID(), |
| + render_frame_host->GetFrameTreeNodeId()); |
| + |
| std::string devtools_agent_host_id = |
| content::DevToolsAgentHost::GetOrCreateFor(render_frame_host)->GetId(); |
| render_frame_host_to_devtools_agent_host_id_[render_frame_host] = |
| @@ -226,6 +230,10 @@ void HeadlessWebContentsImpl::RenderFrameCreated( |
| void HeadlessWebContentsImpl::RenderFrameDeleted( |
| content::RenderFrameHost* render_frame_host) { |
| + browser_context_->RemoveFrameTreeNode( |
| + render_frame_host->GetProcess()->GetID(), |
| + render_frame_host->GetRoutingID()); |
| + |
| auto find_it = |
| render_frame_host_to_devtools_agent_host_id_.find(render_frame_host); |
| if (find_it == render_frame_host_to_devtools_agent_host_id_.end()) |
| @@ -246,6 +254,19 @@ bool HeadlessWebContentsImpl::GetFrameTreeNodeIdForDevToolsAgentHostId( |
| return true; |
| } |
| +std::string |
| +HeadlessWebContentsImpl::GetUntrustedDevToolsFrameIdForFrameTreeNodeId( |
| + int process_id, |
| + int frame_tree_node_id) const { |
| + return content::DevToolsAgentHost:: |
| + GetUntrustedDevToolsFrameIdForFrameTreeNodeId(process_id, |
| + frame_tree_node_id); |
| +} |
| + |
| +int HeadlessWebContentsImpl::GetMainFrameRenderProcessId() const { |
| + return web_contents()->GetRenderProcessHost()->GetID(); |
|
Charlie Reis
2017/04/27 18:58:02
Can you update this to web_contents()->GetMainFram
alex clarke (OOO till 29th)
2017/04/28 09:14:44
Done.
|
| +} |
| + |
| bool HeadlessWebContentsImpl::OpenURL(const GURL& url) { |
| if (!url.is_valid()) |
| return false; |