Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: components/safe_browsing/renderer/threat_dom_details.cc

Issue 2837603002: Content API changes to improve DOM stitching in ThreatDetails code. (Closed)
Patch Set: Set output pointers correctly Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/safe_browsing/renderer/threat_dom_details.cc
diff --git a/components/safe_browsing/renderer/threat_dom_details.cc b/components/safe_browsing/renderer/threat_dom_details.cc
index b790b965ff24fe9d029aab9999e9d3a59483841c..47efb9d596c935dc5cb2ab35f69cb86f902b48c1 100644
--- a/components/safe_browsing/renderer/threat_dom_details.cc
+++ b/components/safe_browsing/renderer/threat_dom_details.cc
@@ -146,6 +146,16 @@ void HandleElement(
child_node.tag_name = element.TagName().Utf8();
child_node.parent = summary_node->url;
+ // The body of an iframe will be in a different renderer. Look up the
Charlie Reis 2017/05/05 21:03:08 s/will/may/
lpz 2017/05/10 14:21:09 Done.
+ // routing_id of that renderer and store it with the iframe node. If this
Charlie Reis 2017/05/05 21:03:07 nit: routing ID of the local or remote frame and
lpz 2017/05/10 14:21:09 Done.
+ // element is not a frame then the result of the lookup will be null.
+ blink::WebFrame* subwebframe =
+ blink::WebFrame::FromFrameOwnerElement(element);
+ if (subwebframe) {
+ child_node.other_frame_routing_id =
+ content::RenderFrame::GetRoutingIdForWebFrame(subwebframe);
+ }
+
// Populate the element's attributes, but only collect the ones that are
// configured in the finch study.
const auto& tag_attribute_iter = std::find_if(

Powered by Google App Engine
This is Rietveld 408576698