Commit Graph

85 Commits

Author SHA1 Message Date
Valentin Gosu
c7d9b630cb Bug 1552176 - Add nsIRequest.set/getTRRMode r=dragana
* Makes it possible to selectively enable TRR for pbmode/container/window/etc

Differential Revision: https://phabricator.services.mozilla.com/D48363

--HG--
extra : moz-landing-system : lando
2020-01-07 20:20:38 +00:00
Andreas Farre
9dcf7d5237 Bug 1561715 - Part 1: Remove unused functionality in SchedulerGroup. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D55638

--HG--
extra : moz-landing-system : lando
2019-12-11 14:48:41 +00:00
Bogdan Tara
80377e90ee Backed out 6 changesets (bug 1552176) for causing Hazard bustages CLOSED TREE
Backed out changeset c79b90bae420 (bug 1552176)
Backed out changeset 4b970cc771ca (bug 1552176)
Backed out changeset de7aa0eaf4c8 (bug 1552176)
Backed out changeset c8e692a40cd3 (bug 1552176)
Backed out changeset 68882d1eccac (bug 1552176)
Backed out changeset 692e5e51e19e (bug 1552176)
2019-11-11 12:11:36 +02:00
Valentin Gosu
4fe6130ec3 Bug 1552176 - Add nsIRequest.set/getTRRMode r=dragana
* Makes it possible to selectively enable TRR for pbmode/container/window/etc

Differential Revision: https://phabricator.services.mozilla.com/D48363

--HG--
extra : moz-landing-system : lando
2019-11-10 17:11:41 +00:00
Bogdan Tara
8f38f4a3fb Backed out 6 changesets (bug 1552176) for bustages complaining about ServiceWorkerManager.cpp CLOSED TREE
Backed out changeset bff9110e434e (bug 1552176)
Backed out changeset ac8f8a6dbd98 (bug 1552176)
Backed out changeset 8dd630e7534a (bug 1552176)
Backed out changeset 7ce9e220cdb9 (bug 1552176)
Backed out changeset ee9911acfcd4 (bug 1552176)
Backed out changeset 652b3bd6848d (bug 1552176)
2019-11-08 22:18:05 +02:00
Valentin Gosu
adfeaf25f5 Bug 1552176 - Add nsIRequest.set/getTRRMode r=dragana
* Makes it possible to selectively enable TRR for pbmode/container/window/etc

Differential Revision: https://phabricator.services.mozilla.com/D48363

--HG--
extra : moz-landing-system : lando
2019-11-08 17:13:05 +00:00
Noemi Erli
853acdf360 Backed out 5 changesets (bug 1552176) for causing multiple build bustages CLOSED TREE
Backed out changeset 203060e4af95 (bug 1552176)
Backed out changeset b52f0ff800c8 (bug 1552176)
Backed out changeset 9f8d159fe252 (bug 1552176)
Backed out changeset 751b518e08fa (bug 1552176)
Backed out changeset a11ffd474c0c (bug 1552176)
2019-11-02 23:20:28 +02:00
Valentin Gosu
5528771952 Bug 1552176 - Add nsIRequest.set/getTRRMode r=dragana
* Makes it possible to selectively enable TRR for pbmode/container/window/etc

Differential Revision: https://phabricator.services.mozilla.com/D48363

--HG--
extra : moz-landing-system : lando
2019-11-02 20:42:42 +00:00
Andrea Marchesini
ee29b15f6b Bug 1554847 - Improve cross-origin checks in canvas API - imgIRequest.hadCrossOriginRedirects, r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D32791

--HG--
extra : moz-landing-system : lando
2019-06-04 06:31:42 +00:00
Coroiu Cristina
73edc6621b Backed out 4 changesets (bug 1554847) for wpt failures at /service-workers/service-worker/fetch-canvas-tainting-video-cache.https.html
Backed out changeset 17e36d139ac2 (bug 1554847)
Backed out changeset 101bd1c2d688 (bug 1554847)
Backed out changeset 3ff9a221f3e5 (bug 1554847)
Backed out changeset 946e4d9420dd (bug 1554847)
2019-06-04 03:24:42 +03:00
Andrea Marchesini
1fa1039026 Bug 1554847 - Improve cross-origin checks in canvas API - imgIRequest.hadCrossOriginRedirects, r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D32791

