Skip to content

Commit

Permalink
shared-highlight: Remove invalid DCHECK
Browse files Browse the repository at this point in the history
This DCHECK is wrong since RequestSelector is a mojo method called from
the browser process. While requesting a selector should only happen from
a selection, this happens asynchronously so there's no guarantee the
frame will still have a selection by the time it receives this message.

Remove the DCHECK since we don't rely on selection in this method
anyway, it was used to start generation prior to receiving this message.

Bug: 1318211
Change-Id: I2ed9aaf92a7515e5d179d11fc2706b293b49f8c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3767646
Reviewed-by: Sebastien Seguin-Gagnon <sebsg@chromium.org>
Commit-Queue: David Bokan <bokan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1026527}
  • Loading branch information
bokand authored and Chromium LUCI CQ committed Jul 20, 2022
1 parent e2f1107 commit dddc3bf
Showing 1 changed file with 0 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ void TextFragmentHandler::Cancel() {
void TextFragmentHandler::RequestSelector(RequestSelectorCallback callback) {
DCHECK(shared_highlighting::ShouldOfferLinkToText(
GURL(GetFrame()->GetDocument()->Url())));
DCHECK(!GetFrame()->Selection().SelectedText().IsEmpty());

response_callback_ = std::move(callback);
selector_ready_status_ =
Expand Down

0 comments on commit dddc3bf

Please sign in to comment.