Граф коммитов

3199 Коммитов

Автор SHA1 Сообщение Дата
arthur.iakab 7e765f798b Backed out 2 changesets (bug 1465060) for build bustages on security/sandbox/linux/reporter/SandboxReporter.cpp
Backed out changeset 7c8905b6b226 (bug 1465060)
Backed out changeset 10446073eca8 (bug 1465060)
2018-06-03 19:25:41 +03:00
Miko Mynttinen 8d9dc85cd4 Bug 1465060 - Part 1: Fix warnings for std::move() use r=froydnj
MozReview-Commit-ID: HpdFXqQdIOO

--HG--
extra : rebase_source : 619d0e0ff63a2453c80f0c4d9beb906d43fa9b01
2018-06-01 17:59:07 +02:00
Andrea Marchesini 7ba8b77e07 Bug 1466023 - Separate FontTableURI and BlobURL, r=qdot
This patch splits FontTableURI and BlobURL in 2 classes:
FontTableURIProtocolHandler and BlobURLProtocolHandler
both under mozilla::dom.

It also removes a memory reporter because that report is already covered by the
BlobURL one.

--HG--
rename : dom/file/nsHostObjectProtocolHandler.cpp => dom/file/BlobURLProtocolHandler.cpp
rename : dom/file/nsHostObjectProtocolHandler.h => dom/file/BlobURLProtocolHandler.h
2018-06-02 15:51:42 +02:00
Emilio Cobos Álvarez 1e9c395548 Bug 1466168: Remove mozilla::Forward in favor of std::forward. r=froydnj
Same approach as the other bug, mostly replacing automatically by removing
'using mozilla::Forward;' and then:

  s/mozilla::Forward/std::forward/
  s/Forward</std::forward</

The only file that required manual fixup was TestTreeTraversal.cpp, which had
a class called TestNodeForward with template parameters :)

MozReview-Commit-ID: A88qFG5AccP
2018-06-02 09:33:26 +02:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Andrew Osmond e76059bf98 Bug 1465496 - Backout part 9 of bug 1462355 to fix talos regressions. r=aosmond 2018-05-30 19:35:40 -04:00
arthur.iakab fb18cb09bd Merge mozilla inbound to central a=merge 2018-05-31 01:05:10 +03:00
Christian Holler 570031d38c Bug 1464202 - Improve and centralize libFuzzer flag management. r=froydnj
MozReview-Commit-ID: HFrQDAZWtpo

--HG--
extra : rebase_source : ab1da001d7e9280fbfb37858505f1d0d0caf7d54
2018-05-24 21:11:46 +02:00
Valentin Gosu 0735c3877c Bug 1456975 - Check fields in nsMozIconURI deserialization. r=agaynor 2018-05-02 14:53:13 +02:00
Andrew Osmond 14b23692e6 Bug 1462355 - Part 9. Lock animated imgFrame objects at creation rather than deferring. r=tnikkel 2018-05-29 08:36:13 -04:00
Andrew Osmond d76ab26901 Bug 1462355 - Part 8. Avoid allocating on the heap in DrawableFrameRef. r=tnikkel
We can easily use Maybe<DataSourceSurface::ScopedMap> instead of
allocated the map on the heap. This does require some minor changes to
ScopedMap to properly support moves, but should be much more efficient.
2018-05-29 08:36:13 -04:00
Andrew Osmond d2e5cfae55 Bug 1462355 - Part 7. Don't hit the SurfaceCache in FrameAnimator::GetCompositedFrame if possible. r=tnikkel
In FrameAnimator::GetCompositedFrame, we call SurfaceCache::Lookup even
when we use the composited frame directly and leave the lookup result
unused. The only value in performing the lookup could be to mark the
surface as used to avoid expiring it too soon, but
FrameAnimator::RequestRefresh should already be doing enough to keep it
alive, if the image isn't locked in the first place.
2018-05-29 08:36:13 -04:00
Andrew Osmond 77b6f542e8 Bug 1462355 - Part 6. Reuse RawAccessFrameRef in FrameAnimator where possible. r=tnikkel
In FrameAnimator::RequestRefresh and AdvanceFrame, we currently create
several RawAccessFrameRef objects to the same frames, either to get
timeouts or perform the blending. With some tweaking, we can avoid
requesting the same frame more than once. This will avoid mutex locks on
the surface provider and the frame itself.
2018-05-29 08:36:12 -04:00
Andrew Osmond 8c7d13e7f7 Bug 1462355 - Part 5. Avoid converting from DrawableFrameRef to RawAccessFrameRef. r=tnikkel
DrawableSurface only exposes DrawableFrameRef to its users. This is
sufficient for the drawing related code in general, but FrameAnimator
really needs RawAccessFrameRef to the underlying pixel data (which may
be paletted). While one can get a RawAccessFrameRef from a
DrawableFrameRef, it requires yet another lock of the imgFrame's mutex.
We can avoid this extra lock if we just allow the callers to get the
right data type in the first place.
2018-05-29 08:36:12 -04:00
Andrew Osmond 8e097f0169 Bug 1462355 - Part 4. Remove imgFrame::GetAnimationData as it is no longer used. r=tnikkel 2018-05-29 08:36:12 -04:00
Andrew Osmond f1dd034aa6 Bug 1462355 - Part 3. Make FrameAnimator use the new imgFrame/RawAccessFrameRef methods. r=tnikkel 2018-05-29 08:36:12 -04:00
Andrew Osmond fdd7908a05 Bug 1462355 - Part 2. Expose imgFrame's data pointers via RawAccessFrameRef. r=tnikkel
RawAccessFrameRef ensures there is a valid data pointer to the pixel
data for the frame. It is a common pattern for users of
RawAccessFrameRef to follow up with a request for the data pointer
shortly after creation. We can avoid an extra lock by exposing this data
pointer from RawAccessFrameRef, and populating it via
imgFrame::LockImageData.
2018-05-29 08:36:12 -04:00
Andrew Osmond 01907fa0e3 Bug 1462355 - Part 1c. Make individual image decoders to use updated Decoder/SurfacePipe methods. r=tnikkel 2018-05-29 08:36:12 -04:00
Andrew Osmond 6c32a5f985 Bug 1462355 - Part 1b. Update Decoder and SurfacePipe plumbing to use updated imgFrame methods. r=tnikkel 2018-05-29 08:36:12 -04:00
Andrew Osmond 5d9ffb0638 Bug 1462355 - Part 1a. Make imgFrame animation parameters threadsafe. r=tnikkel
We currently choose to set the animation parameters (blend method, blend
rect, disposal method, timeout) in imgFrame::Finish instead of
imgFrame::InitForDecoder. The decoders themselves already have access to
the necessary information at the time InitForDecoder is called, so there
is no reason to do this. Moving the configuration to initialization will
allow us to relax the mutex protection on these parameters.

