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

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: 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
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 4437ee335deeecbd5e3a7e45dcefb2f9494a7291..e43f9c7389194a7b613c350553ddde8e307738b5 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
@@ -38,6 +38,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,8 +680,10 @@ void InspectorPageAgent::FrameAttachedToParent(LocalFrame* frame) {
parent_frame = 0;
std::unique_ptr<SourceLocation> location =
SourceLocation::CaptureWithFullStackTrace();
+ String frame_id = FrameId(frame);
+ frame->Client()->SetDevToolsFrameId(frame_id);
GetFrontend()->frameAttached(
- FrameId(frame), FrameId(ToLocalFrame(parent_frame)),
+ frame_id, FrameId(ToLocalFrame(parent_frame)),
location ? location->BuildInspectorObject() : nullptr);
}
« no previous file with comments | « third_party/WebKit/Source/core/frame/LocalFrameClient.h ('k') | third_party/WebKit/Source/web/LocalFrameClientImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698