Commit Graph

605 Commits

Author SHA1 Message Date
Simon Giesecke
9d2e516112 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-03 14:54:18 +00:00
Markus Stange
ef731aae4a Bug 1656331 - Create a TickReasons bitfield and add the tick reasons to the RefreshDriverTick profiler marker. r=smaug
Example profile: https://share.firefox.dev/2P7QpqL

Differential Revision: https://phabricator.services.mozilla.com/D85458
2020-07-31 23:06:10 +00:00
Markus Stange
7f0ffeda3d Bug 1656331 - Capture a cause callstack in EnsureTimerStarted() and insert the RefreshDriverTick marker in a different place. r=smaug
We can have markers with empty cause stacks, if we keep the timer running
without calling EnsureTimerStarted() again.

Differential Revision: https://phabricator.services.mozilla.com/D85457
2020-07-31 23:04:54 +00:00
Markus Stange
940f8d8681 Bug 1656331 - Factor out nsRefreshDriver::HasReasonToTick() and ShouldKeepTimerRunningWhileWaitingForFirstContentfulPaint(). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D85456
2020-07-31 23:04:30 +00:00
Chris Liu
4b316ab74a Bug 1494838 - Add a profiler marker with a cause stack for paints (view manager flushes). r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D85455
2020-08-01 00:55:57 +00:00
Emilio Cobos Álvarez
47634b1c9e Bug 1653011 - Simplify and make WeakPtr<Derived> usable and compact. r=froydnj,sg,geckoview-reviewers,jgilbert,kvark,snorp
Having two classes in the inheritance chain inherit from SupportsWeakPtr
now won't compile, but you can use WeakPtr<Derived> when any base class
inherits from SupportsWeakPtr.

Differential Revision: https://phabricator.services.mozilla.com/D83674
2020-07-23 14:51:46 +00:00
Simon Giesecke
a69d79b6db Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Simon Giesecke
5c191910fa Bug 1645339 - Use range-based for with nsTObserverArray in layout/base. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D79497
2020-06-17 15:02:57 +00:00
Kenny Levinsen
05fb686a45 Bug 1641033 - nsRefreshDriver vsync observer should always post task to main thread. r=jrmuizel
nsRefreshDriver's NotifyVsync method had some slightly convoluted logic: Based on the thread it is called from, it would guess whether it is called from a vsync source, in which case it would schedule itself onto the main thread, or from the self-scheduled task, in which case it would perform work.

This just splits the two: NotifyVsync only takes care of VsyncSource, and schedules a task that calls the tick logic. This also allows Wayland to run the VsyncSource off the main thread.

Differential Revision: https://phabricator.services.mozilla.com/D77044
2020-06-04 10:43:19 +00:00
Simon Giesecke
1620f338ff Bug 1626570 - Improve handling of copying arrays in layout/base/. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D72354
2020-05-05 10:40:24 +00:00
Razvan Maries
09f4754f5a Backed out 10 changesets (bug 1626570) for build bustages. CLOSED TREE
Backed out changeset a3f17d392234 (bug 1626570)
Backed out changeset 5247e1ddd5d6 (bug 1626570)
Backed out changeset c339fd44c9f8 (bug 1626570)
Backed out changeset 4c69a4c013b3 (bug 1626570)
Backed out changeset e85450d69351 (bug 1626570)
Backed out changeset 793f978248b3 (bug 1626570)
Backed out changeset 68b4c2418d83 (bug 1626570)
Backed out changeset 52d0911d4ad3 (bug 1626570)
Backed out changeset a7d4e3a59ee3 (bug 1626570)
Backed out changeset 6c06d397a5d2 (bug 1626570)
2020-05-05 13:37:08 +03:00
Simon Giesecke
78d86ffa44 Bug 1626570 - Improve handling of copying arrays in layout/base/. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D72354
2020-05-05 09:51:07 +00:00
Cameron McCormack
9326b31020 Bug 1629350 - Don't warn when trying to get a widget-specific vsync source. r=lsalzman
This tends to happen in content processes only, but per the commit
message from bug 1542808, we don't provide a widget-specific vsync
source in content processes currently.

Differential Revision: https://phabricator.services.mozilla.com/D70641
2020-04-14 18:42:30 +00:00
Tom Tung
2363cf75eb Bug 1586761 - P7 - Revert a few incorrect changes on P2; r=tjr
P2 removed IsTimerPrecisionReductionEnabled and thus removed the check for RFP
pref. While most ReduceTimePrecision* functions are fine with that because
GetTimerPrecisionType checks that, the two ReduceTimePrecision*RFP functions
miss the check.

