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

Unified Diff: third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp

Issue 2830753004: Pipe the devTools FrameId from blink into the browser for headless (Closed)
Patch Set: Changes for dgozman@ 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
Index: third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
diff --git a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
index 2e2a503fdbf466bfff7842f56f5207405c426db9..37c56df31e5b5f9209ea812505400931cb997663 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
@@ -39,6 +39,7 @@
#include "core/dom/Document.h"
#include "core/frame/FrameView.h"
#include "core/frame/LocalFrame.h"
+#include "core/frame/LocalFrameClient.h"
#include "core/frame/Settings.h"
#include "core/frame/VisualViewport.h"
#include "core/html/HTMLFrameOwnerElement.h"
@@ -380,6 +381,11 @@ Response InspectorPageAgent::enable() {
enabled_ = true;
state_->setBoolean(PageAgentState::kPageAgentEnabled, true);
instrumenting_agents_->addInspectorPageAgent(this);
+
+ // Tell the browser the ids for all existing frames.
+ for (LocalFrame* frame : *inspected_frames_) {
+ frame->Client()->SetDevToolsFrameId(FrameId(frame));
+ }
return Response::OK();
}
@@ -674,9 +680,11 @@ void InspectorPageAgent::FrameAttachedToParent(LocalFrame* frame) {
parent_frame = 0;
std::unique_ptr<SourceLocation> location =
SourceLocation::CaptureWithFullStackTrace();
+ String frame_id = FrameId(frame);
GetFrontend()->frameAttached(
- FrameId(frame), FrameId(ToLocalFrame(parent_frame)),
+ frame_id, FrameId(ToLocalFrame(parent_frame)),
location ? location->BuildInspectorObject() : nullptr);
+ frame->Client()->SetDevToolsFrameId(frame_id);
}
void InspectorPageAgent::FrameDetachedFromParent(LocalFrame* frame) {

Powered by Google App Engine
This is Rietveld 408576698