Commit-Queue | +1 |
PTAL! This has been on my TODO list for entirely too long, but I believe this is all that's required to get the feature use counters wired up.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
LGTM w/one question
if (query->mode() == device::mojom::blink::XRSessionMode::kImmersiveAr) {
UseCounter::CountWebDXFeature(
ExecutionContext::From(query->GetScriptState()),
WebDXFeature::kWebxrAr);
}
if (anchors_enabled) {
UseCounter::CountWebDXFeature(
ExecutionContext::From(query->GetScriptState()),
WebDXFeature::kWebxrAnchors);
}
if (hit_test_enabled) {
UseCounter::CountWebDXFeature(
ExecutionContext::From(query->GetScriptState()),
WebDXFeature::kWebxrHitTest);
}
Why the split to report these here but the others in ReportRequestSessionResult?
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (query->mode() == device::mojom::blink::XRSessionMode::kImmersiveAr) {
UseCounter::CountWebDXFeature(
ExecutionContext::From(query->GetScriptState()),
WebDXFeature::kWebxrAr);
}
if (anchors_enabled) {
UseCounter::CountWebDXFeature(
ExecutionContext::From(query->GetScriptState()),
WebDXFeature::kWebxrAnchors);
}
if (hit_test_enabled) {
UseCounter::CountWebDXFeature(
ExecutionContext::From(query->GetScriptState()),
WebDXFeature::kWebxrHitTest);
}
Why the split to report these here but the others in ReportRequestSessionResult?
Mostly because we were already checking for these features in this function, and it did have a UseCounter recorded in it already. I'm fine moving them all to ReportRequestSessionResult, though.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
if (query->mode() == device::mojom::blink::XRSessionMode::kImmersiveAr) {
UseCounter::CountWebDXFeature(
ExecutionContext::From(query->GetScriptState()),
WebDXFeature::kWebxrAr);
}
if (anchors_enabled) {
UseCounter::CountWebDXFeature(
ExecutionContext::From(query->GetScriptState()),
WebDXFeature::kWebxrAnchors);
}
if (hit_test_enabled) {
UseCounter::CountWebDXFeature(
ExecutionContext::From(query->GetScriptState()),
WebDXFeature::kWebxrHitTest);
}
Brandon JonesWhy the split to report these here but the others in ReportRequestSessionResult?
Mostly because we were already checking for these features in this function, and it did have a UseCounter recorded in it already. I'm fine moving them all to ReportRequestSessionResult, though.
Either way is fine with me, just didn't know if there was a reason that these features were different.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +2 |
if (query->mode() == device::mojom::blink::XRSessionMode::kImmersiveAr) {
UseCounter::CountWebDXFeature(
ExecutionContext::From(query->GetScriptState()),
WebDXFeature::kWebxrAr);
}
if (anchors_enabled) {
UseCounter::CountWebDXFeature(
ExecutionContext::From(query->GetScriptState()),
WebDXFeature::kWebxrAnchors);
}
if (hit_test_enabled) {
UseCounter::CountWebDXFeature(
ExecutionContext::From(query->GetScriptState()),
WebDXFeature::kWebxrHitTest);
}
Brandon JonesWhy the split to report these here but the others in ReportRequestSessionResult?
Alexander CooperMostly because we were already checking for these features in this function, and it did have a UseCounter recorded in it already. I'm fine moving them all to ReportRequestSessionResult, though.
Either way is fine with me, just didn't know if there was a reason that these features were different.
Done. Moved them to ReportRequestSessionResult except for the AR session one, which felt appropriate to keep next to the Session use counter.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
1 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: third_party/blink/renderer/modules/xr/xr_system.cc
Insertions: 66, Deletions: 68.
@@ -590,6 +590,10 @@
GetFeatureRequestStatus(XRSessionFeature::LIGHT_ESTIMATION, session);
auto feature_request_camera_access =
GetFeatureRequestStatus(XRSessionFeature::CAMERA_ACCESS, session);
+ auto feature_request_anchors =
+ GetFeatureRequestStatus(XRSessionFeature::ANCHORS, session);
+ auto feature_request_hit_test =
+ GetFeatureRequestStatus(XRSessionFeature::HIT_TEST, session);
ukm::builders::XR_WebXR_SessionRequest(ukm_source_id_)
.SetMode(static_cast<int64_t>(mode_))
@@ -602,62 +606,68 @@
.SetFeature_Unbounded(static_cast<int64_t>(feature_request_unbounded))
.Record(execution_context->UkmRecorder());
- // If the session was successfully created and DOM overlay was requested,
- // count this as a use of the DOM overlay feature.
- if (session && status == SessionRequestStatus::kSuccess &&
- IsFeatureRequested(feature_request_dom_overlay)) {
- DVLOG(2) << __func__ << ": DOM overlay was requested, logging a UseCounter";
- UseCounter::Count(session->GetExecutionContext(),
- WebFeature::kXRDOMOverlay);
- }
+ // If the session was successfully created record use counters.
+ if (session && status == SessionRequestStatus::kSuccess) {
+ if (IsFeatureRequested(feature_request_dom_overlay)) {
+ DVLOG(2) << __func__
+ << ": DOM overlay was requested, logging a UseCounter";
+ UseCounter::Count(session->GetExecutionContext(),
+ WebFeature::kXRDOMOverlay);
+ }
- // If the session was successfully created and depth-sensing was requested,
- // count this as a use of depth sensing feature.
- if (session && status == SessionRequestStatus::kSuccess &&
- IsFeatureRequested(feature_request_depth_sensing)) {
- DVLOG(2) << __func__
- << ": depth sensing was requested, logging a UseCounter";
- UseCounter::Count(session->GetExecutionContext(),
- WebFeature::kXRDepthSensing);
- }
+ if (IsFeatureRequested(feature_request_depth_sensing)) {
+ DVLOG(2) << __func__
+ << ": depth sensing was requested, logging a UseCounter";
+ UseCounter::Count(session->GetExecutionContext(),
+ WebFeature::kXRDepthSensing);
+ }
- if (session && status == SessionRequestStatus::kSuccess &&
- IsFeatureRequested(feature_request_plane_detection)) {
- DVLOG(2) << __func__
- << ": plane detection was requested, logging a UseCounter";
- UseCounter::Count(session->GetExecutionContext(),
- WebFeature::kXRPlaneDetection);
- }
+ if (IsFeatureRequested(feature_request_plane_detection)) {
+ DVLOG(2) << __func__
+ << ": plane detection was requested, logging a UseCounter";
+ UseCounter::Count(session->GetExecutionContext(),
+ WebFeature::kXRPlaneDetection);
+ }
- if (session && status == SessionRequestStatus::kSuccess &&
- IsFeatureRequested(feature_request_image_tracking)) {
- DVLOG(2) << __func__
- << ": image tracking was requested, logging a UseCounter";
- UseCounter::Count(session->GetExecutionContext(),
- WebFeature::kXRImageTracking);
- }
+ if (IsFeatureRequested(feature_request_image_tracking)) {
+ DVLOG(2) << __func__
+ << ": image tracking was requested, logging a UseCounter";
+ UseCounter::Count(session->GetExecutionContext(),
+ WebFeature::kXRImageTracking);
+ }
- if (session && status == SessionRequestStatus::kSuccess &&
- IsFeatureRequested(feature_request_hand_input)) {
- DVLOG(2) << __func__ << ": hand input was requested, logging a UseCounter";
- UseCounter::CountWebDXFeature(session->GetExecutionContext(),
- WebDXFeature::kWebxrHandInput);
- }
+ if (IsFeatureRequested(feature_request_hand_input)) {
+ DVLOG(2) << __func__
+ << ": hand input was requested, logging a UseCounter";
+ UseCounter::CountWebDXFeature(session->GetExecutionContext(),
+ WebDXFeature::kWebxrHandInput);
+ }
- if (session && status == SessionRequestStatus::kSuccess &&
- IsFeatureRequested(feature_request_light_estimation)) {
- DVLOG(2) << __func__
- << ": lighting estimation was requested, logging a UseCounter";
- UseCounter::CountWebDXFeature(session->GetExecutionContext(),
- WebDXFeature::kWebxrLightingEstimation);
- }
+ if (IsFeatureRequested(feature_request_light_estimation)) {
+ DVLOG(2) << __func__
+ << ": lighting estimation was requested, logging a UseCounter";
+ UseCounter::CountWebDXFeature(session->GetExecutionContext(),
+ WebDXFeature::kWebxrLightingEstimation);
+ }
- if (session && status == SessionRequestStatus::kSuccess &&
- IsFeatureRequested(feature_request_camera_access)) {
- DVLOG(2) << __func__
- << ": camera access was requested, logging a UseCounter";
- UseCounter::CountWebDXFeature(session->GetExecutionContext(),
- WebDXFeature::kWebxrCamera);
+ if (IsFeatureRequested(feature_request_camera_access)) {
+ DVLOG(2) << __func__
+ << ": camera access was requested, logging a UseCounter";
+ UseCounter::CountWebDXFeature(session->GetExecutionContext(),
+ WebDXFeature::kWebxrCamera);
+ }
+
+ if (IsFeatureRequested(feature_request_anchors)) {
+ DVLOG(2) << __func__ << ": anchors were requested, logging a UseCounter";
+ UseCounter::CountWebDXFeature(session->GetExecutionContext(),
+ WebDXFeature::kWebxrAnchors);
+ }
+
+ if (IsFeatureRequested(feature_request_hit_test)) {
+ DVLOG(2) << __func__ << ": hit test was requested, logging a UseCounter";
+ UseCounter::CountWebDXFeature(session->GetExecutionContext(),
+ WebDXFeature::kWebxrHitTest);
+ }
}
if (session && metrics_recorder) {
@@ -1616,29 +1626,17 @@
// element is already in fullscreen mode, and the session can proceed.
session->SetDOMOverlayElement(query->DOMOverlayElement());
}
-
- if (query->mode() == device::mojom::blink::XRSessionMode::kImmersiveAr) {
- UseCounter::CountWebDXFeature(
- ExecutionContext::From(query->GetScriptState()),
- WebDXFeature::kWebxrAr);
- }
-
- if (anchors_enabled) {
- UseCounter::CountWebDXFeature(
- ExecutionContext::From(query->GetScriptState()),
- WebDXFeature::kWebxrAnchors);
- }
-
- if (hit_test_enabled) {
- UseCounter::CountWebDXFeature(
- ExecutionContext::From(query->GetScriptState()),
- WebDXFeature::kWebxrHitTest);
- }
}
UseCounter::Count(ExecutionContext::From(query->GetScriptState()),
WebFeature::kWebXrSessionCreated);
+ if (query->mode() == device::mojom::blink::XRSessionMode::kImmersiveAr) {
+ UseCounter::CountWebDXFeature(
+ ExecutionContext::From(query->GetScriptState()),
+ WebDXFeature::kWebxrAr);
+ }
+
query->Resolve(session, std::move(metrics_recorder));
}
```
Adds WebDX Use Counters for various WebXR APIs
Starts collecting use counters for the following APIs:
WebxrAnchors
WebxrAr
WebxrCamera
WebxrDepthSensing
WebxrDomOverlays
WebxrHandInput
WebxrHitTest
WebxrLightingEstimation
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |