The SurfaceCache can hold the first frame of a "static" decode as well as the animated frames in two seperate entries. We only care about what happens to the animated frames, so ignore OnSurfaceDiscarded for anything else.
To accomplish this we must pass the SurfaceKey to OnSurfaceDiscarded.
Currently, JS sampling has major problems.
- JS sampling is enabled for all JS threads from the thread that runs
locked_profiler_start() -- currently only the main thread -- but the JS
engine can't handle enabling from off-thread, and asserts. This makes
profiling workers impossible in a debug build.
- No JS thread will be JS sampled unless enableJSSampling() is called, but that
only happens in locked_profiler_start(). That means any worker threads
created while the profiler is active won't be JS sampled.
- Only the thread that runs locked_profiler_stop() -- currently only the main
thread -- ever calls disableJSSampling(). This means that worker threads that
start being JS sampled never stop being JS sampled.
This patch fixes these three problems in the following ways.
- locked_profiler_start() now sets a flag in PseudoStack that indicates
JS sampling is desired, but doesn't directly enable it. Instead, the JS
thread polls that flag and enables JS sampling itself when it sees the flag
is set. The polling is done by the interrupt callback. There was already a
flag of this sort (mJSSampling) but the new one is better.
This required adding a call to profiler_js_operation_callback() to the
InterruptCallback() in XPCJSContext.cpp. (In comparison, the
InterruptCallback() in dom/workers/RuntimeService.cpp already had such a
call.)
- RegisterCurrentThread() now requests JS sampling of a JS thread when the
profiler is active, the thread is being profiled, and JS sampling is enabled.
- locked_profiler_stop() now calls stopJSSampling() on all live threads.
The patch makes the following smaller changes as well.
- Renames profiler_js_operation_callback() as profiler_js_interrupt_callback(),
because "interrupt callback" is the standard name (viz.
JS_AddInterruptCallback()).
- Calls js::RegisterContextProfilingEventMarker() with nullptr when stopping
JS sampling, so that ProfilerJSEventMarker won't fire unnecessarily.
- Some minor formatting changes.
--HG--
extra : rebase_source : 372f94c963a9e5b2493389892499b1ca205ebc2f
They each have a single call site, and this code makes makes more sense in
platform.cpp than as PseudoStack methods because it's mostly dealing with gPS.
--HG--
extra : rebase_source : 84d8c7d8989f0e02b238d591ece2be110cbbcb1a
This patch enables flake8 rule E111: "indentation is not a multiple of four"
in toolkit/components/telemetry by removing the relative E111 entry from
toolkit/components/telemetry/.flake8 and fixing the files for which the E111
error was reported.
MozReview-Commit-ID: EOVcsllJNJK
--HG--
extra : rebase_source : 9cadb7d9214ed8f242bf6e6a30769c009a502b40
It does almost entirely different things depending on whether we are setting or
clearing the context.
--HG--
extra : rebase_source : 356445957968e1d055f4b717c65476fa765d8bd5
PseudoContext::sampleContext() is always called immediately after
profiler_get_pseudo_stack(). This patch introduces profiler_set_js_context()
and profiler_clear_js_context(), which replace the profiler_get_pseudo_stack()
+ sampleContext() pairs. This takes us a step closer to not having to export
PseudoStack outside the profiler.
--HG--
extra : rebase_source : 8558d1600eafd395cc696d31f3d21fb52a1a74b0
An interesting intermittent condition not previously handled.
We were incorrectly assuming that we always had a decode promise pending when a drain was requested.
If a change of content occurred when resuming from a waiting for data condition: we would have stalled forever as the waiting promise would never have been resolved even after new data was appended.
MozReview-Commit-ID: BQSRSHYqTSe
--HG--
extra : rebase_source : e091969ce35728cd3ded40161eaaa117df2c6886
https://hg.mozilla.org/mozilla-central/file/34c6c2f302e7b48e3ad2cec575cbd34d423a9d32/dom/media/MediaFormatReader.cpp#l2835
NotifyDataArrived() is dispatched again if |mNotifyDataArrivedPromise.Exists()| which will then be dispatched again
recursively until mNotifyDataArrivedPromise is completed. This is a waste of CPU cycles.
We can use a dirty flag to note we should update buffer ranges again when the current update is done.
MozReview-Commit-ID: 6hInhGKnXJE
--HG--
extra : rebase_source : 71aa2c16112428c34def094515e37aa1f028a3fc
inSearchLoop is referenced from nowhere, as a result, we don't need to get its timer event labeled.
MozReview-Commit-ID: 5fxg38WD9dQ
--HG--
extra : rebase_source : a72f150e15605e604e969c725ed4a23168bda1b4
Ctrl+Space causes WM_CHAR of ' '. On the other native applications, you can input ' ' with this key combination though, we shouldn't allow this because we need to remove Ctrl and Alt modifier state at dispatching keypress event for the limitation of TextEditor but this is important key combination for custom shortcut keys.
So, when Ctrl or Alt key is pressed but it doesn't change the inputting character, i.e., the character can be inputted without Ctrl or Alt, we shouldn't remove those modifier state from eKeyPress event.
MozReview-Commit-ID: 7omLvNdQWzW
--HG--
extra : rebase_source : 66d5015567799c489d925ac2419358913f808d63
Omitting the RTT when it is not available breaks a lot of tests (as jesup warned).
I am going to fix the RTT behavior and the tests in bug 1344970, for now RTT will
be zero when unavailable.
MozReview-Commit-ID: 9x3eQfbM3ZT
--HG--
extra : rebase_source : f8d46d7232455a3038fd99ffb6cc14111c44a794
This is more of a workaround than a real fix, but the old code wasn't working
for non-main threads either, and we'd like to change the way this information
is computed anyway (bug 1340714) and then we won't need CheckResponsivenessTask
any more.
MozReview-Commit-ID: FGiomjwpk3z
--HG--
extra : rebase_source : 95fc57c0622fdbaa928700a971a4ce839ad92797
Override OnScrollPositionChanged() in ScrollState because we want to update
carets during scrolling in subframes without APZ.
Due to the observation in bug 1273045 comment 8, we do not distinguish
PositionChangedResult::NotChanged and PositionChangedResult::Changed.
Instead, we always update caret even if its position is not changed.
To avoid excessive CaretStateChangedEvents are dispatched in
OnScrollPositionChanged(), we add IsScrollStarted to distinguish whether
OnScrollStart() is called or not.
MozReview-Commit-ID: KNi9Mct4dSk
--HG--
extra : rebase_source : 61d29fb0e1b6b91971217d3f45a791c456fa4f07
Part 2 is going to add a new hint which will use with RespectOldAppearance.
Hence this patch.
Remove #include "mozilla/WeakPtr.h" and "nsWeakReference.h" because they're
not used in the header.
MozReview-Commit-ID: KiNv0M0v8iO
--HG--
extra : rebase_source : 0969fc5accf11ac69bc97e3a51569b063172ffe3
VideoData doesn't care what's in aInfo but display size and aPicture are unused.
MozReview-Commit-ID: IBqq8Rm8dM4
--HG--
extra : rebase_source : 10e2390f87925ef9179d28d86240f68a35c6c6d4
Bug 1341255 changed PseudoStack::mStack to a js::ProfileEntry[], so we don't
need this assertion any more.
--HG--
extra : rebase_source : 7fcb5218db56b5a9409d81ff67d653e9db37414e