Commit 08beed78 authored by Pavel Feldman's avatar Pavel Feldman Committed by Commit Bot

DevTools: assign devtools_main_frame_token for a newly created render view...

DevTools: assign devtools_main_frame_token for a newly created render view host in response to CreateNewWindow request.

This is a follow up to r507878, it fixes one missing render frame creation code path.

Bug: 715541
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I411b1ab93994e8722141bc8f747d0b8ec41d2409
Reviewed-on: https://chromium-review.googlesource.com/721891Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Commit-Queue: Pavel Feldman <pfeldman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509477}
parent fcf46dc9
......@@ -2907,6 +2907,10 @@ void RenderFrameHostImpl::RunCreateWindowCompleteCallback(
reply->main_frame_widget_route_id = main_frame_widget_route_id;
reply->cloned_session_storage_namespace_id =
cloned_session_storage_namespace_id;
RenderFrameHost* rfh =
RenderFrameHost::FromID(GetProcess()->GetID(), main_frame_route_id);
reply->devtools_main_frame_token =
rfh ? rfh->GetDevToolsFrameToken() : base::UnguessableToken::Create();
std::move(callback).Run(std::move(reply));
}
......
......@@ -5,6 +5,7 @@
module content.mojom;
import "content/public/common/window_container_type.mojom";
import "mojo/common/unguessable_token.mojom";
import "services/service_manager/public/interfaces/interface_provider.mojom";
import "third_party/WebKit/public/platform/referrer.mojom";
import "third_party/WebKit/public/web/window_features.mojom";
......@@ -90,6 +91,14 @@ struct CreateNewWindowReply {
// Duplicated from CreateNewWindowParams because legacy code.
int64 cloned_session_storage_namespace_id;
// Used for devtools instrumentation and trace-ability. The token is
// propagated to Blink's LocalFrame and both Blink and content/
// can tag calls and requests with this instrumentation token in order to
// attribute them to the context frame.
// |devtools_frame_token| is only defined by the browser and is never
// sent back from the renderer in the control calls.
mojo.common.mojom.UnguessableToken devtools_main_frame_token;
};
// An opaque handle that keeps alive the associated render process even after
......
......@@ -1400,6 +1400,7 @@ WebView* RenderViewImpl::CreateView(WebLocalFrame* creator,
view_params.swapped_out = false;
view_params.replicated_frame_state.frame_policy.sandbox_flags = sandbox_flags;
view_params.replicated_frame_state.name = frame_name_utf8;
view_params.devtools_main_frame_token = reply->devtools_main_frame_token;
// Even if the main frame has a name, the main frame's unique name is always
// the empty string.
view_params.hidden = is_background_tab;
......
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