Commit 439dcf06 authored by Dmitry Gozman's avatar Dmitry Gozman Committed by Commit Bot

[DevTools] Prevent crash when auto-attaching with flatten to frames

We are not ready for flatten in frames - the TargetRegistry is null.

Bug: 890760
Change-Id: I8bbffad4f74ffa12f371ce7feef32cae3d6f6304
Reviewed-on: https://chromium-review.googlesource.com/1255122Reviewed-by: default avatarPavel Feldman <pfeldman@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595516}
parent dd17147b
......@@ -549,6 +549,10 @@ Response TargetHandler::SetDiscoverTargets(bool discover) {
Response TargetHandler::SetAutoAttach(bool auto_attach,
bool wait_for_debugger_on_start,
Maybe<bool> flatten) {
if (flatten.fromMaybe(false) && !target_registry_) {
return Response::InvalidParams(
"Will only provide flatten access for browser endpoint");
}
flatten_auto_attach_ = flatten.fromMaybe(false);
auto_attacher_.SetAutoAttach(auto_attach, wait_for_debugger_on_start);
if (!auto_attacher_.ShouldThrottleFramesNavigation())
......
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