This part simply reorganizes imgFrame, and subsequent parts will
introduce the necessary changes to SurfacePipe and decoders.
2018-05-29 08:36:11 -04:00
Andrew Osmond 644583163d Bug 1462650 - Improve imgTools::EncodeScaledImage performance. r=lsalzman
We should avoiding creating a DrawTarget to create a new
DataSourceSurface when the original surface produced by
RasterImage::GetFrameAtSize matches our requirements in
imgTools::EncodeScaledImage. We should also be using Skia instead of
Cairo.

This patch also fixes a few error conditions where we would not have
unmapped the surface properly.
2018-05-25 09:02:20 -04:00
Andrew Osmond 9b6c64c753 Bug 1382683 - Part 3. Add gtests for SurfaceFilter/Pipe::WritePixelBlocks. r=tnikkel 2018-05-25 06:52:05 -04:00
Andrew Osmond cb1d37e391 Bug 1382683 - Part 2. Switch nsGIFDecoder2 to write pixels in blocks instead of individually. r=tnikkel
nsGIFDecoder2::YieldPixel is sufficiently complex that the optimizer
does not appear to inline it with the rest of the templated methods. As
such there is a high cost to calling it. This patch modifies it to yield
a requested number of pixels before exiting, allowing us to amortize the
cost of calling across a row instead of a pixel. Based on profiling,
this will significantly reduce the time require to decode a frame.
2018-05-25 06:52:03 -04:00
Andrew Osmond 5bcb89ae72 Bug 1382683 - Part 1. Implement SurfacePipe::WritePixelBlocks for faster writing of pixels. r=tnikkel
It has been observed in profiling that the templated methods that write
pixels to an image buffer do not always inline methods properly, leading
to a high cost of writing a single pixel if it is less than trivial. As
such, there is a new SurfacePipe method, WritePixelBlocks, which
requests pixels in blocks. The provided lambda will write up to the
requested number of pixels into the given buffer. WritePixelBlocks
itself will request enough pixels to fill the row, advance the row if
complete and iterate until it is complete or we need more data.
2018-05-25 06:52:01 -04:00
Emilio Cobos Álvarez dd5f25c2f6 Bug 1465107: Cleanup remaining mochitest / reftest / crashtests stylo expectations. r=xidorn
MozReview-Commit-ID: 1IeURcnoESX
2018-05-30 10:03:50 +02:00
Adrian Wielgosik fff55359ea Bug 1460940 - Remove nsIDOMDocument uses in image/. r=bz
MozReview-Commit-ID: HUiegmeFLo4

--HG--
extra : rebase_source : cd6453dc5d708fc5cdc75114d163ea2389423d55
2018-05-11 19:46:15 +02:00
Andrew Osmond 4479d80c10 Bug 1453454 - Improve SourceBuffer support for large encoded image data. r=jrmuizel
Regardless of the size of an encoded image, SourceBuffer::Compact would
try to consolidate all of the chunks into a single chunk. If an image is
quite large, it can be actively harmful to do this, because we want a
very large contiguous chunk of memory for no real reason, and spend
extra time on the main thread doing the memcpy/consolidation.

Instead we now cap out the chunk size at 20MB. If we start allocating
chunks of this size, we will not perform compacting when we have
received all of the data. (Save for realloc'ing the last chunk since it
probably isn't full.)

On a related note, if we hit an out-of-memory condition in the middle of
appending data to the SourceBuffer, we would swallow the error. This is
because nsIInputStream::ReadSegments will succeed if any data was
written. This leaves the SourceBuffer out of sync. We now propogate this
error up properly to the higher levels.

fixup
2018-05-09 09:31:07 -04:00
Andrew Osmond d19566e09c Bug 1454149 - Do not advance animated images which are not displayed. r=tnikkel
All animated images on a page are currently registered with the refresh
driver and advance with the tick refresh. These animations may not even
be in view, and if they are large and thus cause redecoding, cause a
marked increase in CPU usage for no benefit to the user.

This patch adds an additional flag, mCompositedFrameRequested, to the
AnimationState used by FrameAnimator. It is set to true each time the
current animated image frame is requested via
FrameAnimator::GetCompositedFrame. It is set to false each time the
frame is advanced in FrameAnimator::AdvanceFrame (via
FrameAnimator::RequestRefresh). If it is true when
FrameAnimator::RequestRefresh is called, then it will advance the
animation according to the normal rules. If it is false, then it will
set the current animation time to the current time instead of advancing.

This should not cause the animation to fall behind anymore or skip
frames more than it does today. This is because if
FrameAnimator::GetCompositedFrame is not called, then the internal state
of the animation is advancing ahead of what the user sees. Once it is
called, the new frame is far ahead of the previously displayed frame.
The only difference now is that we will display the previous frame for
slightly longer until the next refresh tick.

Note that if an animated image is layerized (should not happen today) or
otherwise uses an ImageContainer, this optimization fails. While we know
whether or not we have an image container, we do not know if anything is
actively using it.
2018-05-09 08:04:20 -04:00
Chris Peterson 71422dcaa9 Bug 1457813 - Part 2: Replace non-asserting NS_PRECONDITIONs with MOZ_ASSERTs. r=froydnj
s/NS_PRECONDITION/MOZ_ASSERT/ and reindent

MozReview-Commit-ID: KuUsnVe2h8L

--HG--
extra : source : c14655ab3df2c9b1465dd8102b9d25683359a37b
2018-04-28 12:50:58 -07:00
shindli c72db9830d Merge mozilla-central to autoland. a=merge CLOSED TREE 2018-04-27 00:44:51 +03:00
Emilio Cobos Álvarez 0faef276ec Bug 1455885: Make the SVG context paint not use a node property, but a member in SVGDocument. r=jwatt
MozReview-Commit-ID: H6SRTsDL5Rh
2018-04-26 17:07:39 +02:00
Kartikaya Gupta fc66c485b6 Bug 1456882 - Enable some passing mochitests on linux64-qr. r=jrmuizel
MozReview-Commit-ID: 5VIHjwx6A2j

--HG--
extra : rebase_source : d986028cff52ba52a58887225e272bf04ad88de3
2018-04-25 11:29:07 -04:00
Andrew Osmond 4b77101e8d Bug 1444537 - Part 4. Add gtests for AnimatedFrameBuffer for redecode errors. r=tnikkel 2018-04-24 13:51:38 -04:00
Andrew Osmond 5f0abb12dc Bug 1444537 - Part 3. Fix how redecode errors could cause animated image state inconsistencies. r=tnikkel
We can discard frames from an animated image if the memory footprint
exceeds the threshold. This will cause us to redecode frames on demand
instead. However decoders can fail to produce the same results on
subsequent runs due to differences in memory pressure, etc. If this
happens our state can get inconsistent. In particular, if we keep
failing on the first frame, we end up in an infinite loop on the decoder
thread.

Since we don't have the owning image to signal, as we had to release our
reference to it after the first pass, we can do little but stop decoding.
From the user's perspective, the animation will come to a stop.
2018-04-24 13:51:35 -04:00
Boris Zbarsky 2b6097ae6d Bug 1455055 part 1. Convert nsIDOMEventListener to taking an Event, not an nsIDOMEvent. r=masayuki
This does no cleanup other than what's needed to compile.  Cleanup coming up in
later patches.

MozReview-Commit-ID: 3sOnkj71n09
2018-04-20 00:49:29 -04:00
Jeff Muizelaar 4bb17dde09 Bug 1450015. Enable blob invalidation by default. r=gankro 2018-04-17 21:20:51 -04:00
Andrew Osmond bb48e74870 Bug 1445479 - Ensure we teardown requests on image cache validation failure paths. r=tnikkel
If an imgCacheValidator object is destroyed without calling
imgCacheValidator::OnStartRequest, or imgRequest::Init fails in
OnStartRequest, we left the bound proxies hanging on an update. Now we
cancel the new request, and bind the validating proxies to said request
to ensure their listeners fail gracefully.
2018-04-17 14:42:35 -04:00
Cosmin Sabou 6c47714197 Backed out 2 changesets (bug 1444537) for causing crashes on test_discardFramesAnimatedImage.html. a=backout
Backed out changeset 0d23d74448c8 (bug 1444537)
Backed out changeset 07f5d48b90cb (bug 1444537)
2018-04-15 02:40:30 +03:00
Andrew Osmond 25213cc7ab Bug 1444537 - Part 4. Add gtests for AnimatedFrameBuffer for redecode errors. r=tnikkel 2018-04-13 10:58:54 -04:00
Andrew Osmond 2e06ac3032 Bug 1444537 - Part 3. Fix how redecode errors could cause animated image state inconsistencies. r=tnikkel
We can discard frames from an animated image if the memory footprint
exceeds the threshold. This will cause us to redecode frames on demand
instead. However decoders can fail to produce the same results on
subsequent runs due to differences in memory pressure, etc. If this
happens our state can get inconsistent. In particular, if we keep
failing on the first frame, we end up in an infinite loop on the decoder
thread.

Since we don't have the owning image to signal, as we had to release our
reference to it after the first pass, we can do little but stop decoding.
From the user's perspective, the animation will come to a stop.
2018-04-13 10:58:52 -04:00
Sebastian Hengst 0819f35e51 Backed out 4 changesets (bug 525063) on request from Andi. a=backout
Backed out changeset 516c4fb1e4b8 (bug 525063)
Backed out changeset 6ff8aaef2866 (bug 525063)
Backed out changeset bf13e4103150 (bug 525063)
Backed out changeset d7d2f08e051c (bug 525063)
2018-04-13 16:01:28 +03:00
Tristan Bourvon a3a77c0312 Bug 525063 - Initialize uninitialized class attributes in m-c. r=ehsan 2018-04-10 21:11:02 +02:00
Ciure Andrei 3f4a118829 Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE 2018-04-11 12:00:35 +03:00
Kartikaya Gupta 0f89486f32 Bug 1452658 - Mark many reftests as fuzzy instead of failing for windows-qr. r=jrmuizel
MozReview-Commit-ID: BDvtV6trKkK

--HG--
extra : rebase_source : 0591564f6cea5c782de6baecc24c3defcef0c4fb
2018-04-10 17:48:16 -04:00
Nika Layzell 0c3ba13e4c Bug 1437167 - Part 1: Stop using PRIntervalTime as the argument to CondVar::Wait and Monitor::Wait, r=mstange, r=froydnj 2018-04-10 17:49:47 -04:00
Kartikaya Gupta 9a9c13a09f Bug 1344350 - Mark reftests failing with webrender on windows. r=jrmuizel
Many of these could probably be fuzzed but in the interests of getting
the reftest suite turned on sooner I'm doing a blanket fails-if. This
covers all the reftests where there is more fuzz with webrender on
windows than any of existing annotations account for. In some cases the
fuzz is only a few pixels more than the equivalent Linux fuzz already
annotated, but I'll clean that up in a future bug.

MozReview-Commit-ID: IaKarbnL46d

--HG--
extra : rebase_source : 71889340305b0b12fa8eace722e42bb3faf14419
2018-04-06 11:58:43 -04:00
Emilio Cobos Álvarez 3c69ce8551 Bug 1451405: Notify debug-only image observers off a script-runner. r=bz
MozReview-Commit-ID: ARn8d2Rxp13
2018-04-05 11:45:40 +02:00
Christoph Kerschbaumer a929955d1f Bug 1439713 - Change nsIContentPolicy shouldLoad to take an <uri, loadInfo> pair instead of the various args. r=bz 2018-03-29 12:16:23 +02:00
Tom Ritter 449237fc51 Bug 1378552 - Reduce the liklihood of inadvertently misusing NullPrincipal::Create(). r=ckerschb
NullPrincipal::Create() (will null OA) may cause an OriginAttributes bypass.
We change Create() so OriginAttributes is no longer optional, and rename
Create() with no arguments to make it more explicit about what the caller is doing.

MozReview-Commit-ID: 7DQGlgh1tgJ
2018-03-22 13:36:20 -05:00
Xidorn Quan 1962625a79 Bug 1448728 part 1 - Make popular headers not include nsWindowSizes.h. r=njn
MozReview-Commit-ID: EC5J9Im3gfu

--HG--
extra : source : 9fa9209aeeb00009143c5c21f21210c93184e61f
2018-03-28 10:44:49 +11:00
Andrew Osmond c3618a0b1b Bug 1444537 - Part 2. Shutting down the decode pool should make animated decoders bail early. r=tnikkel
When we shutdown the decode pool threads, it does not do a simple join
with the main thread. It will actually process the main thread event
loop, which can cause a bad series of events. The refresh tick could
still be running and advancing our animated images, causing the animated
decoders to continue running, which in turn prevents the decoder threads
from finishing shutting down, and the main thread from joining them.

Now we check on each frame whether or not the decoder should just stop
decoding more frames because the decode pool has started shutdown. If it
has, it will stop immediately.
2018-03-27 10:57:01 -04:00
Andrew Osmond a21bbb89ce Bug 1444537 - Part 1. Ensure discarding of animated image frames is clear. r=tnikkel
We should only attempt to discard animation image frames after passing
the frame threshold on the very first pass on the animation. Redecodes
are already in the correct state, as it will discard frames as it
advances the animation. This patch makes it clear what it should be
doing when, but there should be no functional change.
2018-03-27 10:56:48 -04:00
Andrew Osmond 3e285b7bbc Bug 1409440. r=tnikkel 2018-03-27 09:01:14 -04:00
Miko Mynttinen 65c6bee9d6 Bug 1445302 - Replace TArray.RemoveElementAt(TArray.Length() - 1) pattern with TArray.RemoveLastElement() or TArray.PopLastElement() r=froydnj
MozReview-Commit-ID: rGjabnP2iz

--HG--
extra : rebase_source : 1ef6c5ce028ac9ebd9f3176d57835c43fe46bada
2018-03-13 14:51:33 +01:00
Valentin Gosu eccc344c51 Bug 1442242 - Make the constuctors of URI implementations private r=mayhemer
MozReview-Commit-ID: LonNnZyJjVO

--HG--
extra : rebase_source : ceefc81a669b17f68f193fce5f172f9f2268a998
2018-03-20 23:23:31 +01:00
Emilio Cobos Álvarez 48957d62c0 Bug 1446954: Cleanup !stylo and styloVsGecko test expectations. r=xidorn
MozReview-Commit-ID: J2glxiCWBVn
2018-03-20 11:29:51 +01:00
Emilio Cobos Álvarez 3d911916c0 Bug 1446954: Remove ImageCacheKey styloToGecko hack. r=xidorn
MozReview-Commit-ID: LiHH5T4XlnI
2018-03-20 11:29:42 +01:00
Valentin Gosu af5eeff2e3 Bug 1442239 - Make URI deserialization (nsISerializable.read) happen via nsIURIMutator only r=mayhemer
* Deserialization now only happens via a mutator
* The CID for URI implementations actually returns the nsIURIMutator for each class
* The QueryInterface of mutators implementing nsISerializable will now act as a finalizer if passed the IID of an interface implemented by the URI it holds

MozReview-Commit-ID: H5MUJOEkpia

--HG--
extra : rebase_source : 01c8d16f7d31977eda6ca061e7889cedbf6940c2
2018-03-19 20:22:32 +01:00
Andreea Pavel e5950c0d39 Backed out 2 changesets (bug 1442239) for xpcshell failures at widget/tests/unit/test_taskbar_jumplistitems.js on a CLOSED TREE
Backed out changeset 513cd669aca1 (bug 1442239)
Backed out changeset aef4c73f736f (bug 1442239)
2018-03-19 21:19:26 +02:00
Valentin Gosu f0c7a1ae13 Bug 1442239 - Make URI deserialization (nsISerializable.read) happen via nsIURIMutator only r=mayhemer
* Deserialization now only happens via a mutator
* The CID for URI implementations actually returns the nsIURIMutator for each class
* The QueryInterface of mutators implementing nsISerializable will now act as a finalizer if passed the IID of an interface implemented by the URI it holds

MozReview-Commit-ID: H5MUJOEkpia

--HG--
extra : rebase_source : 8ebb459445cab23288a6c4c86e4e00c6ee611e34
2018-03-08 13:35:10 +01:00
Andrew Osmond 4986917db0 Bug 1435291 - Part 2. Make background SVGs use WebRender instead of fallback. r=jrmuizel 2018-03-14 14:19:13 -04:00
Andrew Osmond c887fd120c Backed out changeset 7f0409a405f2 (bug 1435291). 2018-03-13 16:03:59 -04:00
Andrew Osmond 785d1f4d18 Bug 1435291 - Part 2. Make background SVGs use WebRender instead of fallback. r=jrmuizel 2018-03-13 15:59:05 -04:00
Lee Salzman d3709cc4e9 Bug 1444506 - part 6 - fuzz for Skia m66 update. r=jrmuizel 2018-03-12 16:37:10 -04:00
Timothy Nikkel 848546ef41 Bug 1443232. Fix test.
Convert it from reftest to crashtest (we never needed it to be a reftest).
2018-03-09 15:27:25 -06:00
Timothy Nikkel 7fee1119c7 Bug 1443232. Disable reftest for now to investigate why it doesn't work on android.
Seems to be a test problem, not a problem with the patch.
2018-03-08 21:10:04 -06:00
Timothy Nikkel 7d6982559e Bug 1443232. Don't insert frames into our AnimationFrameBuffer that we consider in error and unusable. r=aosmond
After decoding the first frame we allocate the second frame, but before it finishes we encounter an error, Decoder::PostError is called it aborts the second frame and decrements the frame count. But AnimationSurfaceProvider::CheckForFrameAtTerminalState just asks for the current frame ref from the decoder (which it never cleared) and inserts that.

The condition that we use from the decoder to decide to report a new frame is mFinishedNewFrame (via TakeCompleteFrameCount), however this doesn't directly correspond to mFrameCount. So we create a new bool on the Decoder to track when there is a frame that we can take.

This didn't cause any problems before but now we have tighter coupling between the list of frames the AnimationSurfaceProvider has and what FrameAnimator expects.

Another possible fix would be to clear the current frame ref in PostError, but the only place we clear the current frame is when we allocate the new frame and we have the mImageData pointer still around that decoders could theorhetically use to do final processing on the last partial frame.
2018-03-08 17:33:04 -06:00
Nathan Froyd 87bc1e3aa8 Bug 1443932 - part 2 - lower the default stack size for image decoder threads; r=tnikkel
These threads should not have deep stacks, and as we can have a number
of them running simultaneously, it's beneficial to set the stack size to
something reasonably low.
2018-03-07 20:33:17 -05:00
Cosmin Sabou ed1b2a8736 Backed out 4 changesets (bug 1437167) for build bustages on nsUpdateDriver.cpp and WindowsMessageLoop.cpp on a CLOSED TREE.
Backed out changeset b98740e7c639 (bug 1437167)
Backed out changeset 4476e8f51fa6 (bug 1437167)
Backed out changeset c79dc40faa41 (bug 1437167)
Backed out changeset b608d2dcbb86 (bug 1437167)
2018-03-06 00:09:46 +02:00
Nika Layzell 262be91f75 Bug 1437167 - Part 1: Stop using PRIntervalTime as the argument to CondVar::Wait and Monitor::Wait, r=mstange, r=froydnj
MozReview-Commit-ID: BN18I8Q6c7S
2018-03-05 16:00:00 -05:00
Valentin Gosu 34872b6d20 Bug 1441688 - Remove nsIIPCSerializableURI.Deserialize r=mayhemer
MozReview-Commit-ID: 8gwX3vSKWNX

--HG--
extra : rebase_source : a2c21a7e66aa8be3c2e345ca64feea967b380491
2018-03-05 04:14:44 +01:00
Valentin Gosu f102a081b2 Bug 1434163 - Make all nsIURI attributes readonly r=mayhemer
MozReview-Commit-ID: KtjO8VWjPF5

--HG--
extra : rebase_source : 061a6db73e36b3a0b3732d44379bbc10e8268f9a
2018-02-27 00:07:48 +01:00
Andrew Osmond bd5718ece1 Bug 1442037 - Fix an incorrect assert in DecoderFactory::CloneAnimationDecoder. r=tnikkel
When cloning an animated image decoder, we asserted that
Decoder::HasAnimation was true. This is incorrect because if the decoder
has yet to complete the metadata decoding, or it has but only finds out
the image is animated when it discovers the second frame, then we will
try to clone a valid animated image decoder, but fail the assertion.
Instead, this patch verifies the image type supports animations.
2018-03-01 19:38:58 -05:00
Andrew Osmond fefdf99992 Bug 523950 - Part 10. Add mochitest for when we discard frames from an animated image. r=tnikkel
With the previous parts, for large animated images, we will now discard
previous frames after we reach the threshold. This mochitest configures
a very low threshold, such that it will trigger on a small animated
image. It then verifies that we are already to loop the animation a
couple of times.
2018-02-28 13:34:53 -05:00
Andrew Osmond 39b30d06d4 Bug 523950 - Part 9. Integrate AnimationSurfaceProvider with AnimationFrameBuffer. r=tnikkel 2018-02-28 13:34:53 -05:00
Andrew Osmond 01f0dbdb83 Bug 523950 - Part 8. Add gtests for AnimationFrameBuffer. r=tnikkel 2018-02-28 13:34:52 -05:00
Andrew Osmond 984f23cd9c Bug 523950 - Part 7. Add AnimatedFrameBuffer to manage storage and decoding of frames in an animation. r=tnikkel 2018-02-28 13:34:52 -05:00
Andrew Osmond 97d3a61a18 Bug 523950 - Part 6. Add DecoderFactory::CloneAnimationDecoder to clone an existing image decoder. r=tnikkel
Used later in the patch series, this API allows one to get an identical
decoder to the one given, but decodes from the beginning.
2018-02-28 13:34:52 -05:00
Andrew Osmond 54898d5d6c Bug 523950 - Part 5. Pass the currently displayed frame of an animation to its decoder. r=tnikkel
When we need to recreate an animated image decoder because it was
discarded, the animation may have progressed beyond the first frame.
Given that later in the patch series we need FrameAnimator to be driving
the decoding more actively, it simplifies its role by making it assume
the initial state of the decoder matches its initial state. Passing in
the currently displayed frame allows the decoder to advance its frame
buffer (and potentially discard unnecessary frames), such that when the
animation actually wants to advance as it normally would, the decoder
state matches what it would have been if it had never been discarded.
2018-02-28 13:34:52 -05:00
Andrew Osmond 646219b1e7 Bug 523950 - Part 4. Expose new surface provider APIs that will help drive animation decoding. r=tnikkel
Note that AnimationSurfaceProvider will override these methods to give a
proper implementation in a later patch in this series. For now, they are
mostly stubbed, using the default implementation from ISurfaceProvider.

They focus on the main operations we perform on an animation:

1) Progressing through the animation, e.g. advancing a frame. If we
don't decode the whole animation up front, we need to know at the
decoder level where we are in the display of the animation.

2) Restarting an animation from the beginning. This is a specialized
case of the above, where we want to skip explicitly advancing through
the remaining frames and instead restart at the beginning. The decoder
may have already discarded the earliest frames and must start redecoding
them.

3) Knowing whether or not the decoder is still active, e.g. can we be
missing frames.
2018-02-28 13:34:52 -05:00
Andrew Osmond 28978c4f66 Bug 523950 - Part 2. Expose image decoder type and SourceBuffer to owners. r=tnikkel
Later in the patch series, we use the new APIs to facilitate cloning of
an existing decoder. This is useful when you want to redecode the same
image with the exact same configuration but from the very beginning.
2018-02-28 13:34:52 -05:00
Andrew Osmond 1a18b79e50 Bug 523950 - Part 1. Do some unified build accounting, missing headers and namespaces. r=tnikkel 2018-02-28 13:34:51 -05:00
Florian Quèze 6df7549a3e Bug 1433175 - semi-automated indent fix, r=Mossop. 2018-02-28 18:51:34 +01:00
Florian Quèze c714053d73 Bug 1433175 - scripted patch to replace Components.classes[, Components.interfaces.nsI, Components.utils. and Components.results. with Cc, Ci, Cu and Cr, r=Mossop. 2018-02-28 18:51:33 +01:00
Nathan Froyd b5d5605a54 Bug 1441584 - part 2 - declare some URI classes final; r=valentin 2018-02-27 20:13:57 -05:00
Nathan Froyd c821ec9351 Bug 1441584 - part 1 - declare inner URI Mutator classes final; r=valentin
For documentation purposes and to assist the compiler.
2018-02-27 20:13:57 -05:00
Joel Maher 7ebe98f725 Bug 1438838 - download-svg-1[ce].html fails on windows 10. r=gbrown 2018-02-23 11:20:21 -05:00
Andrew Osmond cd7cf0fad3 Bug 1427639 - Part 2. Fix misleading image memory reporting on Android. r=tnikkel
The shared memory handle reporting has been generalized to be an
external handle reporting. This is used for both shared memory, and for
volatile memory (on Android.) This will allow us to have a better sense
of just how many handles are being used by images on Android.

Additionally we were not properly reporting forced heap allocated
memory, if we were putting animated frames on the heap. This is because
we used SourceSurfaceAlignedRawData without implementing
AddSizeOfExcludingThis.
2018-02-22 14:26:29 -05:00
Andrew Osmond b18fc05e36 Bug 1427639 - Part 1. Add preferences to control image frame allocations in volatile memory or the heap. r=tnikkel
image.mem.volatile.min_threshold_kb is the minimum buffer allocation for
an image frame in KB before it will use volatile memory. If it is less
than it will use the heap. This only is set to > 0 on Android.

image.mem.animated.use_heap forces image frames to use the heap if it is
for an animated image. This is only enabled for Android, and was
previously a compile time option also for Android.
2018-02-22 14:26:29 -05:00
Jonathan Kingston 8afc412494 Bug 1435733 - Upgrade mixed display content pref. r=baku,ckerschb,francois,mayhemer
MozReview-Commit-ID: ETIgVF3zhRu

--HG--
extra : rebase_source : e4c59f50584158f4b31527347b10424b56692fa1
2018-02-05 15:37:27 +00:00
Robert Longson 728a3f36fc Bug 1435477 - Make the SVG dom code use the WebIDL constants from the bindings r=jwatt 2018-02-18 15:53:13 +00:00
Chris Peterson fe5cd3d5d9 Bug 1436263 - Part 3: Remove `virtual` from final virtual function declarations. r=froydnj
MozReview-Commit-ID: 8pjYjEvQF42

--HG--
extra : rebase_source : 5eb0bea2ef5f06a811b4f3daf57ce8720f12dd07
2018-02-08 21:22:43 -08:00
Chris Peterson 0129d900f3 Bug 1436263 - Part 2: Replace `override final` virtual function specifiers with just `final`. r=froydnj
MozReview-Commit-ID: 70gt5SUu4Dv

--HG--
extra : rebase_source : 71912c6bde22aaed01e70615a4ee794a36e70d0e
extra : source : 1c22d4c65d70b797ee3e963ec426c90e1f89b5e3
2018-02-05 22:50:00 -08:00
Andrew Osmond 6529a8c077 Bug 1437886 - Prevent shared surfaces from being used without WebRender. r=nical
Move the initialization of SharedSurfacesParent from the compositor
thread creation to mirror the other WebRender-specific components, such
as the render thread creation. Now it will only be created if WebRender
is in use. Also prevent shared surfaces from being used by the image
frame allocator, even if image.mem.shared is set -- there is no purpose
in allowing this at present. It was causing startup crashes for users
who requested image.mem.shared and/or WebRender via gfx.webrender.all
but did not actually get WebRender at all. Surfaces would get allocated
in the shared memory, try to register themselves with the WR render
thread, and then crash since that thread was never created.
2018-02-16 09:50:40 -05:00
Andrew Osmond 5380fd8762 Bug 1436247 - Part 3. Fix image/DecodePool.h inclusions. r=tnikkel 2018-02-13 06:43:31 -05:00
Andrew Osmond 4318a7dc60 Bug 1436247 - Part 2. Shutdown idle image decoder threads after the configured timeout. r=tnikkel
The image decoding thread pool can grow to be quite large, up to 32
threads, depending on the number of processors on the system. If the
user is not actively browsing, these threads are occupying resources
which could be reused elsewhere. After the timeout period, it will
release up to half of the threads in the pool.
2018-02-13 06:43:31 -05:00
Andrew Osmond 852af60687 Bug 1436247 - Part 1. Spawn image decoder threads on demand, rather than at startup. r=tnikkel
Currently imagelib's DecodePool spawns the maximum number of threads
during startup, based on the number of processors. This patch changes it
to spawn a single thread on startup (which cannot fail), and more up to
the maximum as jobs are added to the queue. A thread will only be
spawned if there is a backlog present when a new job is added. This
typically results in fewer threads allocated in the parent process, as
well as deferred spawning in the content processes.
2018-02-13 06:43:30 -05:00
Andrew Osmond f6a1a2419b Bug 1438207 - Finalize the current frame of an ICO decoder correctly. r=tnikkel
Originally we attempted to finalize the current frame from the contained
decoder in nsICODecoder::FinishResource. This is wrong because we
haven't acquired the frame from the contained decoder yet. This happens
in nsICODecoder::GetFinalStateFromContainedDecoder, and so
imgFrame::Finalize call should be moved there. This was causing us to
use fallback image sharing with WebRender after a GPU process crash,
instead of shared surfaces, because it can't get a new file handle for
the surface data until we have finished writing all of the image data.
2018-02-16 06:27:36 -05:00
Andrew Osmond 71ec66dad0 Backed out changeset 2ffed9c081fa (bug 1437886) for test bustage on a CLOSED TREE. r=backout 2018-02-15 10:03:42 -05:00
Andrew Osmond ddb7905e51 Bug 1437886 - Prevent shared surfaces from being used without WebRender. r=nical
Move the initialization of SharedSurfacesParent from the compositor
thread creation to mirror the other WebRender-specific components, such
as the render thread creation. Now it will only be created if WebRender
is in use. Also prevent shared surfaces from being used by the image
frame allocator, even if image.mem.shared is set -- there is no purpose
in allowing this at present. It was causing startup crashes for users
who requested image.mem.shared and/or WebRender via gfx.webrender.all
but did not actually get WebRender at all. Surfaces would get allocated
in the shared memory, try to register themselves with the WR render
thread, and then crash since that thread was never created.
2018-02-15 09:26:05 -05:00