New issue
Advanced search Search tips

Issue 807070 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 161072



Sign in to add a comment

Web Locks API: query() if no locks are held never resolves / DCHECKS

Project Member Reported by jsb...@chromium.org, Jan 29 2018

Issue description

Reported by @ralphch0 - if navigator.locks.query() is called and no locks are held, the returned promise is never resolved.

From code inspection, we drop the callback on the floor. This would likely DCHECK in a debug build since all mojo requests need responses.

 

Comment 1 by jsb...@chromium.org, Jan 29 2018

Blockedon: 161072

Comment 2 by jsb...@chromium.org, Jan 29 2018

Blockedon: -161072
Blocking: 161072

Comment 3 by jsb...@chromium.org, Jan 30 2018

Components: Blink>Storage
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 31 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/41cfa934f0cc71ae5ef3b59622add0a6b963fcb1

commit 41cfa934f0cc71ae5ef3b59622add0a6b963fcb1
Author: Joshua Bell <jsbell@chromium.org>
Date: Wed Jan 31 03:18:19 2018

Web Locks API: query() needs callback even if origin is empty

Issue reported by canary dogfooder: the promise returned by
navigator.locks.query() would never resolve if no locks were held. In
debug builds, this would DCHECK. The code would early-exit without
running the callback in this case - a no-no.

Added fix (return empty arrays) and test case.

Bug:  807070 
Change-Id: Ib4abd5d861c5ab259f7ea00355aebd006438508e
Reviewed-on: https://chromium-review.googlesource.com/891584
Commit-Queue: Joshua Bell <jsbell@chromium.org>
Reviewed-by: Victor Costan <pwnall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533184}
[modify] https://crrev.com/41cfa934f0cc71ae5ef3b59622add0a6b963fcb1/content/browser/locks/lock_manager.cc
[add] https://crrev.com/41cfa934f0cc71ae5ef3b59622add0a6b963fcb1/third_party/WebKit/LayoutTests/http/tests/locks/query-empty.html

Comment 5 by pwnall@chromium.org, Jan 31 2018

Status: Fixed (was: Started)

Sign in to add a comment