This patch mainly cover the check for that two functions and rename them to
*RFPOnly since they only use RFP when the pref is on.

Depends on D64324

Differential Revision: https://phabricator.services.mozilla.com/D66734
2020-04-07 07:36:52 +00:00
Tom Tung
6783ea5ae8 Bug 1586761 - P2 - Introduce new TimerPrecisionTypes and a set of new Reduce methods to decide the TimerPrecisionType in the nsRFPService; r=tjr
To support checking CrossOriginIsolated in performance.now(), we need to:
- Add new types to TimerPrecisionType for nsRFPService
  - System, HighResAllowed are added
  - All is renamed to Normal
- Introduce a set of Reduce methods which require isSystemPrincipal and
CrossOriginIsolated to be passed and decide the TimerPrecisionType later
  - Original Reduce methods should only be called when callsites know the
  TimerPrecisionType. Otherwise, they should call the new methods.
- The following patches will use new methods

Differential Revision: https://phabricator.services.mozilla.com/D63293
2020-03-25 14:09:55 +00:00
Emilio Cobos Álvarez
66ff09f01e Bug 1624829 - Use FunctionRef for various Enumerate* callbacks. r=edgar
This avoids a bunch of ugly casts and void pointers, without much overhead
(unlike std::function or such).

Differential Revision: https://phabricator.services.mozilla.com/D68182
2020-03-26 12:44:47 +00:00
Olli Pettay
ca98081dca Bug 1617111, reduce the time forced to be used outside animation frame callbacks, r=farre
Differential Revision: https://phabricator.services.mozilla.com/D67123
2020-03-18 08:31:44 +00:00
Simon Giesecke
e613597e90 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in layout. r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D66016
2020-03-17 09:38:32 +00:00
Kenny Levinsen
f56fa476f4 Bug 1614212 - Migrate global VsyncSource users correctly on frame rate change r=sotaro
CompositorVsyncDispatcher holds a reference to the VsyncSource, so it must be informed on change.

Differential Revision: https://phabricator.services.mozilla.com/D65878
2020-03-16 23:24:39 +00:00
Coroiu Cristina
285b8c2029 Backed out changeset ef75f461147c (bug 1614212) for GTest failures 2020-03-16 03:52:15 +02:00
Kenny Levinsen
e6a04c95cf Bug 1614212 - Migrate global VsyncSource users correctly on frame rate change r=sotaro
CompositorVsyncDispatcher holds a reference to the VsyncSource, so it must be informed on change.

Differential Revision: https://phabricator.services.mozilla.com/D65878
2020-03-16 00:05:20 +00:00
Mihai Alexandru Michis
7d8922750d Backed out changeset 8bc3cd786136 (bug 1614212) for causing leaks.
CLOSED TREE
2020-03-13 19:21:34 +02:00
Kenny Levinsen
8de81e9a78 Bug 1614212 - Migrate global VsyncSource users correctly on frame rate change r=sotaro
CompositorVsyncDispatcher holds a reference to the VsyncSource, so it must be informed on change.

Differential Revision: https://phabricator.services.mozilla.com/D65878
2020-03-13 16:04:36 +00:00
Boris Zbarsky
8b76288352 Bug 1535530. Fix can-run-script analysis to not mishandle on-stack refs to RefPtrs. r=andi,masayuki
The key here is to test the type of the variable declaration for being a
smartptr type, instead of testing the type of the variable _use_.

Differential Revision: https://phabricator.services.mozilla.com/D65581
2020-03-06 09:57:45 +00:00
Steven MacLeod
8d105719a5 Bug 1597482 - Replace nsIDocShellTreeItem with BrowsingContext in GetProfileTimelineSubDocShells. r=mstange
`GetProfileTimelineSubDocShells` was using nsIDocShellTreeItem to walk the
DocShells that are visible and recording profile markers. This change switches
to using `BrowsingContext` for the walk, and ignores OOP iframes as they aren't
painting in the current process.

Differential Revision: https://phabricator.services.mozilla.com/D63960
2020-02-27 19:26:40 +00:00
Sylvestre Ledru
230ce836cb Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan,kvark
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D63787
2020-02-24 15:33:38 +00:00
Olli Pettay
d5e05ed084 Bug 1615607 - Consider to always treat high priority runnables as the highest priority runnables, r=farre
The patch removes the tad odd interleave behavior from the main thread and makes RefreshDriver to give
at least a tiny bit time for non-high priority tasks.
Given the recent change to have similar block-until behavior in child and parent process, this should work
consistently in all the processes.