--HG--
extra : moz-landing-system : lando
2019-06-03 09:54:14 +00:00
Timothy Nikkel
64306c8162 Bug 1377457. Only apply locks to the image if SetHasImage has been called. r=aosmond
This was observed in an intermittent failure of image/test/mochitest/test_discardAnimatedImage.html. What happened was:

1) Document::MaybePreLoadImage was called for the images in the test.
2) imgRequest::OnDataAvailable is called on at least one of the images. This creates the RasterImage, so any proxy for this imgRequest will now return the image via GetImage(). imgRequest::OnDataAvailable also queues the FinishPreparingForNewPartRunnable back to the main thread to call OnImageAvailable on the progress tracker on the main thread.
3) We get the actual LoadImage calls for the images of the document. We create new proxies for the existing imgRequests. imgRequestProxy::Init calls mBehaviour->SetOwner(aOwner), which sets mOwnerHasImage to true because the progress tracker has an mImage (the one we created above).
4) We get a call to LockImage, this gets forwarded to the RasterImage because mOwnerHasImage is true and we can access the image.
5) The FinishPreparingForNewPartRunnable finally runs on the main thread. The OnImageAvailable notification from the progress tracker ends up in imgRequestProxy::SetHasImage. imgRequestProxy::SetHasImage applies our local count mLockCount to the RasterImage, even though we've already forwarded one of those LockImage calls to the image. LockImage calls are now unbalanced and the image will always remain locked.

The fix is simple. Only apply the Lock/Unlock calls if the FinishPreparingForNewPartRunnable has hit the main thread (ie ignore an image we can access until this happens).

Differential Revision: https://phabricator.services.mozilla.com/D29326

--HG--
extra : moz-landing-system : lando
2019-05-01 23:05:47 +00:00
Andrew Osmond
dbfad894d9 Bug 1501794 - Implement img decode API. r=bzbarsky,tnikkel
The img decode API allows a web author to request that an image be
decoded at its intrinsic size and be notified when it has been
completed. This is useful to ensure an image is ready to display before
adding it to the DOM tree -- this will help reduce flickering.

Differential Revision: https://phabricator.services.mozilla.com/D11362
2019-04-02 08:56:54 -04:00
Olli Pettay
cf64822527 Bug 1519567, use medium high priority queue for imglib notifications, r=tnikkel
--HG--
extra : rebase_source : e78679b1bec411508291c7ce5f9c2600d1fe5c90
2019-03-01 15:11:56 +02:00
Andrew Osmond
bc9d7000be Bug 1527085 - Ensure we invalidate when the image request changes. r=jrmuizel
When the underlying image request (imgIRequest) changes for an image, we
need to ensure that we invalidate the cached WebRenderImageData such that
the image container stored therein is updated to be for the correct
image. This gets a little tricky because some display items store both
the current and previous images, and choose to display the latter if the
former is not yet ready. We also don't know what image the image
container belongs to. As such, we now compare the producer ID of the
current frame in the image container, to the expected producer ID of the
current image request. If they don't match, we must regenerate the
display list.

Differential Revision: https://phabricator.services.mozilla.com/D19699
2019-02-15 09:24:21 -05:00
Emilio Cobos Álvarez
d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Sylvestre Ledru
265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Andrew McCreight
837f0af066 Bug 1493737 - Fix many trivial calls to do_QueryInterface r=smaug
If class A is derived from class B, then an instance of class A can be
converted to B via a static cast, so a slower QI is not needed.

Differential Revision: https://phabricator.services.mozilla.com/D6861

