Index: extensions/renderer/extension_frame_helper.cc |
diff --git a/extensions/renderer/extension_frame_helper.cc b/extensions/renderer/extension_frame_helper.cc |
index 6a91e015b28e65a673f9ba84220d35c67f76394c..2856ef30c6e95092a83a5da34093e5dbfd90acc3 100644 |
--- a/extensions/renderer/extension_frame_helper.cc |
+++ b/extensions/renderer/extension_frame_helper.cc |
@@ -4,6 +4,8 @@ |
#include "extensions/renderer/extension_frame_helper.h" |
+#include <set> |
+ |
#include "base/metrics/histogram_macros.h" |
#include "base/strings/string_util.h" |
#include "base/timer/elapsed_timer.h" |
@@ -157,12 +159,27 @@ content::RenderFrame* ExtensionFrameHelper::FindFrame( |
// Try to match all same-origin frames in this process. |
for (const ExtensionFrameHelper* helper : g_frame_helpers.Get()) { |
+ if (helper->render_frame()->GetWebFrame()->AssignedName().Utf8() != name) |
+ continue; |
+ |
if (!relative_to_frame->GetWebFrame()->GetSecurityOrigin().CanAccess( |
helper->render_frame()->GetWebFrame()->GetSecurityOrigin())) |
continue; |
- if (helper->render_frame()->GetWebFrame()->AssignedName().Utf8() == name) |
- return helper->render_frame(); |
+ UMA_HISTOGRAM_ENUMERATION( |
+ "Extensions.BrowsingInstanceViolation.ExtensionViewType", |
+ helper->view_type(), VIEW_TYPE_LAST); |
+ GURL effective_target_url = ScriptContext::GetEffectiveDocumentURL( |
+ helper->render_frame()->GetWebFrame(), |
+ helper->render_frame()->GetWebFrame()->GetDocument().Url(), true); |
+ const Extension* target_extension = |
+ extensions::RendererExtensionRegistry::Get()->GetExtensionOrAppByURL( |
+ effective_target_url); |
+ UMA_HISTOGRAM_ENUMERATION( |
+ "Extensions.BrowsingInstanceViolation.ExtensionType", |
+ target_extension->GetType(), Manifest::TYPE_MAX); |
+ |
+ return helper->render_frame(); |
} |
return nullptr; |