diff --git a/content/browser/geolocation/geolocation_service_impl.cc b/content/browser/geolocation/geolocation_service_impl.cc index 3d2e5b28dbcaa..1f6de890236b2 100644 --- a/content/browser/geolocation/geolocation_service_impl.cc +++ b/content/browser/geolocation/geolocation_service_impl.cc @@ -182,6 +182,12 @@ void GeolocationServiceImpl::CreateGeolocationWithPermissionResult( auto requesting_url = render_frame_host_->GetMainFrame()->GetLastCommittedURL(); + LOG(ERROR) << "[POC] CreateGeolocation: requesting_origin_=" + << requesting_origin_.Serialize() + << " requesting_url=" << requesting_url.spec() + << " (url same-origin with origin? " + << requesting_origin_.IsSameOriginWith(requesting_url) << ")"; + bool has_precise_permission = permission_level == GeolocationPermissionLevel::kPrecise; geolocation_context->BindGeolocation( @@ -210,6 +216,9 @@ void GeolocationServiceImpl::HandlePermissionResultChange( if (!geolocation_context) { return; } + LOG(ERROR) << "[POC] HandlePermissionResultChange fired: status=" + << static_cast(permission_result.status) + << " requesting_origin_=" << requesting_origin_.Serialize(); GeolocationPermissionLevel permission_level = GetPermissionLevel(permission_result); diff --git a/services/device/geolocation/geolocation_context.cc b/services/device/geolocation/geolocation_context.cc index 27a253855bb2d..b2891cec98405 100644 --- a/services/device/geolocation/geolocation_context.cc +++ b/services/device/geolocation/geolocation_context.cc @@ -44,8 +44,16 @@ void GeolocationContext::BindGeolocation( void GeolocationContext::OnPermissionUpdated( const url::Origin& origin, mojom::GeolocationPermissionLevel permission_level) { + size_t before = impls_.size(); + LOG(ERROR) << "[POC] OnPermissionUpdated: origin=" << origin.Serialize() + << " level=" << static_cast(permission_level) + << " impls_before=" << before; std::erase_if(impls_, [&origin, &permission_level](const auto& impl) { - if (!origin.IsSameOriginWith(impl->url())) { + bool same = origin.IsSameOriginWith(impl->url()); + LOG(ERROR) << "[POC] impl url='" << impl->url().spec() + << "' IsSameOriginWith=" << same + << (same ? " -> will process" : " -> SKIPPED (orphaned)"); + if (!same) { return false; } // Pass the permission update to the GeolocationImpl, and erase the impl if @@ -55,6 +63,12 @@ void GeolocationContext::OnPermissionUpdated( permission_level == mojom::GeolocationPermissionLevel::kDenied; return should_erase; }); + LOG(ERROR) << "[POC] OnPermissionUpdated: impls_after=" << impls_.size() + << (impls_.size() == before && before > 0 && + permission_level == + mojom::GeolocationPermissionLevel::kDenied + ? " *** BUG: revocation did NOT erase impl ***" + : ""); return; }