Commit 119dae49 authored by Chris Hamilton's avatar Chris Hamilton Committed by Commit Bot

[PM] Change IsSynchronousIFrameAttributionDataExpected.

Currently there are handful of crashes from Android devices where the
browser thinks that IFrameAttributionData should accompany an IPC, but
where the renderer isn't sending it.

The current browser code conflates two frames being in the same site
instance (and hence being LocalFrame parent-children) with two frames
being in the same process (it's possible for multiple distinct site
instances to fold into the same process).

BUG=1146223

Change-Id: Ic0af49bbc7dfab0a5c9af8df4d1c59dcd93f4580
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2522920
Commit-Queue: Chris Hamilton <chrisha@chromium.org>
Commit-Queue: Joe Mason <joenotcharles@chromium.org>
Reviewed-by: default avatarJoe Mason <joenotcharles@chromium.org>
Auto-Submit: Chris Hamilton <chrisha@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825017}
parent ddb531f7
...@@ -21,14 +21,21 @@ bool IsSynchronousIframeAttributionDataExpected( ...@@ -21,14 +21,21 @@ bool IsSynchronousIframeAttributionDataExpected(
const execution_context::ExecutionContext* ec) { const execution_context::ExecutionContext* ec) {
DCHECK(ec); DCHECK(ec);
auto* frame = ec->GetFrameNode(); auto* frame = ec->GetFrameNode();
// We only expect iframe data for frames...
if (!frame) if (!frame)
return false; return false;
// ... that aren't main frames (have a parent) ...
if (frame->IsMainFrame()) if (frame->IsMainFrame())
return false; return false;
// Iframe data is expected if this node is in the same process as its auto* parent = frame->GetParentFrameNode();
// parent. DCHECK(parent);
return frame->GetProcessNode() == // ... where the parent is hosted in the same process ...
frame->GetParentFrameNode()->GetProcessNode(); if (frame->GetProcessNode() != parent->GetProcessNode())
return false;
// ... and where they are both in the same site instance (implying they are
// both in the same frame-tree and know directly of each other's LocalFrame
// rather then communicating via a RemoteFrame and a RenderFrameProxy).
return frame->GetSiteInstanceId() == parent->GetSiteInstanceId();
} }
} // namespace } // namespace
......
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