Support WebXR Meshing [chromium/src : main]

71 views
Skip to first unread message

Alexander Cooper (Gerrit)

unread,
Jan 22, 2026, 2:28:06 PMJan 22
to Adam Ren (xWF), Raphael Kubo da Costa, Chromium Metrics Reviews, Kentaro Hara, AyeAye, Brandon Jones, Konrad Piascik (xWF), feature-v...@chromium.org, asvitkine...@chromium.org, chromium-a...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, extension...@chromium.org, blink-...@chromium.org
Attention needed from Adam Ren (xWF) and Brandon Jones

Alexander Cooper added 37 comments

Patchset-level comments
File-level comment, Patchset 1:
Alexander Cooper . resolved

Mostly high level review. I didn't go into the details of any of the core algorithms in blink or OpenXR

File device/vr/android/arcore/arcore_device.cc
Line 43, Patchset 1: mojom::XRSessionFeature::MESH_DETECTION,
Alexander Cooper . unresolved

I don't think this is actually supported here?

Alexander Cooper

Oh, and at a bare minimum, it should be appended like the WEBGPU feature is below.

File device/vr/openxr/android/openxr_mesh_manager_android.h
Line 77, Patchset 1: std::set<uint64_t> accumulated_mesh_ids_;
Alexander Cooper . unresolved

And absl::flat_hash_set as well

Line 75, Patchset 1: std::unordered_map<XrUuid, uint64_t, XrUuidHash, XrUuidEqual> uuid_to_id_;
Alexander Cooper . unresolved

Guidance is to use absl::flat_hash_map for better performance.
https://chromium.googlesource.com/chromium/src/+/main/base/containers/README.md

Line 55, Patchset 1: XrSceneMeshingTrackerANDROID mesh_tracker() const { return mesh_tracker_; }
Alexander Cooper . unresolved

Seems odd this needs to be public?

Line 34, Patchset 1: return data64[0] ^ (data64[1] + 0x9e3779b9 + (data64[0] << 6) + (data64[0] >> 2));
Alexander Cooper . unresolved

What is this? Why can the XrUUID not just be hashed as-is? Why do we need sorting? XrUUIDMSFT is able to do this as a simple strong alias to an ID type, though I think maybe we should use the id generator pattern with a map, I'm wondering if some default hashing is fine here.

Line 31, Patchset 1: std::copy_n(data_span.begin(), 8, reinterpret_cast<uint8_t*>(&data64[0]));
Alexander Cooper . unresolved

I *think* this is a banned construct. Byte_span_from_ref is better: https://source.chromium.org/chromium/chromium/src/+/main:base/containers/span.h;drc=ded9cdb6eb6253321e19b5bfb01d6c8d57a7aca5;l=1600 (or just as_byte_span). I think there's some concerns with this as well though;

Line 27, Patchset 1: // 使用 std::span 提供边界检查
Alexander Cooper . unresolved

NIT: English for comments