Differential Revision: https://phabricator.services.mozilla.com/D63098
2020-02-18 16:03:37 +00:00
Olli Pettay
5c56d72f78 Bug 1506376, make parent process vsync handling to be blocked the same way as in child process r=farre
Because the code becomes more generic, the following renames are done:
mLastChildTick is renamed to mLastTick
mLastProcessedTickInChildProcess is renamed to mLastProcessedTick

To clarify which member variables are used in parent process only
mRefreshTickLock is renamed to mParentProcessRefreshTickLock and
new variables mRecentParentProcessVsync and mPendingParentProcessVsync are
added. (mRecentVsync and mRecentVsyncId don't anymore have the different
behavior in parent and child processes)

The basic idea is to keep the vsync compression in parent process in
NotifyVsync.
(In child processes it is handled by IPDL/IPC compression).
The main functionality change is in ParentProcessVsyncNotifier::Run.
That method doesn't anymore call mObserver->TickRefreshDriver(...)
but mObserver->NotifyParentProcessVsync(...), which then calls
NotifyVsync(...) on the main thread. That way parent process gets the
same vsync block-until behavior as what child process has.

Depends on D62032

Differential Revision: https://phabricator.services.mozilla.com/D62033
2020-02-14 16:28:22 +00:00
Bogdan Tara
f366befbe0 Backed out 3 changesets (bug 1506376) for xpcshell failures CLOSED TREE
Backed out changeset fe7215eefa28 (bug 1506376)
Backed out changeset 621ec02db41c (bug 1506376)
Backed out changeset adbd602610a3 (bug 1506376)
2020-02-14 17:07:49 +02:00
Olli Pettay
4566d54433 Bug 1506376, make parent process vsync handling to be blocked the same way as in child process r=farre
Because the code becomes more generic, the following renames are done:
mLastChildTick is renamed to mLastTick
mLastProcessedTickInChildProcess is renamed to mLastProcessedTick

To clarify which member variables are used in parent process only
mRefreshTickLock is renamed to mParentProcessRefreshTickLock and
new variables mRecentParentProcessVsync and mPendingParentProcessVsync are
added. (mRecentVsync and mRecentVsyncId don't anymore have the different
behavior in parent and child processes)

The basic idea is to keep the vsync compression in parent process in
NotifyVsync.
(In child processes it is handled by IPDL/IPC compression).
The main functionality change is in ParentProcessVsyncNotifier::Run.
That method doesn't anymore call mObserver->TickRefreshDriver(...)
but mObserver->NotifyParentProcessVsync(...), which then calls
NotifyVsync(...) on the main thread. That way parent process gets the
same vsync block-until behavior as what child process has.

Depends on D62032

Differential Revision: https://phabricator.services.mozilla.com/D62033
2020-02-14 13:55:35 +00:00
Simon Giesecke
9bcfd47601 Bug 1611415 - Prefer using std::move over forget. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980
2020-02-13 14:38:48 +00:00
shindli
6bb3487209 Backed out changeset 0c982bc69cb3 (bug 1611415) for causing build bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr CLOSED TREE 2020-02-12 20:13:29 +02:00
Simon Giesecke
d45525793f Bug 1611415 - Applied FixItHints from mozilla-non-std-move. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980
2020-02-12 17:24:41 +00:00
Emilio Cobos Álvarez
b0cffa7664 Bug 1608931 - followup: fix subtle unintended behavior change.
This can fire in some tests that take over the refresh driver via script.

Differential Revision: https://phabricator.services.mozilla.com/D60620
2020-01-22 01:13:15 +00:00
Emilio Cobos Álvarez
cb80dc288e Bug 1608931 - Ensure we tick the refresh driver at least once after calling IntersectionObserver.observe. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D60015
2020-01-21 23:21:32 +00:00
Nazım Can Altınova
6c84e9b60a Bug 1609708 - Rename PROFILER_TRACING to PROFILER_TRACING_MARKER. r=gerald
Depends on D60229

Differential Revision: https://phabricator.services.mozilla.com/D60231
2020-01-17 21:29:15 +00:00
Nazım Can Altınova
bdfc56f158 Bug 1590700 - Rename "Scripts" marker to "requestAnimationFrame callbacks". r=gerald
"Scripts" wasn't making any sense for this marker and it was nearly imposssible
to understand. It should be "requestAnimationFrame callbacks" instead.

Differential Revision: https://phabricator.services.mozilla.com/D60229
2020-01-17 21:26:55 +00:00
Eric Rahm
daeb56f35b Bug 1606187 - Part 2b: Update users of nsClassHashtable to handle UniquePtr differences r=KrisWright,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D59042
2020-01-13 19:18:56 +00:00
Hiroyuki Ikezoe
48585fe72f Bug 1596317 - Use CallState for SubDocEnumFunc. r=smaug
`true` -> `CallState::Continue`
`false` -> `CallState::Stop`

Differential Revision: https://phabricator.services.mozilla.com/D57437
2019-12-19 07:58:45 +00:00
Bogdan Tara
e59c8c65fb Backed out 7 changesets (bug 1596317) for causing build bustages CLOSED TREE
Backed out changeset 0d3208fcb948 (bug 1596317)
Backed out changeset fe5554dc4115 (bug 1596317)
Backed out changeset 019de59cbc93 (bug 1596317)
Backed out changeset f4851472b087 (bug 1596317)
Backed out changeset a984cf515db8 (bug 1596317)
Backed out changeset d0da5bf9b4d4 (bug 1596317)
Backed out changeset abe5f2030dd9 (bug 1596317)
2019-12-19 06:49:39 +02:00
Hiroyuki Ikezoe
5575d95de1 Bug 1596317 - Use CallState for SubDocEnumFunc. r=smaug
`true` -> `CallState::Continue`
`false` -> `CallState::Stop`

Differential Revision: https://phabricator.services.mozilla.com/D57437
2019-12-19 04:16:10 +00:00
Emilio Cobos Álvarez
9034de5dd0 Bug 1603313 - Subdocument enum callbacks should take a reference. r=bzbarsky
As they can never take null.

Differential Revision: https://phabricator.services.mozilla.com/D56843
2019-12-14 05:08:39 +00:00
Masayuki Nakano
65448595a7 Bug 1543315 - part 18: Mark PresShell::FireResizeEvent() as MOZ_CAN_RUN_SCRIPT r=smaug
It dispatches a DOM event so that it should be marked as `MOZ_CAN_RUN_SCRIPT`.

Differential Revision: https://phabricator.services.mozilla.com/D55801
2019-12-11 12:17:17 +00:00
Boris Zbarsky
2df1df0176 Bug 1517588. Use nsIPrincipal::IsSystemPrincipal instead of nsContentUtils::IsSystemPrincipal r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D53067
2019-12-05 04:44:32 +00:00
Kenny Levinsen
baf565c6cb Bug 1542808 - Implement widget-local VsyncSource for Wayland windows. r=stransky,lsalzman
Lets Wayland sessions run vsync off wayland surface frame callbacks by creating
an interface for widgets to return a local VsyncSource, if applicable.

This interface is currently used for the compositor, and for refresh drivers
in the parent process. It is not yet used for vsync in content processes.

Differential Revision: https://phabricator.services.mozilla.com/D28430
2019-11-27 00:21:33 +00:00
Sylvestre Ledru
0f8c6db00f Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D54686
2019-11-26 14:35:02 +00:00
Ehsan Akhgari
c5ab356460 Bug 1592599 - Switch nsIDocShell.getDocShellEnumerator() away from using nsISimpleEnumerator; r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D51100
2019-11-18 20:11:58 +00:00
Dan Glastonbury
8452f4bce4 Bug 1578319: Telemetry for total time spent in layout per Refresh Driver tick. r=heycam
Differential Revision: https://phabricator.services.mozilla.com/D44427
2019-11-01 04:33:48 +00:00
Daosheng Mu
c9815568a2 Bug 1578851 - Using VRManagerChild to check isPresenting to skip painting in nsRefreshDriver. r=rbarker,imanol,mstange
VRManager only be accessible in the parent or GPU process. So, in the tab process, isPresenting() will always return false. In WebVR immersive mode, we need to skip layer painting and don't need to wait for painting because the compositing is already done in WebGL.

Differential Revision: https://phabricator.services.mozilla.com/D48119
2019-10-24 19:58:15 +00:00
Tom Ritter
33e6664d8b Bug 1585589 - Do not reduce the precision of the requestAnimationFrame timestamp if we are in the System Principal Context r=birtles
Differential Revision: https://phabricator.services.mozilla.com/D48118
2019-10-03 22:53:28 +00:00