Skip to content

Commit

Permalink
Arc: Call callback in OnRequestTextSelectionActions when result is empty
Browse files Browse the repository at this point in the history
This CL lets OnRequestTextSelectionActions() call `callback` even when
text selection actions result is empty.
By using std::vector::data, it won't crash even when actions is empty.

(cherry picked from commit 8e12616)

Bug: 1406041
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4159743
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Reviewed-by: Alan Zhao <ayzhao@google.com>
Commit-Queue: Alan Zhao <ayzhao@google.com>
Cr-Original-Commit-Position: refs/heads/main@{#1092499}
Change-Id: I4d86fabe6967ac7c6776c6277ec75d365c602953
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4165882
Reviewed-by: David Jacobo <djacobo@chromium.org>
Cr-Commit-Position: refs/branch-heads/5481@{#297}
Cr-Branched-From: 130f3e4-refs/heads/main@{#1084008}
  • Loading branch information
elkurin authored and Chromium LUCI CQ committed Jan 14, 2023
1 parent 4a2729c commit f35d7d2
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void ArcIntentHelperMojoAsh::OnRequestTextSelectionActions(
std::vector<mojom::TextSelectionActionPtr> actions) {
size_t actions_count = actions.size();
auto converted_actions = std::vector<TextSelectionAction*>(actions_count);
TextSelectionAction** converted_actions_ptr = &converted_actions[0];
TextSelectionAction** converted_actions_ptr = converted_actions.data();
base::RepeatingClosure barrier_closure = base::BarrierClosure(
actions_count, base::BindOnce(
[](std::vector<TextSelectionAction*> actions,
Expand Down

0 comments on commit f35d7d2

Please sign in to comment.