[DevTools] Add 'openerFrameId' to targetInfo

We want to show which frame caused the opening of an additional window
in the DevTools frontend.

We cannot really use FrameTreeNode's 'opener', since this is reset if
the opened window itself does not have access to its opener ('noopener'
or COOP). We cannot use 'original_opener' either, because it tracks
main frames only. Therefore a new field 'opener_frame_id' is
introduced.

This is a follow-up to https://crrev.com/c/2309698

Bug: chromium:1107766

Change-Id: Idf24776a234ec029736bb74920d80c8da3c4c98a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2340976
Reviewed-by: Camille Lamy <[email protected]>
Reviewed-by: Sigurd Schneider <[email protected]>
Reviewed-by: Andrey Kosyakov <[email protected]>
Commit-Queue: Wolfgang Beyer <[email protected]>
Cr-Commit-Position: refs/heads/master@{#812093}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index fb9bdd76..8b8ac82 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -8839,6 +8839,7 @@
     // by spawning from a subframe and deleting the subframe.
     // https://crbug.com/705316
     new_root->SetOriginalOpener(opener->frame_tree()->root());
+    new_root->SetOpenerDevtoolsFrameToken(opener->devtools_frame_token());
 
     if (!opener_suppressed) {
       new_root->SetOpener(opener);