Addressed all 7 comments and synced the CL description; PTAL for re-LGTM (code changes reset Code-Review+1).
Adds a `ShouldSkipAsyncObservationCallback` overload toSergio VasquezThe description still names ShouldSkipAsyncObservationCallback, which went away when this became PostActionObservationMode. Could you update it and mention kSkipAll and what it leaves out of the result?
Done — updated the CL description to name PostActionObservationMode / PostActionObservationModeCallback and document what kSkipAll omits and preserves.
PostActionObservationModeCallback post_action_observation_mode);Sergio Vasquezsuper nit: could the result callback stay last, with the mode callback before it? IMO makes more sense for the PerformActionsCallback to remain last. Also the param name reads like a value, maybe post_action_observation_mode_callback?
Done — moved post_action_observation_mode_callback before callback and updated the parameter name (and downstream call site in crrev.com/c/8893465).
// Same as above, and if `post_action_observation_mode` is non-null,Sergio VasquezCould the comment say when this runs? It's skipped for rejected, paused and task-gone batches, and since it runs synchronously right before observation starts, it shouldn't stop the task or destroy the wrapper (the controller CHECKs the task exists).
Done — updated the doc comment to document synchronous execution before observation, the skipped batch cases (rejected, paused, task-gone), and the precondition not to stop/destroy the task or wrapper.
if (observation_mode == PostActionObservationMode::kSkipAll) {Sergio Vasqueznit: could we log a journal entry here saying observation was skipped? Otherwise an OK result with no tabs or windows has nothing in the journal explaining why.
Done — added a SkipTabObservation journal log entry on the kSkipAll path.
std::move(callback).Run(BuildBaseActionsResult(start_time, action_results));Sergio VasquezCould we add a test for kSkipAll with a failing action, checking the result still has the error code and failed index? That seems like the main case for draining. A test that the callback isn't run when the batch ends paused would be good too.
Done — added PerformActionsObservationModeSkipAllPreservesFailingActionResult (verifying action_result and index_of_failed_action == 1) and PerformActionsObservationModeNotCalledWhenBatchEndsPaused.
PerformActionsEvaluatesPostActionObservationModeAtCompletion) {Sergio VasquezThis test covers four behaviors and the override cases are only really checked by the shared journal compare at the end, so a failure won't say which case broke. Could we split it into one test per behavior (override to collect all, override to skip async, callback runs after accept, skip all, unknown task)?
Done — split into 7 single-behavior tests (OverridesToCollectAll, OverridesToSkipAsync, EvaluatedAfterActionsAccepted, SkipAllBypassesTabObservation, SkipAllPreservesFailingActionResult, NotCalledWhenTaskUnknown, NotCalledWhenBatchEndsPaused).
EXPECT_TRUE(future.Get().tabs().empty());Sergio VasquezIIUC tabs and windows would be empty here even on the normal path, since the fixture has no browser windows and the action is a wait. Could the skip-all test assert that no TabObservationController journal entry was recorded instead?
Done — the kSkipAll tests now assert recorder.GetEntries("TabObservationController").empty() and !recorder.GetEntries("SkipTabObservation").empty().
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Rebased onto main (zero code diff vs PS10); re-running CQ+1 after the ToT glic_invoke_browsertest.cc revert.
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[actor] Add dynamic observation mode to ActorKeyedServiceProtoWrapper
Adds a `PostActionObservationModeCallback` overload to
`ActorKeyedServiceProtoWrapper::PerformActions()` with a 3-state
`PostActionObservationMode` (`kCollectAll`, `kSkipAsync`, `kSkipAll`) so
callers can choose post-action observation collection behavior at
action-batch completion time rather than batch start time.
When the callback returns `kSkipAll`, `OnPerformActionsFinished()` logs
a `SkipTabObservation` journal entry, bypasses `TabObservationController`
completely (avoiding crashed-tab reloads, observation retries, and
observation histograms), and returns an action-only `ActionsResult`.
That result omits `tabs`, `windows`, and observation latency steps while
preserving `action_result`, `index_of_failed_action`, `error_message`,
`extra_information`, script/JS tool results, and action/stabilization
latency steps. Existing overloads delegate with a null callback,
preserving `actions.skip_async_observation_collection()`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |