Closed Bug 1219150 Opened 4 years ago Closed 4 years ago

Detect whether we are currently blocking a user-initiated interaction

Categories

(Toolkit :: Performance Monitoring, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla45
Tracking Status
firefox45 --- fixed

People

(Reporter: Yoric, Assigned: Yoric)

References

Details

Attachments

(1 file)

This, with bug 1219145, would let us decrease further false positives.
Boris, I know that we can detect whether an event is user-initiated. Can you point me towards the code that does that?
Flags: needinfo?(bzbarsky)
EventStateManager::IsHandlingUserInput(), perhaps?

And a scriptable API at http://mxr.mozilla.org/mozilla-central/source/dom/interfaces/base/nsIDOMWindowUtils.idl#1670
Flags: needinfo?(bzbarsky)
`EventStateManager::IsHandlingUserInput()` looks like a good candidate, indeed. It does cause a call the the clock, so we don't want to call it too often, though.

If we are willing to accept a few more false positives, `static int32_t EventStateManager::sUserInputEventDepth` could provide a good approximation, except in case of nested event loops.
Bug 1219150 - EventStateManager::{LatestUserInputStart, UserInputCount};r?smaug

To detect slow behaviors, it is useful to find out whether a user
input was handled between two instants.

This patch introduces EventStateManager::UserInputCount, which lets
client code determine whether user input was handled between two
points of execution, and EventStateManager::LatestUserInputStart,
which lets client code find out when the altest user input was
handled.
Attachment #8694720 - Flags: review?(bugs)
Comment on attachment 8694720 [details]
MozReview Request: Bug 1219150 - EventStateManager::{LatestUserInputStart, UserInputCount};r=smaug

Now I'm lost... didn't I review this for Bug 1186491
Attachment #8694720 - Flags: review?(bugs)
Sorry, I must have made a mistake with MozReview. This is the right bug.
Attachment #8694720 - Attachment description: MozReview Request: Bug 1219150 - EventStateManager::{LatestUserInputStart, UserInputCount};r?smaug → MozReview Request: Bug 1219150 - EventStateManager::{LatestUserInputStart, UserInputCount};r=smaug
Comment on attachment 8694720 [details]
MozReview Request: Bug 1219150 - EventStateManager::{LatestUserInputStart, UserInputCount};r=smaug

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/26841/diff/1-2/
Comment on attachment 8694720 [details]
MozReview Request: Bug 1219150 - EventStateManager::{LatestUserInputStart, UserInputCount};r=smaug

https://reviewboard.mozilla.org/r/26841/#review24427

Accidentally reviewed as part of bug 1186491.
Attachment #8694720 - Flags: review+
Assignee: nobody → dteller
https://hg.mozilla.org/mozilla-central/rev/badf9e19d881
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla45
You need to log in before you can comment on or make changes to this bug.