Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1196)

Unified Diff: headless/lib/browser/headless_web_contents_impl.cc

Issue 2830753004: Pipe the devTools FrameId from blink into the browser for headless (Closed)
Patch Set: Changes for creis@ Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « headless/lib/browser/headless_web_contents_impl.h ('k') | headless/lib/frame_id_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « headless/lib/browser/headless_web_contents_impl.h ('k') | headless/lib/frame_id_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698