File device/vr/openxr/android/openxr_mesh_manager_android.cc
Line 20, Patchset 1:std::string GetSemanticLabelString(XrSceneMeshSemanticLabelANDROID label) {
Line 106, Patchset 1: LOG(WARNING) << "xrCreateSceneMeshSnapshotANDROID failed with result="
Alexander Cooper . unresolved

LOG (vs DVLOG or DLOG) should be used VERY sparingly due to the fact that it bloats the production code.

File device/vr/openxr/android/openxr_scene_meshing_android.h
Line 143, Patchset 1:#ifndef XR_NO_PROTOTYPES
#ifdef XR_EXTENSION_PROTOTYPES
XRAPI_ATTR XrResult XRAPI_CALL xrEnumerateSupportedSemanticLabelSetsANDROID(
XrInstance instance,
XrSystemId systemId,
uint32_t supportedSemanticLabelSetsInputCapacity,
uint32_t* supportedSemanticLabelSetsOutputCount,
XrSceneMeshSemanticLabelSetANDROID* supportedSemanticLabelSets);

XRAPI_ATTR XrResult XRAPI_CALL xrCreateSceneMeshingTrackerANDROID(
XrSession session,
const XrSceneMeshingTrackerCreateInfoANDROID* createInfo,
XrSceneMeshingTrackerANDROID* tracker);

XRAPI_ATTR XrResult XRAPI_CALL xrDestroySceneMeshingTrackerANDROID(
XrSceneMeshingTrackerANDROID tracker);

XRAPI_ATTR XrResult XRAPI_CALL xrCreateSceneMeshSnapshotANDROID(
XrSceneMeshingTrackerANDROID tracker,
const XrSceneMeshSnapshotCreateInfoANDROID* createInfo,
XrSceneMeshSnapshotCreationResultANDROID* outSnapshotCreationResult);

XRAPI_ATTR XrResult XRAPI_CALL xrDestroySceneMeshSnapshotANDROID(
XrSceneMeshSnapshotANDROID snapshot);

XRAPI_ATTR XrResult XRAPI_CALL xrGetAllSubmeshStatesANDROID(
XrSceneMeshSnapshotANDROID snapshot,
uint32_t submeshStateCapacityInput,
uint32_t* submeshStateCountOutput,
XrSceneSubmeshStateANDROID* submeshStates);

XRAPI_ATTR XrResult XRAPI_CALL xrGetSubmeshDataANDROID(
XrSceneMeshSnapshotANDROID snapshot,
uint32_t submeshDataCount,
XrSceneSubmeshDataANDROID* inoutSubmeshData);
#endif /* XR_EXTENSION_PROTOTYPES */
#endif /* !XR_NO_PROTOTYPES */
Alexander Cooper . unresolved

IIRC, This section can be omitted.

Line 10, Patchset 1:// TODO(mesh-detection): Remove this file once XR_ANDROID_scene_meshing
// is officially added to the OpenXR specification and the Chromium
// third_party/openxr submodule is updated.
//
File device/vr/openxr/openxr_mesh_manager.cc
Line 12, Patchset 1:mojom::XRMeshDetectionDataPtr OpenXrMeshManager::GetDetectedMeshesData(
XrTime frame_time) {
return nullptr;
}

std::optional<XrLocation> OpenXrMeshManager::GetXrLocationFromMesh(
MeshId mesh_id,
const gfx::Transform& mesh_id_from_object) const {
return std::nullopt;
}
Alexander Cooper . unresolved

Just make pure virtual (`= 0` in header).

File device/vr/openxr/openxr_scene_understanding_manager.h
Line 49, Patchset 1: virtual OpenXrMeshManager* GetMeshManager() = 0;
Alexander Cooper . unresolved

My understanding from you was that this didn't strictly need to be integrated with the SceneUnderstandingManager framework? The new version *may* need to be part of it, or at least get the spatial discovery snapshot, but until such time as that's ready, I don't think we should do this part of the architecture yet.

Alexander Cooper

That said, I guess it logically makes sense to be part of the infrastructure, so fine to leave as-is in hindsight.

File device/vr/openxr/openxr_spatial_framework_manager.cc
Line 313, Patchset 1: supported_features_.insert(device::mojom::XRSessionFeature::MESH_DETECTION);
Alexander Cooper . unresolved

Irrelevant if you merge into the plane manager, but should use it's own `::IsSupported` method before being added.

File device/vr/openxr/openxr_spatial_mesh_manager.h
Line 1, Patchset 1:// Copyright 2025 The Chromium Authors
Alexander Cooper . unresolved

2026

File device/vr/openxr/openxr_spatial_mesh_manager.cc
Line 55, Patchset 1: // Required by XR_SPATIAL_CAPABILITY_PLANE_TRACKING_EXT
Alexander Cooper . unresolved

Required... to be supported?

Line 82, Patchset 1: mesh2d_enabled_ =
base::Contains(plane_tracking_components,
XR_SPATIAL_COMPONENT_TYPE_MESH_2D_EXT);
if (mesh2d_enabled_) {
enabled_components_.insert(XR_SPATIAL_COMPONENT_TYPE_MESH_2D_EXT);
LOG(ERROR) << "Adam: [MeshManager] Mesh2D component is SUPPORTED and will "
"be enabled under PLANE_TRACKING.";
} else {
LOG(ERROR) << "Adam: [MeshManager] Mesh2D component is NOT supported for "
"PLANE_TRACKING on this runtime.";
}
Alexander Cooper . unresolved

To be honest, I think we should just put this on the SpatialPlaneManager since it is associated with the planes. If we want to do any merging later, the more-full mesh manager can be created and used then (and receive a reference to the plane manager). I think it'll simplify a lot of this code. *May* need to rework the enablement/supported feature checks in the spatial manager, but

File device/vr/public/mojom/vr_service.mojom
Line 554, Patchset 1:struct XRMeshData {
Alexander Cooper . unresolved

Security likes full comments describing structs and each member in .mojom files.

Line 559, Patchset 1: string? semantic_label;
Alexander Cooper . unresolved

Use existing SemanticLabel type.

File third_party/blink/renderer/modules/xr/vr_service_type_converters.h
Line 30, Patchset 1:
template <>
struct TypeConverter<blink::DOMUint32Array*, blink::Vector<uint32_t>> {
static blink::DOMUint32Array* Convert(const blink::Vector<uint32_t>& input);
};

template <>
struct TypeConverter<blink::HeapVector<blink::Member<blink::DOMFloat32Array>>,
blink::Vector<float>> {
static blink::HeapVector<blink::Member<blink::DOMFloat32Array>> Convert(
const blink::Vector<float>& input);
};
Alexander Cooper . unresolved

I'm not sure we want this, as sometimes we may want to work on these types directly before converting them. Sometimes they are converted to different types, etc. You could add a *helper* maybe (in xr_utils or whatever it's called here in blink), but I don't think a type converter is appropriate here.

Line 14, Patchset 1:#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
Alexander Cooper . unresolved

Keep blank newline after includes

File third_party/blink/renderer/modules/xr/xr_mesh.h
Line 39, Patchset 1: MeshId id() const;
Alexander Cooper . unresolved

Not part of the web IDL, so should be `Id`

File third_party/blink/renderer/modules/xr/xr_mesh.cc
Line 20, Patchset 1: const size_t vertex_count = vertices.size() / 3;
Alexander Cooper . unresolved

Put 3 in a constant.

Line 22, Patchset 1:
for (size_t i = 0; i < vertex_count; ++i) {
DOMFloat32Array* vertex_array = DOMFloat32Array::Create(3);
auto span = vertex_array->AsSpan();
span[0] = vertices[i * 3 + 0]; // x
span[1] = vertices[i * 3 + 1]; // y
span[2] = vertices[i * 3 + 2]; // z
result.push_back(NotShared<DOMFloat32Array>(vertex_array));
}
Alexander Cooper . unresolved
```
base::span vertices_span(vertices);
while (vertices_span.size() >= 3) {
DOMFloat32Array* vertex_array = DOMFloat32Array::Create(3);
vertex_array->AsSpan().copy_from(vertices);
vertices = vertices.subspan(3);
}
```

https://source.chromium.org/chromium/chromium/src/+/main:device/vr/openxr/android/openxr_depth_sensor_android.cc;drc=32499093dfc832f63a3d0ae862ae906d010e2701;l=186 for inspiration

Line 56, Patchset 1: LOG(ERROR) << __func__ << "Adam2: mesh_id=" << id
Alexander Cooper . unresolved

See Log comments

Line 128, Patchset 1: vertices_ = MakeGarbageCollected<FrozenArray<NotShared<DOMFloat32Array>>>(
ConvertVerticesToFloat32Arrays(mesh_data.vertices));
Alexander Cooper . unresolved

For the record, we just had a big performance hit from depth for something probably less intense than this; though I don't know that there's a way around it.

File third_party/blink/renderer/modules/xr/xr_mesh.idl
Line 1, Patchset 1:// Copyright 2019 The Chromium Authors
Alexander Cooper . unresolved

2026

File third_party/blink/renderer/modules/xr/xr_mesh_manager.h
Line 44, Patchset 1: gfx::Point3F camera_position_{0, 0, 0};
gfx::Vector3dF camera_forward_{0, 0, -1};
Alexander Cooper . unresolved

I'm not seeing this as part of the spec.

Line 1, Patchset 1:// Copyright 2024 The Chromium Authors
Alexander Cooper . unresolved

2026

File third_party/blink/renderer/modules/xr/xr_mesh_manager.cc
Line 21, Patchset 1:bool ShouldShowMeshInView(const XRMesh* mesh,
Alexander Cooper . unresolved

Not sure that this is part of the spec?

Line 24, Patchset 1: std::optional<gfx::Transform> mesh_transform = mesh->MojoFromObject();
Alexander Cooper . unresolved

mesh_from_object still. We try to keep a consistent naming scheme with all transforms, even if they are short lived.

Line 29, Patchset 1: gfx::Point3F mesh_pos(
Alexander Cooper . unresolved

mesh_from_object_position should be the end result here FWIW

Line 29, Patchset 1: gfx::Point3F mesh_pos(
mesh_transform->rc(0, 3),
mesh_transform->rc(1, 3),
mesh_transform->rc(2, 3)
Alexander Cooper . unresolved

Use gfx::Transform::Decompose instead, it shouldn't matter for our transforms, but it's a bad habit to not use: https://source.chromium.org/chromium/chromium/src/+/main:ui/gfx/geometry/transform.h;drc=967c368f01062a9d008fcc301843899a01167bff;l=516

Line 35, Patchset 1: float dx = mesh_pos.x() - camera_pos.x();
float dy = mesh_pos.y() - camera_pos.y();
float dz = mesh_pos.z() - camera_pos.z();
float distance = std::sqrt(dx*dx + dy*dy + dz*dz);
Alexander Cooper . unresolved

Can Vector3Df from subtracting the two points not be used to grab the length and get distance that way?

Line 82, Patchset 1: camera_position_ = camera_position;
camera_forward_ = camera_forward;
Alexander Cooper . unresolved

All this data should be achievable from the viewer pose (mojo_from_viewer)? Which would be the better more accurate way to do this if needed.

File third_party/blink/renderer/modules/xr/xr_session.cc
Line 2122, Patchset 1: gfx::Point3F camera_position(0, 0, 0);
gfx::Vector3dF camera_forward(0, 0, -1);

if (frame_data->render_info && frame_data->render_info->mojo_from_viewer) {
auto mojo_from_viewer = getPoseMatrix(frame_data->render_info->mojo_from_viewer);
if (mojo_from_viewer) {
camera_position = gfx::Point3F(
mojo_from_viewer->rc(0, 3),
mojo_from_viewer->rc(1, 3),
mojo_from_viewer->rc(2, 3)
);

camera_forward = gfx::Vector3dF(
-mojo_from_viewer->rc(0, 2),
-mojo_from_viewer->rc(1, 2),
-mojo_from_viewer->rc(2, 2)
);
camera_forward.GetNormalized(&camera_forward);
}
}
Alexander Cooper . unresolved

See comment about just passing in and using mojo_from_viewer for this directly; (although I question it's usefulness at all).

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Ren (xWF)
  • Brandon Jones
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia5c3b62e81c42787e8fc6145850cdc2c3caf2f19
Gerrit-Change-Number: 7508029
Gerrit-PatchSet: 1
Gerrit-Owner: Adam Ren (xWF) <ada...@google.com>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Konrad Piascik (xWF) <pia...@google.com>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Adam Ren (xWF) <ada...@google.com>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Comment-Date: Thu, 22 Jan 2026 19:27:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Alexander Cooper <alco...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Adam Ren (Gerrit)

unread,
Jan 22, 2026, 6:21:31 PMJan 22
to Adam Ren (xWF), Raphael Kubo da Costa, Chromium Metrics Reviews, Kentaro Hara, AyeAye, Alexander Cooper, Brandon Jones, Konrad Piascik (xWF), feature-v...@chromium.org, asvitkine...@chromium.org, chromium-a...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, extension...@chromium.org, blink-...@chromium.org
Attention needed from Adam Ren (xWF), Alexander Cooper and Brandon Jones

Adam Ren added 6 comments

Commit Message
Line 7, Patchset 1:Support WebXR Meshing
Alexander Cooper . resolved

Looks like a merge conflict; can you try a rebase?

Adam Ren

Done

File chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
Line 184, Patchset 1:<<<<<<< HEAD
import org.chromium.chrome.browser.tabmodel.SupportedProfileType;
=======
import org.chromium.chrome.browser.tabmodel.EmptyTabModel;
>>>>>>> f5190562ab669 (Support WebXR Meshing)
Alexander Cooper . resolved

Merge conflict

Adam Ren

Done

File device/vr/openxr/android/openxr_mesh_manager_android.h
Line 27, Patchset 1: // 使用 std::span 提供边界检查
Alexander Cooper . resolved

NIT: English for comments

Adam Ren

Done

File device/vr/openxr/openxr_spatial_mesh_manager.h
Line 1, Patchset 1:// Copyright 2025 The Chromium Authors
Alexander Cooper . resolved

2026

Adam Ren

Done

File third_party/blink/renderer/modules/xr/xr_mesh.idl
Line 1, Patchset 1:// Copyright 2019 The Chromium Authors
Alexander Cooper . resolved

2026

Adam Ren

Done

File third_party/blink/renderer/modules/xr/xr_mesh_manager.h
Line 1, Patchset 1:// Copyright 2024 The Chromium Authors
Alexander Cooper . resolved

2026

Adam Ren

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Ren (xWF)
  • Alexander Cooper
  • Brandon Jones
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia5c3b62e81c42787e8fc6145850cdc2c3caf2f19
Gerrit-Change-Number: 7508029
Gerrit-PatchSet: 3
Gerrit-Owner: Adam Ren (xWF) <ada...@google.com>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-CC: Adam Ren <jfgv...@gmail.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Konrad Piascik (xWF) <pia...@google.com>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Adam Ren (xWF) <ada...@google.com>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Attention: Alexander Cooper <alco...@chromium.org>
Gerrit-Comment-Date: Thu, 22 Jan 2026 23:21:20 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Alexander Cooper (Gerrit)

unread,
Jan 22, 2026, 6:46:27 PMJan 22
to Adam Ren (xWF), Adam Ren, Raphael Kubo da Costa, Chromium Metrics Reviews, Kentaro Hara, AyeAye, Brandon Jones, Konrad Piascik (xWF), feature-v...@chromium.org, asvitkine...@chromium.org, chromium-a...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, extension...@chromium.org, blink-...@chromium.org
Attention needed from Adam Ren (xWF) and Brandon Jones

Alexander Cooper added 11 comments

File chrome/browser/BUILD.gn
Line 8321, Patchset 4 (Latest): configs -= [ "//build/config/clang:find_bad_constructs" ]
Alexander Cooper . unresolved

It shouldn't be needed here. Openxr_scene_meshing_android.h should only be added in device/vr. Further, you can typically suppress it at only the specific site, which is generally preferable. MOST of the issues I've seen with the API are array integrations which require working with base::span and maybe just a wrapper with UNSAFE_BUFFERS and a comment labeled //SAFETY. If you share the error you're seeing I can help, but this is almost never the right approach.

File components/webxr/android/BUILD.gn
Line 110, Patchset 4 (Latest): configs -= [ "//build/config/clang:find_bad_constructs" ]
Alexander Cooper . unresolved

Same comment as for chrome/browser/BUILD.gn

File device/vr/BUILD.gn
Line 156, Patchset 4 (Latest): configs -= [ "//build/config/clang:find_bad_constructs" ]
Alexander Cooper . unresolved

Same comment as chrome/browser/BUILD.gn

File device/vr/android/arcore/BUILD.gn
Line 69, Patchset 4 (Latest): configs -= [ "//build/config/clang:find_bad_constructs" ]
Alexander Cooper . unresolved

Same comment as the other build files.

File device/vr/openxr/openxr_extension_helper.h
Line 27, Patchset 4 (Latest):#include "device/vr/openxr/android/openxr_scene_meshing_android.h"
Alexander Cooper . unresolved

Likely only need the xr_android.h once you make the change.

File device/vr/openxr/openxr_spatial_mesh_manager.cc
Line 1, Patchset 4 (Latest):// Copyright 2025 The Chromium Authors
Alexander Cooper . unresolved

2026; Please find and replace all other instances of newly added files that do not have 2026.

Line 43, Patchset 4 (Latest): return std::ranges::find(capabilities, XR_SPATIAL_CAPABILITY_PLANE_TRACKING_EXT) != capabilities.end();
Alexander Cooper . unresolved

std::ranges::contains is preferred.

Line 68, Patchset 4 (Latest): std::ranges::find(plane_tracking_components,
Alexander Cooper . unresolved

std::ranges::contains

Line 82, Patchset 4 (Latest): std::ranges::find(plane_tracking_components,
Alexander Cooper . unresolved

std::ranges::contains

File third_party/blink/renderer/modules/xr/xr_mesh_manager.cc
Line 27, Patchset 4 (Latest):
Alexander Cooper . unresolved

Please fix this WARNING reported by Trailing Whitespace: Please remove the trailing whitespace.

Please remove the trailing whitespace.

EDIT: All of these. Usually you can modify an editor setting to do this automatically.

Line 116, Patchset 4 (Latest): if (current_frame_meshes.find(mesh_id) == current_frame_meshes.end()) {
Alexander Cooper . unresolved

std::ranges::contains I believe is the preferred replacement; but can also do base::FindIf if you need the value.

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Ren (xWF)
  • Brandon Jones
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia5c3b62e81c42787e8fc6145850cdc2c3caf2f19
Gerrit-Change-Number: 7508029
Gerrit-PatchSet: 4
Gerrit-Owner: Adam Ren (xWF) <ada...@google.com>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-CC: Adam Ren <jfgv...@gmail.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Konrad Piascik (xWF) <pia...@google.com>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Adam Ren (xWF) <ada...@google.com>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Comment-Date: Thu, 22 Jan 2026 23:46:17 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Adam Ren (Gerrit)

unread,
Jan 26, 2026, 9:06:16 PMJan 26
to Adam Ren (xWF), Raphael Kubo da Costa, Chromium Metrics Reviews, Kentaro Hara, AyeAye, Alexander Cooper, Brandon Jones, Konrad Piascik (xWF), feature-v...@chromium.org, asvitkine...@chromium.org, chromium-a...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, extension...@chromium.org, blink-...@chromium.org
Attention needed from Adam Ren (xWF), Alexander Cooper and Brandon Jones

Adam Ren added 13 comments

File device/vr/openxr/android/openxr_mesh_manager_android.h
Line 77, Patchset 1: std::set<uint64_t> accumulated_mesh_ids_;
Alexander Cooper . resolved

And absl::flat_hash_set as well

Adam Ren

Done

Line 75, Patchset 1: std::unordered_map<XrUuid, uint64_t, XrUuidHash, XrUuidEqual> uuid_to_id_;
Alexander Cooper . resolved

Guidance is to use absl::flat_hash_map for better performance.
https://chromium.googlesource.com/chromium/src/+/main/base/containers/README.md

Adam Ren

Done

Line 55, Patchset 1: XrSceneMeshingTrackerANDROID mesh_tracker() const { return mesh_tracker_; }
Alexander Cooper . resolved

Seems odd this needs to be public?

Adam Ren

Good catch. Forgot to remove this.

Line 34, Patchset 1: return data64[0] ^ (data64[1] + 0x9e3779b9 + (data64[0] << 6) + (data64[0] >> 2));
Alexander Cooper . resolved

What is this? Why can the XrUUID not just be hashed as-is? Why do we need sorting? XrUUIDMSFT is able to do this as a simple strong alias to an ID type, though I think maybe we should use the id generator pattern with a map, I'm wondering if some default hashing is fine here.

Adam Ren

Thanks, Alex. I've simplified the hash function to use std::hash<std::string_view> instead of the complex mixing. The simplified hash should be sufficient for UUID hashing. And, we're already using the ID generator pattern (GetOrCreateMeshId() maps XrUuid → uint64_t).

Line 31, Patchset 1: std::copy_n(data_span.begin(), 8, reinterpret_cast<uint8_t*>(&data64[0]));
Alexander Cooper . resolved

I *think* this is a banned construct. Byte_span_from_ref is better: https://source.chromium.org/chromium/chromium/src/+/main:base/containers/span.h;drc=ded9cdb6eb6253321e19b5bfb01d6c8d57a7aca5;l=1600 (or just as_byte_span). I think there's some concerns with this as well though;

Adam Ren

Done

File device/vr/openxr/android/openxr_mesh_manager_android.cc
Line 75, Patchset 1:
Alexander Cooper . resolved

Trailing whitespace should be removed.

Adam Ren

Done

Line 106, Patchset 1: LOG(WARNING) << "xrCreateSceneMeshSnapshotANDROID failed with result="
Alexander Cooper . resolved

LOG (vs DVLOG or DLOG) should be used VERY sparingly due to the fact that it bloats the production code.

Adam Ren

Done

File device/vr/openxr/android/openxr_scene_meshing_android.h
Line 10, Patchset 1:// TODO(mesh-detection): Remove this file once XR_ANDROID_scene_meshing
// is officially added to the OpenXR specification and the Chromium
// third_party/openxr submodule is updated.
//
Alexander Cooper . resolved
Adam Ren

Done

File device/vr/openxr/openxr_mesh_manager.cc
Line 12, Patchset 1:mojom::XRMeshDetectionDataPtr OpenXrMeshManager::GetDetectedMeshesData(
XrTime frame_time) {
return nullptr;
}

std::optional<XrLocation> OpenXrMeshManager::GetXrLocationFromMesh(
MeshId mesh_id,
const gfx::Transform& mesh_id_from_object) const {
return std::nullopt;
}
Alexander Cooper . resolved

Just make pure virtual (`= 0` in header).

Adam Ren

Done

File device/vr/openxr/openxr_spatial_mesh_manager.cc
Line 1, Patchset 4:// Copyright 2025 The Chromium Authors
Alexander Cooper . resolved

2026; Please find and replace all other instances of newly added files that do not have 2026.

Adam Ren

Done

File third_party/blink/renderer/modules/xr/vr_service_type_converters.h
Line 14, Patchset 1:#include "third_party/blink/renderer/platform/heap/collection_support/heap_vector.h"
Alexander Cooper . resolved

Keep blank newline after includes

Adam Ren

Done

File third_party/blink/renderer/modules/xr/xr_mesh.h
Line 39, Patchset 1: MeshId id() const;
Alexander Cooper . resolved

Not part of the web IDL, so should be `Id`

Adam Ren

Done

File third_party/blink/renderer/modules/xr/xr_mesh_manager.cc
Line 27, Patchset 4:
Alexander Cooper . resolved

Please fix this WARNING reported by Trailing Whitespace: Please remove the trailing whitespace.

Please remove the trailing whitespace.

EDIT: All of these. Usually you can modify an editor setting to do this automatically.

Adam Ren

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Ren (xWF)
  • Alexander Cooper
  • Brandon Jones
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia5c3b62e81c42787e8fc6145850cdc2c3caf2f19
Gerrit-Change-Number: 7508029
Gerrit-PatchSet: 5
Gerrit-Owner: Adam Ren (xWF) <ada...@google.com>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-CC: Adam Ren <jfgv...@gmail.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Konrad Piascik (xWF) <pia...@google.com>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Adam Ren (xWF) <ada...@google.com>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Attention: Alexander Cooper <alco...@chromium.org>
Gerrit-Comment-Date: Tue, 27 Jan 2026 02:06:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Alexander Cooper <alco...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Adam Ren (Gerrit)

unread,
Jan 27, 2026, 4:04:17 AMJan 27
to Adam Ren (xWF), Raphael Kubo da Costa, Chromium Metrics Reviews, Kentaro Hara, AyeAye, Alexander Cooper, Brandon Jones, Konrad Piascik (xWF), feature-v...@chromium.org, asvitkine...@chromium.org, chromium-a...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, extension...@chromium.org, blink-...@chromium.org
Attention needed from Adam Ren (xWF), Alexander Cooper and Brandon Jones

Adam Ren added 9 comments

File third_party/blink/renderer/modules/xr/xr_mesh.cc
Line 20, Patchset 1: const size_t vertex_count = vertices.size() / 3;
Alexander Cooper . resolved

Put 3 in a constant.

Adam Ren

Done

Line 22, Patchset 1:
for (size_t i = 0; i < vertex_count; ++i) {
DOMFloat32Array* vertex_array = DOMFloat32Array::Create(3);
auto span = vertex_array->AsSpan();
span[0] = vertices[i * 3 + 0]; // x
span[1] = vertices[i * 3 + 1]; // y
span[2] = vertices[i * 3 + 2]; // z
result.push_back(NotShared<DOMFloat32Array>(vertex_array));
}
Alexander Cooper . resolved
```
base::span vertices_span(vertices);
while (vertices_span.size() >= 3) {
DOMFloat32Array* vertex_array = DOMFloat32Array::Create(3);
vertex_array->AsSpan().copy_from(vertices);
vertices = vertices.subspan(3);
}
```

https://source.chromium.org/chromium/chromium/src/+/main:device/vr/openxr/android/openxr_depth_sensor_android.cc;drc=32499093dfc832f63a3d0ae862ae906d010e2701;l=186 for inspiration

Adam Ren

Done

Line 56, Patchset 1: LOG(ERROR) << __func__ << "Adam2: mesh_id=" << id
Alexander Cooper . resolved

See Log comments

Adam Ren

Done

File third_party/blink/renderer/modules/xr/xr_mesh_manager.h
Line 44, Patchset 1: gfx::Point3F camera_position_{0, 0, 0};
gfx::Vector3dF camera_forward_{0, 0, -1};
Alexander Cooper . unresolved

I'm not seeing this as part of the spec.

Adam Ren

The camera culling logic here is needed for performance optimization. Through experimentation, I found that filtering meshes based on camera position and view frustum is necessary to ensure the HTML app can render meshes in real-time. I have videos showing this in the google drive folder I posted in the Google Chat Thread.

File third_party/blink/renderer/modules/xr/xr_mesh_manager.cc
Line 21, Patchset 1:bool ShouldShowMeshInView(const XRMesh* mesh,
Alexander Cooper . resolved

Not sure that this is part of the spec?

Adam Ren

Done

Line 24, Patchset 1: std::optional<gfx::Transform> mesh_transform = mesh->MojoFromObject();
Alexander Cooper . resolved

mesh_from_object still. We try to keep a consistent naming scheme with all transforms, even if they are short lived.

Adam Ren

Done

Line 29, Patchset 1: gfx::Point3F mesh_pos(
Alexander Cooper . resolved

mesh_from_object_position should be the end result here FWIW

Adam Ren

Done

Line 29, Patchset 1: gfx::Point3F mesh_pos(
mesh_transform->rc(0, 3),
mesh_transform->rc(1, 3),
mesh_transform->rc(2, 3)
Alexander Cooper . resolved

Use gfx::Transform::Decompose instead, it shouldn't matter for our transforms, but it's a bad habit to not use: https://source.chromium.org/chromium/chromium/src/+/main:ui/gfx/geometry/transform.h;drc=967c368f01062a9d008fcc301843899a01167bff;l=516

Adam Ren

Done

Line 35, Patchset 1: float dx = mesh_pos.x() - camera_pos.x();
float dy = mesh_pos.y() - camera_pos.y();
float dz = mesh_pos.z() - camera_pos.z();
float distance = std::sqrt(dx*dx + dy*dy + dz*dz);
Alexander Cooper . resolved

Can Vector3Df from subtracting the two points not be used to grab the length and get distance that way?

Adam Ren

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Ren (xWF)
  • Alexander Cooper
  • Brandon Jones
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia5c3b62e81c42787e8fc6145850cdc2c3caf2f19
Gerrit-Change-Number: 7508029
Gerrit-PatchSet: 6
Gerrit-Owner: Adam Ren (xWF) <ada...@google.com>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-CC: Adam Ren <jfgv...@gmail.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Konrad Piascik (xWF) <pia...@google.com>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Adam Ren (xWF) <ada...@google.com>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Attention: Alexander Cooper <alco...@chromium.org>
Gerrit-Comment-Date: Tue, 27 Jan 2026 09:04:07 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Alexander Cooper (Gerrit)

unread,
Jan 27, 2026, 6:55:15 PMJan 27
to Adam Ren (xWF), Adam Ren, Raphael Kubo da Costa, Chromium Metrics Reviews, Kentaro Hara, AyeAye, Brandon Jones, Konrad Piascik (xWF), feature-v...@chromium.org, asvitkine...@chromium.org, chromium-a...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, extension...@chromium.org, blink-...@chromium.org
Attention needed from Adam Ren (xWF) and Brandon Jones

Alexander Cooper added 3 comments

File device/vr/openxr/android/openxr_mesh_manager_android.h
Line 69, Patchset 4:
Alexander Cooper . unresolved

More whitespace sneaking in

File device/vr/openxr/android/openxr_scene_understanding_manager_android.h
Line 35, Patchset 9 (Latest): OpenXrMeshManager* GetMeshManager() override;
Alexander Cooper . unresolved

Thinking about this, we should probably modify the top-level `GetMeshManager` to allow creating one if the selected SceneUnderstandingManger can't provide meshes and somehow make meshes optional for a SceneUnderstandingManager. This would be in I think OpenXrExtensionHelper, since our goal is to try to deprecate the XR_ANDROID scene understanding manager, since the OpenXR team intends to remove it's support, but we think the meshing extension will remain.

File third_party/blink/renderer/modules/xr/xr_mesh_manager.h
Line 44, Patchset 1: gfx::Point3F camera_position_{0, 0, 0};
gfx::Vector3dF camera_forward_{0, 0, -1};
Alexander Cooper . unresolved

I'm not seeing this as part of the spec.

Adam Ren

The camera culling logic here is needed for performance optimization. Through experimentation, I found that filtering meshes based on camera position and view frustum is necessary to ensure the HTML app can render meshes in real-time. I have videos showing this in the google drive folder I posted in the Google Chat Thread.

Alexander Cooper

Did you try having the HTML app do the culling? I can imagine some scenarios where the page may want the data but won't render it.

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Ren (xWF)
  • Brandon Jones
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia5c3b62e81c42787e8fc6145850cdc2c3caf2f19
Gerrit-Change-Number: 7508029
Gerrit-PatchSet: 9
Gerrit-Owner: Adam Ren (xWF) <ada...@google.com>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-CC: Adam Ren <jfgv...@gmail.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Konrad Piascik (xWF) <pia...@google.com>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Adam Ren (xWF) <ada...@google.com>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Comment-Date: Tue, 27 Jan 2026 23:55:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Adam Ren <jfgv...@gmail.com>
Comment-In-Reply-To: Alexander Cooper <alco...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Adam Ren (xWF) (Gerrit)

unread,
Feb 1, 2026, 8:42:27 PM (10 days ago) Feb 1
to Code Review Nudger, Adam Ren, Raphael Kubo da Costa, Chromium Metrics Reviews, Kentaro Hara, AyeAye, Alexander Cooper, Brandon Jones, Konrad Piascik (xWF), feature-v...@chromium.org, asvitkine...@chromium.org, chromium-a...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, extension...@chromium.org, blink-...@chromium.org
Attention needed from Adam Ren, Alexander Cooper and Brandon Jones

Adam Ren (xWF) added 12 comments

File device/vr/openxr/android/openxr_mesh_manager_android.cc
Line 20, Patchset 1:std::string GetSemanticLabelString(XrSceneMeshSemanticLabelANDROID label) {
Alexander Cooper . resolved
Adam Ren (xWF)

Done

File device/vr/openxr/openxr_spatial_mesh_manager.cc
Line 43, Patchset 4: return std::ranges::find(capabilities, XR_SPATIAL_CAPABILITY_PLANE_TRACKING_EXT) != capabilities.end();
Alexander Cooper . resolved

std::ranges::contains is preferred.

Adam Ren (xWF)

Done

Line 58, Patchset 1: LOG(ERROR) << "Adam: OpenXrSpatialMeshManager (Plane-based Mesh) Activated!";
Alexander Cooper . resolved

Remove.

Adam Ren (xWF)

Done

Line 68, Patchset 4: std::ranges::find(plane_tracking_components,
Alexander Cooper . resolved

std::ranges::contains

Adam Ren (xWF)

Done

Line 82, Patchset 4: std::ranges::find(plane_tracking_components,
Alexander Cooper . resolved

std::ranges::contains

Adam Ren (xWF)

Done

File device/vr/public/mojom/vr_service.mojom
Line 554, Patchset 1:struct XRMeshData {
Alexander Cooper . resolved

Security likes full comments describing structs and each member in .mojom files.

Adam Ren (xWF)

Done

Line 559, Patchset 1: string? semantic_label;
Alexander Cooper . resolved

Use existing SemanticLabel type.

Adam Ren (xWF)

Done

File third_party/blink/renderer/modules/xr/xr_mesh.cc
Line 128, Patchset 1: vertices_ = MakeGarbageCollected<FrozenArray<NotShared<DOMFloat32Array>>>(
ConvertVerticesToFloat32Arrays(mesh_data.vertices));
Alexander Cooper . resolved

For the record, we just had a big performance hit from depth for something probably less intense than this; though I don't know that there's a way around it.

Adam Ren (xWF)

It's been removed. Thanks for the suggestion. It does become faster.

File third_party/blink/renderer/modules/xr/xr_mesh_manager.h
Line 44, Patchset 1: gfx::Point3F camera_position_{0, 0, 0};
gfx::Vector3dF camera_forward_{0, 0, -1};
Alexander Cooper . resolved

I'm not seeing this as part of the spec.

Adam Ren

The camera culling logic here is needed for performance optimization. Through experimentation, I found that filtering meshes based on camera position and view frustum is necessary to ensure the HTML app can render meshes in real-time. I have videos showing this in the google drive folder I posted in the Google Chat Thread.

Alexander Cooper

Did you try having the HTML app do the culling? I can imagine some scenarios where the page may want the data but won't render it.

Adam Ren (xWF)

Yes, It has been implemented in the latest patch,

File third_party/blink/renderer/modules/xr/xr_mesh_manager.cc
Line 116, Patchset 4: if (current_frame_meshes.find(mesh_id) == current_frame_meshes.end()) {
Alexander Cooper . resolved

std::ranges::contains I believe is the preferred replacement; but can also do base::FindIf if you need the value.

Adam Ren (xWF)

Done

File third_party/blink/renderer/modules/xr/xr_session.cc
Line 2122, Patchset 1: gfx::Point3F camera_position(0, 0, 0);
gfx::Vector3dF camera_forward(0, 0, -1);

if (frame_data->render_info && frame_data->render_info->mojo_from_viewer) {
auto mojo_from_viewer = getPoseMatrix(frame_data->render_info->mojo_from_viewer);
if (mojo_from_viewer) {
camera_position = gfx::Point3F(
mojo_from_viewer->rc(0, 3),
mojo_from_viewer->rc(1, 3),
mojo_from_viewer->rc(2, 3)
);

camera_forward = gfx::Vector3dF(
-mojo_from_viewer->rc(0, 2),
-mojo_from_viewer->rc(1, 2),
-mojo_from_viewer->rc(2, 2)
);
camera_forward.GetNormalized(&camera_forward);
}
}
Alexander Cooper . resolved

See comment about just passing in and using mojo_from_viewer for this directly; (although I question it's usefulness at all).

Adam Ren (xWF)

Done

File tools/metrics/histograms/metadata/blink/enums.xml
Line 6361, Patchset 1:
Alexander Cooper . resolved

Remove

Adam Ren (xWF)

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Ren
  • Alexander Cooper
  • Brandon Jones
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia5c3b62e81c42787e8fc6145850cdc2c3caf2f19
Gerrit-Change-Number: 7508029
Gerrit-PatchSet: 11
Gerrit-Owner: Adam Ren (xWF) <ada...@google.com>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-CC: Adam Ren <jfgv...@gmail.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Konrad Piascik (xWF) <pia...@google.com>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Adam Ren <jfgv...@gmail.com>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Attention: Alexander Cooper <alco...@chromium.org>
Gerrit-Comment-Date: Mon, 02 Feb 2026 01:42:16 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Adam Ren (xWF) (Gerrit)

unread,
Feb 1, 2026, 9:25:11 PM (10 days ago) Feb 1
to Code Review Nudger, Adam Ren, Raphael Kubo da Costa, Chromium Metrics Reviews, Kentaro Hara, AyeAye, Alexander Cooper, Brandon Jones, Konrad Piascik (xWF), feature-v...@chromium.org, asvitkine...@chromium.org, chromium-a...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, extension...@chromium.org, blink-...@chromium.org
Attention needed from Adam Ren, Alexander Cooper and Brandon Jones

Adam Ren (xWF) added 8 comments

File chrome/browser/BUILD.gn
Line 8321, Patchset 4: configs -= [ "//build/config/clang:find_bad_constructs" ]
Alexander Cooper . resolved

It shouldn't be needed here. Openxr_scene_meshing_android.h should only be added in device/vr. Further, you can typically suppress it at only the specific site, which is generally preferable. MOST of the issues I've seen with the API are array integrations which require working with base::span and maybe just a wrapper with UNSAFE_BUFFERS and a comment labeled //SAFETY. If you share the error you're seeing I can help, but this is almost never the right approach.

Adam Ren (xWF)

Thanks Alex, I saw the "XR_ANDROID_scene_meshing" has been included in /usr/local/google/code/clankium/src/third_party/openxr/dev/xr_android.h

File components/webxr/android/BUILD.gn
Line 110, Patchset 4: configs -= [ "//build/config/clang:find_bad_constructs" ]
Alexander Cooper . resolved

Same comment as for chrome/browser/BUILD.gn

Adam Ren (xWF)

Done

File device/vr/BUILD.gn
Line 156, Patchset 4: configs -= [ "//build/config/clang:find_bad_constructs" ]
Alexander Cooper . resolved

Same comment as chrome/browser/BUILD.gn

Adam Ren (xWF)

Done

File device/vr/android/arcore/BUILD.gn
Line 69, Patchset 4: configs -= [ "//build/config/clang:find_bad_constructs" ]
Alexander Cooper . resolved

Same comment as the other build files.

Adam Ren (xWF)

Done

File device/vr/openxr/android/openxr_mesh_manager_android.h
Line 69, Patchset 4:
Alexander Cooper . resolved

More whitespace sneaking in

Adam Ren (xWF)

Done

File device/vr/openxr/android/openxr_scene_meshing_android.h
Alexander Cooper . resolved

IIRC, This section can be omitted.

Adam Ren (xWF)

Done

File device/vr/openxr/openxr_extension_helper.h
Line 27, Patchset 4:#include "device/vr/openxr/android/openxr_scene_meshing_android.h"
Alexander Cooper . resolved

Likely only need the xr_android.h once you make the change.

Adam Ren (xWF)

Done

File third_party/blink/renderer/modules/xr/xr_mesh_manager.cc
Line 82, Patchset 1: camera_position_ = camera_position;
camera_forward_ = camera_forward;
Alexander Cooper . resolved

All this data should be achievable from the viewer pose (mojo_from_viewer)? Which would be the better more accurate way to do this if needed.

Adam Ren (xWF)

Done

Gerrit-Comment-Date: Mon, 02 Feb 2026 02:25:01 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Alexander Cooper <alco...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Alexander Cooper (Gerrit)

unread,
Feb 2, 2026, 3:51:47 PM (9 days ago) Feb 2
to Adam Ren (xWF), Code Review Nudger, Adam Ren, Raphael Kubo da Costa, Chromium Metrics Reviews, Kentaro Hara, AyeAye, Brandon Jones, Konrad Piascik (xWF), feature-v...@chromium.org, asvitkine...@chromium.org, chromium-a...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, extension...@chromium.org, blink-...@chromium.org
Attention needed from Adam Ren, Adam Ren (xWF) and Brandon Jones

Alexander Cooper added 6 comments

Patchset-level comments
File-level comment, Patchset 13 (Latest):
Alexander Cooper . resolved

Still some architectural concerns remaining open from PS#1, so still haven't done a full review pending discussion/adoption of those bits of feedback.

File chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
Line 1645, Patchset 13 (Latest): private void requestSceneUnderstandingPermissionIfNeeded() {
Alexander Cooper . unresolved

Previous comment isn't attached anymore, but permissions requests shouldn't be done here. https://source.chromium.org/chromium/chromium/src/+/main:components/permissions/android/java/src/org/chromium/components/permissions/PermissionUtil.java;drc=3808093d5627d10d9bfe6c5000449b381012b5ab;l=30 handles this as part of requesting the immersive-vr or immersive-ar session.

File device/vr/openxr/android/openxr_mesh_manager_android.cc
Line 217, Patchset 13 (Latest): mesh_data_result->all_meshes_ids.push_back(device::MeshId(mesh_id));
Alexander Cooper . unresolved

Please fix this WARNING reported by ClangTidy: check: modernize-use-emplace

use emplace_back instead of push_back (https://cla...

check: modernize-use-emplace

use emplace_back instead of push_back (https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-emplace.html)

(Note: You can add `Skip-Clang-Tidy-Checks: modernize-use-emplace` footer to the CL description to skip the check)

(Lint observed on `android-clang-tidy-rel`, but not on `linux-clang-tidy-rel` or `mac-clang-tidy-rel`)

Line 340, Patchset 13 (Latest): mesh_data_result->all_meshes_ids.push_back(device::MeshId(mesh_id));
Alexander Cooper . unresolved

Please fix this WARNING reported by ClangTidy: check: modernize-use-emplace

use emplace_back instead of push_back (https://cla...

check: modernize-use-emplace

use emplace_back instead of push_back (https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-emplace.html)

(Note: You can add `Skip-Clang-Tidy-Checks: modernize-use-emplace` footer to the CL description to skip the check)

(Lint observed on `android-clang-tidy-rel`, but not on `linux-clang-tidy-rel` or `mac-clang-tidy-rel`)

File device/vr/openxr/openxr_scene_understanding_manager.h
Line 49, Patchset 1: virtual OpenXrMeshManager* GetMeshManager() = 0;
Alexander Cooper . unresolved

My understanding from you was that this didn't strictly need to be integrated with the SceneUnderstandingManager framework? The new version *may* need to be part of it, or at least get the spatial discovery snapshot, but until such time as that's ready, I don't think we should do this part of the architecture yet.

Alexander Cooper

That said, I guess it logically makes sense to be part of the infrastructure, so fine to leave as-is in hindsight.

Alexander Cooper

All of that said, and taking my comment from the other item into account: I think we probably should modify the top-level spot that queries/creates the support for a mesh manager to try this if it exists (or try creating it if it exists), but to be able to create it as a standalone as well if need-be.

File device/vr/openxr/openxr_spatial_mesh_manager.cc
Line 255, Patchset 13 (Latest): meshes_data->all_meshes_ids.push_back(device::MeshId(GetMeshId(entity_id)));
Alexander Cooper . unresolved

Please fix this WARNING reported by ClangTidy: check: modernize-use-emplace

use emplace_back instead of push_back (https://cla...

check: modernize-use-emplace

use emplace_back instead of push_back (https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-emplace.html)

(Note: You can add `Skip-Clang-Tidy-Checks: modernize-use-emplace` footer to the CL description to skip the check)

(Lint observed on `android-clang-tidy-rel`, but not on `linux-clang-tidy-rel` or `mac-clang-tidy-rel`)

Open in Gerrit

Related details

Attention is currently required from:
  • Adam Ren
  • Adam Ren (xWF)
  • Brandon Jones
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ia5c3b62e81c42787e8fc6145850cdc2c3caf2f19
Gerrit-Change-Number: 7508029
Gerrit-PatchSet: 13
Gerrit-Owner: Adam Ren (xWF) <ada...@google.com>
Gerrit-Reviewer: Alexander Cooper <alco...@chromium.org>
Gerrit-Reviewer: Brandon Jones <baj...@chromium.org>
Gerrit-CC: Adam Ren <jfgv...@gmail.com>
Gerrit-CC: Chromium Metrics Reviews <chromium-met...@google.com>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: Kentaro Hara <har...@chromium.org>
Gerrit-CC: Konrad Piascik (xWF) <pia...@google.com>
Gerrit-CC: Raphael Kubo da Costa <ku...@igalia.com>
Gerrit-Attention: Adam Ren <jfgv...@gmail.com>
Gerrit-Attention: Adam Ren (xWF) <ada...@google.com>
Gerrit-Attention: Brandon Jones <baj...@chromium.org>
Gerrit-Comment-Date: Mon, 02 Feb 2026 20:51:37 +0000
satisfied_requirement
unsatisfied_requirement
open
diffy

Alexander Cooper (Gerrit)

unread,
Feb 5, 2026, 5:19:40 PM (6 days ago) Feb 5
to Adam Ren (xWF), Code Review Nudger, Adam Ren, Raphael Kubo da Costa, Chromium Metrics Reviews, Kentaro Hara, AyeAye, Brandon Jones, Konrad Piascik (xWF), feature-v...@chromium.org, asvitkine...@chromium.org, chromium-a...@chromium.org, blink-re...@chromium.org, blink-revie...@chromium.org, jmedle...@chromium.org, kinuko...@chromium.org, extension...@chromium.org, blink-...@chromium.org
Attention needed from Adam Ren, Adam Ren (xWF) and Brandon Jones

Alexander Cooper added 1 comment

File device/vr/openxr/android/openxr_mesh_manager_android.h
Line 28, Patchset 13 (Latest):
struct XrUuidHash {
size_t operator()(const XrUuid& uuid) const {
std::hash<std::string_view> hasher;
std::string_view uuid_view(reinterpret_cast<const char*>(uuid.data), XR_UUID_SIZE);
return hasher(uuid_view);
}
};

struct XrUuidEqual {
bool operator()(const XrUuid& lhs, const XrUuid& rhs) const {
auto lhs_span = base::as_byte_span(lhs.data);
auto rhs_span = base::as_byte_span(rhs.data);
return std::ranges::equal(lhs_span, rhs_span);
}
};
Alexander Cooper . unresolved

Let's make a helper to convert XrUuid to a base::Uuid, which we could also just send across mojom as the id, or if we feel the string comparison is too much, we could just do the base::Uuid to integer ID mapping: https://source.chromium.org/chromium/chromium/src/+/main:base/uuid.h;drc=e0faa4c7861bcb675b1fc0880814cf41b42f68a7;l=21 is the type. It looks like we'd need to turn the byte string into a hex string, but if you prefer I could *try* to send a messsage to the base OWNERS about leveraging an API to speicfy the value again, but not sure how well that'll go over given it looks to have been removed sometime last year.

Gerrit-Comment-Date: Thu, 05 Feb 2026 22:19:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages