Commit b37cae90 authored by Dmitry Gozman's avatar Dmitry Gozman Committed by Commit Bot

[DevTools] Remove Target.setAttachToFrames

Attaching by default now.

Bug: none
Change-Id: I76a440a99d194ad64f77e8b39b541ed0836b351d
Reviewed-on: https://chromium-review.googlesource.com/894184
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Reviewed-by: default avatarPavel Feldman <pfeldman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533100}
parent 617b62a8
......@@ -92,8 +92,7 @@ TargetAutoAttacher::TargetAutoAttacher(AttachCallback attach_callback,
detach_callback_(detach_callback),
render_frame_host_(nullptr),
auto_attach_(false),
wait_for_debugger_on_start_(false),
attach_to_frames_(false) {}
wait_for_debugger_on_start_(false) {}
TargetAutoAttacher::~TargetAutoAttacher() {}
......@@ -109,7 +108,7 @@ void TargetAutoAttacher::UpdateServiceWorkers() {
}
void TargetAutoAttacher::UpdateFrames() {
if (!auto_attach_ || !attach_to_frames_)
if (!auto_attach_)
return;
Hosts new_hosts;
......@@ -141,7 +140,7 @@ void TargetAutoAttacher::AgentHostClosed(DevToolsAgentHost* host) {
}
bool TargetAutoAttacher::ShouldThrottleFramesNavigation() {
return auto_attach_ && attach_to_frames_;
return auto_attach_;
}
DevToolsAgentHost* TargetAutoAttacher::AutoAttachToFrame(
......@@ -244,18 +243,6 @@ void TargetAutoAttacher::SetAutoAttach(bool auto_attach,
}
}
void TargetAutoAttacher::SetAttachToFrames(bool attach_to_frames) {
if (attach_to_frames_ == attach_to_frames)
return;
attach_to_frames_ = attach_to_frames;
if (attach_to_frames_) {
UpdateFrames();
} else {
Hosts empty;
ReattachTargetsOfType(empty, DevToolsAgentHost::kTypeFrame, false);
}
}
// -------- ServiceWorkerDevToolsManager::Observer ----------
void TargetAutoAttacher::WorkerCreated(ServiceWorkerDevToolsAgentHost* host,
......
......@@ -28,7 +28,6 @@ class TargetAutoAttacher : public ServiceWorkerDevToolsManager::Observer {
void SetRenderFrameHost(RenderFrameHostImpl* host);
void SetAutoAttach(bool auto_attach, bool wait_for_debugger_on_start);
void SetAttachToFrames(bool attach_to_frames);
void UpdateServiceWorkers();
void AgentHostClosed(DevToolsAgentHost* host);
......@@ -60,7 +59,6 @@ class TargetAutoAttacher : public ServiceWorkerDevToolsManager::Observer {
bool auto_attach_;
bool wait_for_debugger_on_start_;
bool attach_to_frames_;
bool auto_attaching_service_workers_ = false;
Hosts auto_attached_hosts_;
......
......@@ -314,13 +314,6 @@ Response TargetHandler::SetAutoAttach(
return browser_only_ ? Response::OK() : Response::FallThrough();
}
Response TargetHandler::SetAttachToFrames(bool value) {
auto_attacher_.SetAttachToFrames(value);
if (!auto_attacher_.ShouldThrottleFramesNavigation())
ClearThrottles();
return Response::OK();
}
Response TargetHandler::SetRemoteLocations(
std::unique_ptr<protocol::Array<Target::RemoteLocation>>) {
return Response::Error("Not supported");
......
......@@ -47,7 +47,6 @@ class TargetHandler : public DevToolsDomainHandler,
Response SetDiscoverTargets(bool discover) override;
Response SetAutoAttach(bool auto_attach,
bool wait_for_debugger_on_start) override;
Response SetAttachToFrames(bool value) override;
Response SetRemoteLocations(
std::unique_ptr<protocol::Array<Target::RemoteLocation>>) override;
Response AttachToTarget(const std::string& target_id,
......
......@@ -6,8 +6,7 @@
await dp.Page.onceLoadEventFired();
testRunner.log('Enabling auto-discovery...');
await dp.Target.setAutoAttach({autoAttach: true, waitForDebuggerOnStart: false});
dp.Target.setAttachToFrames({value: true});
dp.Target.setAutoAttach({autoAttach: true, waitForDebuggerOnStart: false});
let attachedEvent = (await dp.Target.onceAttachedToTarget()).params;
testRunner.log('Got auto-attached.');
......
......@@ -3,7 +3,6 @@
`Tests that waitForDebuggerOnStart works with out-of-process iframes.`);
await dp.Target.setAutoAttach({autoAttach: true, waitForDebuggerOnStart: true});
await dp.Target.setAttachToFrames({value: true});
await dp.Page.enable();
dp.Network.enable();
......
......@@ -94,10 +94,6 @@ Response InspectorWorkerAgent::setAutoAttach(bool auto_attach,
return Response::OK();
}
Response InspectorWorkerAgent::setAttachToFrames(bool attach) {
return Response::OK();
}
bool InspectorWorkerAgent::AutoAttachEnabled() {
return state_->booleanProperty(WorkerAgentState::kAutoAttach, false);
}
......
......@@ -63,7 +63,6 @@ class CORE_EXPORT InspectorWorkerAgent final
// Called from Dispatcher
protocol::Response setAutoAttach(bool auto_attach,
bool wait_for_debugger_on_start) override;
protocol::Response setAttachToFrames(bool attach) override;
protocol::Response sendMessageToTarget(
const String& message,
protocol::Maybe<String> session_id,
......
......@@ -11919,17 +11919,6 @@
}
]
},
{
"name": "setAttachToFrames",
"experimental": true,
"parameters": [
{
"name": "value",
"description": "Whether to attach to frames.",
"type": "boolean"
}
]
},
{
"name": "setAutoAttach",
"description": "Controls whether to automatically attach to new targets which are considered to be related to\nthis one. When turned on, attaches to all existing related targets as well. When turned off,\nautomatically detaches from all currently attached targets.",
......
......@@ -5459,11 +5459,6 @@ domain Target
# Deprecated.
deprecated optional TargetID targetId
experimental command setAttachToFrames
parameters
# Whether to attach to frames.
boolean value
# Controls whether to automatically attach to new targets which are considered to be related to
# this one. When turned on, attaches to all existing related targets as well. When turned off,
# automatically detaches from all currently attached targets.
......
......@@ -101,7 +101,7 @@
},
{
"domain": "Target",
"include": ["setAutoAttach", "sendMessageToTarget", "setAttachToFrames"],
"include": ["setAutoAttach", "sendMessageToTarget"],
"include_events": ["attachedToTarget", "detachedFromTarget", "receivedMessageFromTarget"]
}
]
......
......@@ -405,8 +405,6 @@ SDK.ChildTargetManager = class {
parentTarget.registerTargetDispatcher(this);
this._targetAgent.invoke_setAutoAttach({autoAttach: true, waitForDebuggerOnStart: true});
// TODO(dgozman): remove the protocol method and make it default.
this._targetAgent.setAttachToFrames(true);
if (!parentTarget.parentTarget()) {
this._targetAgent.setDiscoverTargets(true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment