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

Unified Diff: content/browser/devtools/devtools_agent_host_impl.cc

Issue 2830753004: Pipe the devTools FrameId from blink into the browser for headless (Closed)
Patch Set: Rebased 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 | « no previous file | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..92e9aa079110f3b036bd5f802a90dd2ce6f04956 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 render_frame_host_impl->untrusted_devtools_frame_id();
+}
+
+// static
DevToolsAgentHost::List DevToolsAgentHost::GetOrCreateAll() {
List result;
SharedWorkerDevToolsAgentHost::List shared_list;
« no previous file with comments | « no previous file | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698