--HG--
extra : moz-landing-system : lando
2018-10-01 21:38:01 +00:00
Dana Keeler
364a010e05 bug 748809 - remove nsIAssociatedContentSecurity and nsISecurityInfoProvider r=mayhemer,jrmuizel
nsIAssociatedContentSecurity and nsISecurityInfoProvider are unused as of
bug 832834, so this patch removes them.

Differential Revision: https://phabricator.services.mozilla.com/D5693

--HG--
extra : moz-landing-system : lando
2018-09-13 17:13:43 +00:00
Nicholas Nethercote
2fcd08a173 Bug 1486690 - Rename NS_str{,}dup and remove unnecessary checks after calls to them. r=glandium
The 'x' prefix makes it clearer that these are infallible.

A couple of nsJSID methods are now also infallible.

--HG--
extra : rebase_source : fcce44a00212d6d341afbf3827b31bd4f7355ad5
2018-08-28 15:58:54 +10:00
Emilio Cobos Álvarez
59ff5de1a2 Bug 1474900: Assert there are no pending locks when destroying the image proxy. r=tnikkel 2018-08-07 12:54:15 +02:00
Chris Peterson
2afd829d0f Bug 1469769 - Part 6: Replace non-failing NS_NOTREACHED with MOZ_ASSERT_UNREACHABLE. r=froydnj
This patch is an automatic replacement of s/NS_NOTREACHED/MOZ_ASSERT_UNREACHABLE/. Reindenting long lines and whitespace fixups follow in patch 6b.

MozReview-Commit-ID: 5UQVHElSpCr

--HG--
extra : rebase_source : 4c1b2fc32b269342f07639266b64941e2270e9c4
extra : source : 907543f6eae716f23a6de52b1ffb1c82908d158a
2018-06-17 22:43:11 -07:00
Andrew Osmond
594cd79ec7 Bug 920630 - Part 4. Change rest of imagelib to use nsIURI directly instead of ImageURL. r=tnikkel 2018-06-05 20:42:57 -04: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
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
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
Josh Matthews
19738f789f Bug 1436743 - Dispatch events via the docgroup rather than the tabgroup when possible. r=mystor 2018-02-08 15:54:00 -05:00
Andrew Osmond
e68d0fd3d2 Bug 1383682 - Part 3. Prevent imgRequestProxy from leaking the current state when validating. r=tnikkel
There are two other means from which a caller can get the current state
which originally ignored validation -- GetImageStatus and
StartDecodingWithResult. These methods are used by layout in some
circumstances to decide whether or not the image is ready to display. As
observed in some web platform tests, in particular
css/css-backgrounds-3/background-size-031.html, we may actually validate
and purge the cache for images under test. The state given by the
aforementioned methods was misleading, because validation changed it.
Now they take into account validation, and do not imply any particular
state while validation is in progress.
2018-02-07 07:27:28 -05:00
Andrew Osmond
b1c05068b8 Bug 1383682 - Part 2. Rename IProgressObserver::SetNotificationsDeferred to make purpose clear. r=tnikkel
IProgressObserver::SetNotificationsDeferred is now used just for
ProgressTracker to track when there is a pending notification for
an observer. It has been renamed to MarkPendingNotify and
ClearPendingNotify to make a clear distinction.
2018-02-07 07:27:27 -05:00
Andrew Osmond
dab9b6216c Bug 1383682 - Part 1. Split off imgRequestProxy notification deferrals for validation. r=tnikkel
When cache validation is in progress, imgRequestProxy defers its
notifications to its listener until the validation is complete. This is
because the cache may be discarded, and the current state will change.
It attempted to share the same flags with notification deferrals used by
ProgressTracker to indicate that there is a pending notification, but
this has problematic/confusing. Hence this patch creates dedicated flags
for notification deferrals due to cache validation.
2018-02-07 07:27:27 -05:00
Samael Wang
326d642792 Bug 1406253 - Part 1: Rename imgIRequest.currentURI to finalURI to prevent confusion. r=bz
The "current URL" in the spec:
https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-currentsrc
maps to imgIRequest.URI, not currentURI.

