diff --git a/components/permissions/permission_manager.cc b/components/permissions/permission_manager.cc index c6b14327e9255..db343124f2b6d 100644 --- a/components/permissions/permission_manager.cc +++ b/components/permissions/permission_manager.cc @@ -605,6 +605,17 @@ content::PermissionResult PermissionManager::GetPermissionStatusInternal( GURL canonical_requesting_origin = PermissionUtil::GetCanonicalOrigin( content_settings_type, requesting_origin, embedding_origin); + // ==================== POC INSTRUMENTATION ==================== + if (render_frame_host) { + LOG(ERROR) << "[POC] GetPermissionStatusInternal: " + << "rfh_origin=" + << render_frame_host->GetLastCommittedOrigin().GetDebugString() + << " requesting_origin=" << requesting_origin.spec() + << " embedding_origin=" << embedding_origin.spec() + << " canonical_requesting_origin=" + << canonical_requesting_origin.spec(); + } + // ============================================================= content::PermissionResult result = context->GetPermissionStatus( permission_descriptor, render_frame_host, canonical_requesting_origin.DeprecatedGetOriginAsURL(), diff --git a/components/permissions/permission_util.cc b/components/permissions/permission_util.cc index 2f6fbe5270245..3c447580aa61f 100644 --- a/components/permissions/permission_util.cc +++ b/components/permissions/permission_util.cc @@ -459,8 +459,22 @@ GURL PermissionUtil::GetLastCommittedOriginAsURL( } #endif + // ==================== POC INSTRUMENTATION ==================== + url::Origin lco = render_frame_host->GetLastCommittedOrigin(); + LOG(ERROR) << "[POC] GetLastCommittedOriginAsURL called:" + << " origin=" << lco.GetDebugString() + << " opaque=" << lco.opaque() + << " GetURL()=" << lco.GetURL().spec() + << " visible_url=" << web_contents->GetVisibleURL().spec(); + // ============================================================= if (render_frame_host->GetLastCommittedOrigin().GetURL().is_empty()) { if (!web_contents->GetVisibleURL().is_empty()) { + // ==================== POC INSTRUMENTATION ==================== + LOG(ERROR) << "[POC] *** FALLBACK FIRED *** " + << "Opaque/empty origin substituted with VisibleURL: " + << web_contents->GetVisibleURL().spec() + << " (origin was opaque=" << lco.opaque() << ")"; + // ============================================================= return web_contents->GetVisibleURL(); } }