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

60 Коммитов

Автор SHA1 Сообщение Дата
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
Shih-Chiang Chien fe043ed110 Bug 1357318 - remember previous priority boost request in imgRequest. r=tnikkel
MozReview-Commit-ID: IieWWUw8EIB

--HG--
extra : rebase_source : 2a4fcc625f6f44833533b524bb388bedfeceecaa
2017-03-22 19:52:15 +08:00
Timothy Nikkel c12e8c8307 Bug 1342567. r=aosmond a=abillings 2017-04-19 00:36:06 -05:00
Eric Rahm a7ec07a00d Bug 943686 - Add imgRequestProxy.cpp to unified sources. r=tn
MozReview-Commit-ID: ITT9T22WyYG
2017-03-21 11:09:15 -07:00
Sebastian Hengst c3ffd943f4 Backed out changeset 46d1aeb34ad2 (bug 943686) 2017-03-20 22:59:58 +01:00
Eric Rahm 3d92dbeb7c Bug 943686 - Add imgRequestProxy.cpp to unified sources. r=tn
MozReview-Commit-ID: ITT9T22WyYG
2017-03-20 14:28:42 -07:00
Bill McCloskey 194043ae97 Bug 1339289 - Give names to a lot of common runnables (r=ehsan)
MozReview-Commit-ID: 5IdvK6kgoAW
2017-02-15 12:30:01 -08:00
Timothy Nikkel 748db52939 Bug 1325297. Create a variant of imgIContainer::StartDecoding that returns if the current image frame is complete. r=aosmond
During painting we do some image decoding, but we want to send the image progress notifications from that decoding async. The CSS image renderer checks if the image is complete before painting it. So if the decoding we did during painting resulted in the images becoming complete there is no way to tell that during the same paint. Thus making that decoding a waste of time.

So we add a limited way of telling if the result of a StartDecoding call has resulting in an image that is ready to paint so we can get that result during the same paint.

I would have prefered to change StartDecoding to just return a bool but that would have made the bool an outparam, which would make every StartDecoding call uglier with extra code. Changing it to a notxpcom function would have fixed that, but I'm not sure if that is safe.
2016-12-23 01:07:45 -06:00
Timothy Nikkel 501b1c2574 Bug 1317562. Allow flags to be passed to StartDecoding for the sole purpose of allowing async notifications to be requested. r=aosmond 2016-11-26 01:56:26 -06:00
Andi-Bogdan Postelnicu ec3eda24ad Bug 1318000 - Use C++11's override and remove virtual where applicable in image/. r=jrmuizel
MozReview-Commit-ID: B0ZIwPnhAIT

--HG--
extra : rebase_source : c1b9408efe2efb301784ef58489d4cb6e0e0d7b1
2016-11-16 17:41:47 +02:00
Andi-Bogdan Postelnicu 0cfd234e69 Bug 1318000 - Replace default bodies of special member functions with = default; in image/. r=jrmuizel
MozReview-Commit-ID: FYzbhclEgyD

--HG--
extra : rebase_source : f9d737670d8c6b963e6c3aff74d8e907b2af45f5
2016-11-16 17:39:43 +02:00
Michael Layzell 36e08437d0 Bug 1018486 - Part 8: Various other changes, r=smaug
MozReview-Commit-ID: B0dsomkWgEk
2016-09-07 10:50:45 -04:00
Christoph Kerschbaumer 045a838e10 Bug 1292869 - Fix null deref in imgRequestProxy::GetImagePrincipal. r=jmuizelaar 2016-08-10 10:12:30 +02:00
Kyle Huey 941ab1f522 Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-05-05 01:45:00 -07:00
Carsten "Tomcat" Book ba3fe0975c Backed out changeset 85ce8cb0639a (bug 1268313)
--HG--
extra : rebase_source : 56d1cf41a2dc4959b67f834e07192a5c772176a8
2016-04-29 14:21:16 +02:00
Kyle Huey 48a594a09e Bug 1268313: Part 7 - Move NS_NewRunnableMethod and friends to mozilla::NewRunnableMethod. r=froydnj 2016-04-28 14:08:25 -07:00
sajitk 32ccc4c2b0 Bug 1219474 - Replace PRLogModuleInfo w/ LazyLogModule in the 'image/' directory. r=seth
--HG--
extra : rebase_source : 1ce8c7a9d4ff2610506584e9f58ab9d9a6e92e06
2015-11-16 18:21:00 +01:00
Seth Fowler 6598853366 Bug 1207355 (Part 8) - Remove imgIContainer::RequestDecode() and imgIRequest::RequestDecode(). r=tn 2015-10-29 16:37:42 -07:00
Seth Fowler 66cb1f97aa Bug 1207355 (Part 6) - Only respect StartDecoding() in imgRequest/imgRequestProxy. r=tn 2015-10-29 16:37:42 -07:00
Phil Ringnalda a727c1fe68 Back out 8 changesets (bug 1207355) for OS X 10.10 reftest failures in generated-content/
CLOSED TREE

Backed out changeset aafd6db2fbb4 (bug 1207355)
Backed out changeset 9dd950b837fb (bug 1207355)
Backed out changeset e941e0e106a1 (bug 1207355)
Backed out changeset ecebca101fcb (bug 1207355)
Backed out changeset 08f2017137e1 (bug 1207355)
Backed out changeset 3dc69e37c9b4 (bug 1207355)
Backed out changeset bcdf51edb121 (bug 1207355)
Backed out changeset 1d4c00dbf49a (bug 1207355)
2015-10-28 22:57:43 -07:00
Seth Fowler 0fa74a123c Bug 1207355 (Part 8) - Remove imgIContainer::RequestDecode() and imgIRequest::RequestDecode(). r=tn 2015-10-28 16:40:43 -07:00
Seth Fowler 3dca063a5f Bug 1207355 (Part 6) - Only respect StartDecoding() in imgRequest/imgRequestProxy. r=tn 2015-10-28 16:40:43 -07:00
Nathan Froyd 0e77a32c87 Bug 1215763 - part 2 - s/nsAutoPtr/UniquePtr/ in image/; r=seth
These conversions should be straightforward, but we have to add a .get
for nsExpirationTracker::Iterator.
2015-10-17 06:53:28 -04:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Birunthan Mohanathas 7315345693 Bug 1191100 - Remove XPIDL signature comments in .cpp files. r=ehsan
Comment-only so DONTBUILD.
2015-08-04 16:17:36 -07:00
Dragana Damjanovic 7987d2203e Bug 905127 - Part 2 - remove unnecessary nsNetUtil.h includes r=jduell 2015-07-06 07:55:00 +02:00