Rename imgIRequest.currentURI to finalURI to prevent such confusion.

MozReview-Commit-ID: CjBh2V4z8K9

--HG--
extra : rebase_source : 01277d16ef12845e12cc846f9dd4a21ceeca283b
2017-11-13 16:31:24 +08:00
Noemi Erli
e90c67896c Backed out 3 changesets (bug 1406253)for build bustage in dom/base/nsCopySupport.cpp r=backout on a CLOSED TREE
Backed out changeset 284f3cc2880c (bug 1406253)
Backed out changeset aecb3d509a39 (bug 1406253)
Backed out changeset 9ce01198e8a1 (bug 1406253)
2017-11-20 13:34:29 +02:00
Samael Wang
a22b447e84 Bug 1406253 - Part 1: Rename imgIRequest.currentURI to finalURI to prevent confusion. r=bz
The "current URL" in the spec:
https://html.spec.whatwg.org/multipage/embedded-content.html#dom-img-currentsrc
maps to imgIRequest.URI, not currentURI.

Rename imgIRequest.currentURI to finalURI to prevent such confusion.

MozReview-Commit-ID: CjBh2V4z8K9

--HG--
extra : rebase_source : d3047aed22f116ff9a74099b646a84e597388673
2017-11-13 16:31:24 +08:00
Jonathan Watt
7c5d39a558 Bug 1417021 - Fix various non-unified build errors in imagelib. r=aosmond 2017-10-24 23:22:55 +01:00
Andrew Osmond
a230c70963 Bug 1416774 - Ensure that imgRequestProxy::CancelAndForgetObserver removes itself from the cache validator. r=tnikkel
An imgRequestProxy may defer notifications when it needs to block on an
imgCacheValidator. It may also be cancelled before the validator has
completed its operation, but before this change, we did not remove the
request from the set of proxies, imgCacheValidator::mProxies. When the
deferral was completed, it would assert to ensure each proxy was still
expecting a deferral before issuing the notifications. Cancelling a
request can actually reset that state, which means we fail the assert.

