Update to Chromium version 122.0.6261.0 (#1250580)

Frame identifiers have changed from int64_t to string type. This is due
to https://crbug.com/1502660 which removes access to frame routing IDs
in the renderer process. New cross-process frame identifiers are 160-bit
values (32-bit child process ID + 128-bit local frame token) and most
easily represented as strings. All other frame-related expectations and
behaviors remain the same.
This commit is contained in:
Marshall Greenblatt
2024-01-25 21:12:43 -05:00
parent 2a86a02bdd
commit 2f1e782f62
156 changed files with 1452 additions and 1436 deletions

View File

@ -15,13 +15,12 @@
namespace render_frame_util {
int64_t GetIdentifier(blink::WebLocalFrame* frame) {
std::string GetIdentifier(blink::WebLocalFrame* frame) {
// Each WebFrame will have an associated RenderFrame. The RenderFrame
// routing IDs are unique within a given renderer process.
content::RenderFrame* render_frame =
content::RenderFrame::FromWebFrame(frame);
return frame_util::MakeFrameId(content::RenderThread::Get()->GetClientId(),
render_frame->GetRoutingID());
return frame_util::MakeFrameIdentifier(content::GlobalRenderFrameHostToken(
content::RenderThread::Get()->GetClientId(),
frame->GetLocalFrameToken()));
}
std::string GetName(blink::WebLocalFrame* frame) {
@ -42,4 +41,14 @@ std::string GetName(blink::WebLocalFrame* frame) {
return std::string();
}
std::optional<blink::LocalFrameToken> ParseFrameTokenFromIdentifier(
const std::string& identifier) {
const auto& global_token = frame_util::ParseFrameIdentifier(identifier);
if (!global_token ||
global_token->child_id != content::RenderThread::Get()->GetClientId()) {
return std::nullopt;
}
return global_token->frame_token;
}
} // namespace render_frame_util