Failing the assert is actually harmless; in release we suffer no
negative consequences as a result of this sequence of events. Now we
just remove the proxy from the validator set to avoid asserting.
2017-11-14 12:02:59 -05:00
Andrew Osmond
a6578c65f6 Bug 1414762 - imgRequestProxy::CancelAndForgetObserver should always force load group removal to dispatch. r=tnikkel
imgRequestProxy::CancelAndForgetObserver was intended to always dispatch
any load group removals due to reentracy conflicts with the callers.
However in bug 1404422 the fact that imgRequest::RemoveProxy can
indirectly trigger a load group removal through completing an
incompleted request.
2017-11-07 06:42:47 -05:00
Andrew Osmond
95ee2e55dc Bug 1404422 - Part 4. Remove imgIOnloadBlocker and related from tree as redundant. r=tnikkel 2017-11-01 06:59:10 -04:00
Andrew Osmond
c57b395b1a Bug 1404422 - Part 1d. Ensure imgRequestProxy::PerformClone consistently adds the clone to the expected load group. r=tnikkel
Historically imgRequestProxy::PerformClone would only add the cloned
request to the (original proxy's) document's load group if the request
was still being validated. Now it adds the cloned request to the given
document's load group before requesting the notifications, unless the
request has already been completed. We ensure that any removals from
the load group occur outside the current execution context.

Legacy listeners may use imgRequestProxy::SyncClone to request
notifications on the image state. Ideally they would not, but they do
not work as expected with the asynchronous notifications all new callers
must use. While in theory this would suggest their code is re-entrant,
not all of it is. In particular we need to be sensitive about when we
remove a request from a load group.
2017-11-01 06:59:10 -04:00
Andrew Osmond
920629550f Bug 1404422 - Part 1c. Refactor how an imgRequestProxy is added/removed from its load group. r=tnikkel
There should be no functional change here, but we rely upon the new
structure in the next patch in the series. This separates out the
notions of removing a request from the load group (which is always
final, and must be executed outside of synchronous calls from the owner
of the imgRequestProxy) and wanting to readd a request to the load group
as a background request (for multipart images).

The most important addition is mForceDispatchLoadGroup which if true
when imgRequestProxy::RemoveFromLoadGroup is called, will dispatch the
removal from the load group instead of executing it inline. This ensures
safety for any callers (e.g. to CancelAndForgetObserver) as above.
2017-11-01 06:59:10 -04:00
Andrew Osmond
b8832c3e1b Bug 1404422 - Part 1b. Make imgRequestProxy::SetLoadGroup return an error if changing the load group. r=tnikkel
imgRequestProxy::SetLoadGroup did not have a predictable effect and
it appears to be unused. It is somewhat complicated to support given
we must be sensitive about what context we execute removing the
request from the original load group.
2017-11-01 06:59:09 -04:00
Andrew Osmond
da707462b6 Bug 1382658 - imgRequestProxy::DoRemoveFromLoadGroup and imgCancelRunnable should be dispatched on labelled group if possible. r=tnikkel 2017-08-15 07:14:51 -04:00
Honza Bambas
eafe13d61a Bug 1381048 - Add few object tracking logs to imagelib. r=tnikkel 2017-07-25 11:14:00 -04:00
Andrew Osmond
6764b5b440 Bug 1382495 - Fix assert in imgRequestProxy::Dispatch to accept a listener or a tab group. r=me
imgRequestProxy::IsOnEventTarget must return false in order for imgRequestProxy::Dispatch to be called. Typically we check for mListener before any of this but in imgRequest::OnLoadComplete, we have other things to do besides notifying the listener. As such, we want to dispatch even if there is no listener, and that is when the assert can fail. Since IsOnEventTarget can only return false if it has either a tab group *or* a listener, we can change the assert to match.
2017-07-20 07:53:53 -04:00
Andrew Osmond
7deae0134b Bug 1359833 - Part 10. Add telemetry to track how often imgRequestProxy needs to dispatch. r=tnikkel data-r=bsmedberg 2017-07-19 14:15:12 -04:00
Andrew Osmond
614095af6d Bug 1359833 - Part 3b. Split imgRequestProxy::Clone into Clone and SyncClone. r=tnikkel
imgRequestProxy::SyncClone preserves the original behaviour of issuing
synchronous notifications once cloned. Some uses and tests depend on
this behaviour but in an ideal world, it would not be required.

imgRequestProxy::Clone is intended to be the replacement going forward,
which issues asynchronous notifications once cloned.
2017-07-19 14:15:11 -04:00
Andrew Osmond
77f71d7379 Bug 1359833 - Part 3a. imgRequestProxy should use an event target derived from the loading document. r=tnikkel 2017-07-19 14:15:11 -04:00
Jonathan Watt
29f20fa2d0 Bug 1367601 - Fix unified build error in imgRequestProxy.cpp. r=tnikkel
This file does not have a |using namespace mozilla;| line, so it cannot use
image::Image without a mozilla:: qualification.
2017-04-28 12:46:19 +01:00
Timothy Nikkel
09788ebab5 Back out changesets from bug 1342567.
Backed out changeset 06d6f928ed64
* * *
Backed out changeset f577512b1a29
* * *
Backed out changeset 289645ac65c1
* * *
Backed out changeset 600f9d60d76f
* * *
Backed out changeset 445330fd1211
2017-05-17 16:17:23 -05:00
Ehsan Akhgari
cd8e5781d1 Back out bug 1357107 since it broke a feature that we have no automated tests for... 2017-05-05 22:41:36 -04:00
Ehsan Akhgari
1bf467365d Bug 1357107 - Part 1: Move the handling of the permissions.default.image pref to imgLoader.cpp; r=bzbarsky 2017-04-28 00:13:23 -04:00