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

77 Коммитов

Автор SHA1 Сообщение Дата
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 Osmond 7d59969d56 Bug 1503850 - Remove expired WebP telemetry probes. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D10550
2018-11-01 16:59:02 -04:00
Andrew Osmond a31bd9b85e Bug 1492930 - Part 6. Integrate extra shared surface memory reporting with imagelib. r=tnikkel 2018-09-25 09:13:52 -04:00
Narcis Beleuzu 3a8485e6e6 Backed out 6 changesets (bug 1492930) for build bustages on ImageMemoryReporter.cpp. CLOSED TREE
Backed out changeset 9d1ff0d0af47 (bug 1492930)
Backed out changeset bdb1bf2d8062 (bug 1492930)
Backed out changeset 2959314ecf7c (bug 1492930)
Backed out changeset 587e01daa080 (bug 1492930)
Backed out changeset 1a6b422c5a90 (bug 1492930)
Backed out changeset a3b3f4cdc9fa (bug 1492930)
2018-09-25 13:33:17 +03:00
Andrew Osmond cb18b15c36 Bug 1492930 - Part 6. Integrate extra shared surface memory reporting with imagelib. r=tnikkel 2018-09-25 06:18:07 -04:00
Ehsan Akhgari 9aa38967b7 Bug 1491574 - Part 1: Remove the XPCOM registration for nsProperties; r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D5949
2018-09-18 00:33:59 -04:00
Coroiu Cristina 40028657f0 Backed out 3 changesets (bug 1491574) for build bustage at builds/worker/workspace/build/src/netwerk/base/nsNetUtil.cpp on a CLOSED TREE
Backed out changeset 5390b485f7e4 (bug 1491574)
Backed out changeset 3d11b69de826 (bug 1491574)
Backed out changeset e7e8f3f70f8b (bug 1491574)
2018-09-18 07:10:20 +03:00
Ehsan Akhgari d6cfac82e5 Bug 1491574 - Part 1: Remove the XPCOM registration for nsProperties; r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D5949
2018-09-17 21:39:54 -04: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
Andrew Osmond b13b2abe4f Bug 1472145 - Part 2. Add telemetry to track how frequently WebP images are used. r=tnikkel data-r=chutten
This patch adds three telemetry scalars to track how WebP is used. All
of these scalars are updated when we do the MIME type confirmation for
an imgRequest when the first data comes in. We know at this point we
decided to load the given content, so there should be minimal false
positives for data the browser loaded but never displayed.

The first two scalars are merely whether or not WebP was observed. One
is for probes, which are tiny WebP images suggested by the Google WebP
FAQ to probe for different aspects of WebP support (lossy, animated,
etc). We want to count this separately as actual WebP content that the
website wishes us to display. Probes will give a measure of how many
users visit websites that probe for WebP support, and content will give
a measure of how many websites don't care and just give us WebP images
regardless.

The third scalar is intended to give a relative measure of how many WebP
images we are being served relative to all other image types. We expect
the ratio to be small, but it would be good to confirm this from the
data.
2018-06-29 20:30:08 -04: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
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
Andrew Osmond d84d324b49 Bug 1419889 - Don't force the image cache to validate if it hasn't started yet. r=tnikkel
imgLoader::ValidateEntry would aggressively determine an entry has
expired, even when the request hasn't yet begun. This is because the
expiration time for the entry was not set unless it was for a channel
which supports caching. Now we set the expiration time for all
channels, and if it doesn't support caching, it just expires at the
current time when imgRequest::OnStartRequest is called. Additionally,
imgLoader::ValidateEntry will not consider the expiration time in the
entry until it is non-zero.
2017-12-07 08:28:28 -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
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 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
Kris Maglione 1e39590f6d Bug 1406278: Part 2a - Rename LoadingPrincipal to TriggeringPrincipal in imgLoader. r=bz
The imgLoader code consistently uses the term 'loadingPrincipal' for the
principal that is called the triggeringPrincipal everywhere else it's used.
This is confusing, and since we need to make changes to how those values are
determined, it should be fixed beforehand.

MozReview-Commit-ID: 8CTHwayzcaD

--HG--
extra : rebase_source : d4405b0ecfe1c8dfb9bfdf61fe6ed6cfb180ba83
2017-10-02 20:38:30 -07:00
Andrew Osmond f67ab8c057 Bug 1382783 - Retarget non-HTTP image URIs (chrome, blob) to the image IO thread if not an SVG. r=tnikkel
Currently we only permit requests from HTTP channels to be retargeted to
the image IO thread. It was implemented this way originally in bug
867755 but it does not appear there was a specific reason for that.

The only kink in this is some browser chrome mochitests listen on debug
build only events to ensure certain chrome images are loaded and/or
drawn. As such, this patch ensures that those observer notifications
continue to be served, requiring a dispatch from the image IO thread to
the main thread.

Another issue to note is that SVGs must be processed on the main thread;
the underlying SVG document can only be accessed from it. We enforce
this by checking the content type. The possibility already exists that
an HTTP response could contain the wrong content type, and in that case,
we fail to decode the image, as there is no content sniffing support for
SVG. Thus there should be no additional risk taken by using the image IO
thread from other non-HTTP channels (if they don't specify the SVG
content type, it is not rendered today, and if they do, it will remain
on the main thread as it is today).

We also ignore data URIs. The specification requires that we process
these images sychronously. See bug 1325080 for details.
2017-09-25 11:44:49 -04:00
Andrew Osmond 444c3a179f Bug 1378488 - Part 2. imgRequest::Cancel should dispatch using ProgressTracker::GetEventTarget. r=tnikkel 2017-08-14 16:59:58 -04:00
Andrew Osmond 3afc88f6f9 Bug 1378488 - Part 1. imgRequest::FinishPreparingForNewPart should dispatch using ProgressTracker::GetEventTarget. r=tnikkel 2017-08-14 16:59:58 -04:00
Nicholas Nethercote 49eb219ff5 Bug 1383982 (attempt 2) - Introduce a general mechanism for measuring memory usage of graph-like structures. r=erahm.
--HG--
extra : rebase_source : 7075f9570a4262158351ce9ac3ca8360ea4d5394
2017-07-28 20:10:04 +10:00
Sebastian Hengst 9077ac8886 Backed out changeset a57d8f30d1bf (bug 1383982) for build bustage at nsGlobalWindow.cpp:13826: 'class nsWindowSizes' has no member named 'mMallocSizeOf'. r=backout 2017-07-28 09:50:48 +02:00
Nicholas Nethercote 5c3abe8aab Bug 1383982 - Introduce a general mechanism for measuring memory usage of graph-like structures. r=erahm.
All the SizeOf{In,Ex}cludingThis() functions take a MallocSizeOf function
which measures memory blocks. This patch introduces a new type, SizeOfState,
which includes a MallocSizeOf function *and* a table of already-measured
pointers, called SeenPtrs. This gives us a general mechanism to measure
graph-like data structures, by recording which nodes have already been
measured. (This approach is used in a number of existing reporters, but not in
a uniform fashion.)

The patch also converts the window memory reporting to use SizeOfState in a lot
of places, all the way through to the measurement of Elements. This is a
precursor for bug 1383977 which will measure Stylo elements, which involve
Arcs.

The patch also converts the existing mAlreadyMeasuredOrphanTrees table in the
OrphanReporter to use the new mechanism.

--HG--
extra : rebase_source : 2c23285f8b6c3b667560a9d14014efc4633aed51
2017-07-28 15:03:44 +10:00
Honza Bambas eafe13d61a Bug 1381048 - Add few object tracking logs to imagelib. r=tnikkel 2017-07-25 11:14:00 -04:00
Honza Bambas 8f8eed7be6 Bug 1378375 - Kill switch preference for image network request prioritization according layout position. r=tnikkel 2017-07-14 09:26:00 -04:00
Bill McCloskey c197e07ff2 Bug 1363560 - Name more runnables (r=mccr8)
MozReview-Commit-ID: 3hxZDA4JlTV
2017-05-09 21:53:25 -07: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
Eric Rahm 2f16bd241c Bug 943686 - Add imgRequest.cpp to unified sources. r=tn
MozReview-Commit-ID: B87v26HNtBn
2017-03-21 11:09:14 -07:00
Sebastian Hengst 3d552e75e6 Backed out changeset 726f50ce3a40 (bug 943686) 2017-03-20 23:00:06 +01:00
Eric Rahm bbf39fe24c Bug 943686 - Add imgRequest.cpp to unified sources. r=tn
MozReview-Commit-ID: B87v26HNtBn
2017-03-20 14:28:41 -07:00
Wei-Cheng Pan a6dc7e9508 Bug 1310127 - Part 14: Use MOZ_MUST_USE in netwerk/protocol/http r=tnikkel
MozReview-Commit-ID: Gvv80wYQ7JI

--HG--
extra : rebase_source : c5cc6b3df2f308e5f825568e731c7a15a5e2e6d7
2016-12-20 11:51:33 +08:00
Tom Tromey 5f8f360823 Bug 1060419 - make log_print use Printf.h, r=froydnj
MozReview-Commit-ID: BIZ1GQEZ1vs

--HG--
extra : rebase_source : 2f1f0aa12493c44f352d9a7e8683e7bb72d2d75b
2016-12-15 20:16:31 -07:00
Sylvestre Ledru a54302b9d6 Bug 1338086 - Remove useless else blocks in order to reduce complexity image/ r=dholbert
MozReview-Commit-ID: 8qUQk8w0QSk

--HG--
extra : rebase_source : c7451383027a14144490d2a8d2639f73cead1a5c
2017-02-10 13:52:27 +01:00
Timothy Nikkel e1b5e6ec5d Bug 1323877. r=aosmond 2017-01-08 22:04:19 -06:00
Timothy Nikkel 5b5403b0a2 Bug 1323875. r=aosmond 2017-01-05 22:46:11 -06:00
Thomas Nguyen 0aaea58b69 Bug 1304623 - Create a pref to control the default referrer policy - part 3. r=bkelly
MozReview-Commit-ID: 1A6IHPeNYBQ
2017-01-05 11:29:56 +08:00
Timothy Nikkel 9ba87d3afb Bug 1321946. Adjust asserts about the progress of an image to deal with how multipart images are handled. r=aosmond
For multipart images we create a MultipartImage which contains each part. Each part in turn is a VectorImage or RasterImage. The MultipartImage and each part image all have their own ProgressTracker. The ProgressTracker for the MultipartImage observes the notifications of each part image via the IProgressObserver interface. This interfaces notably has no way to notify about an image error. So when a part image has an error it never gets propagated to the MultipartImage's ProgressTracker. This confuses our assertions about consistency of progress notifications. In this case we expect that when we get the load complete notification then we either have the size of the image or we encountered an error. So if the first part of a multipart image is broken and we are unable to get a size from it we will trigger this assertion.

There are two ways to fix this. One would be to propagate errors to the MultipartImage's ProgressTracker. This would put the ProgressTracker for the MultipartImage permanently into error state and prevent showing the images from the remaining parts if one part image had an error.

So in this patch I create a way to tell a ProgressTracker that is is for a multipart image, and use that to relax the assertions. As far as I can tell our code should be able to handle "ignoring" an error in a bad part image.

Addtionaly there is a way that an error flag can get propagated to the MultipartImage's tracker: in MultipartImage::FinishTransition we get the progress directly from the part image and notify for it. This seems like an oversight as the comment at

https://dxr.mozilla.org/mozilla-central/rev/bfa85d23df57c8a1db17c99b267667becc1c4afd/image/imgRequest.cpp#989

indicates that we don't want one bad part to prevent later parts from displaying. So we add the error flag to the ones we filter out when we propagate progress.
2016-12-03 16:07:10 -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
Nicholas Nethercote 3ac8aee67f Bug 1297300 - Add missing checks to GetSpec() calls in image/. r=tnikkel. 2016-08-29 15:34:32 +10:00
Nicholas Nethercote 742fc7eb48 Bug 1297961 (part 1) - Introduce nsURI::GetSpecOrDefault(). r=hurley.
This function is an infallible alternative to nsIURI::GetSpec(). It's useful
when it's appropriate to handle a GetSpec() failure with a failure string, e.g.
for log/warning/error messages. It allows code like this:

  nsAutoCString spec;
  uri->GetSpec(spec);
  printf("uri: %s", spec.get());

to be changed to this:

  printf("uri: %s", uri->GetSpecOrDefault().get());

This introduces a slight behavioural change. Previously, if GetSpec() failed,
an empty string would be used here. Now, "[nsIURI::GetSpec failed]" will be
produced instead. In most cases this failure string will make for a clearer
log/warning/error message than the empty string.
* * *
Bug 1297961 (part 1b) - More GetSpecOrDefault() additions. r=hurley.

I will fold this into part 1 before landing.

--HG--
extra : rebase_source : ddc19a5624354ac098be019ca13cc24b99b80ddc
2016-08-26 16:02:31 +10:00
Nicholas Nethercote 3b0485fcdb Bug 1294645 - Don't use NS_CALLBACK for callbacks in nsI{Input,Output,UnicharInput},Stream.idl. r=froydnj.
Slightly less than half (93 / 210) of the NS_METHOD instances in the codebase
are because of the use of NS_CALLBACK in
nsI{Input,Output,UnicharInput},Stream.idl. The use of __stdcall on Win32 isn't
important for these callbacks because they are only used as arguments to
[noscript] methods.

This patch converts them to vanilla |nsresult| functions. It increases the size
of xul.dll by about ~600 bytes, which is about 0.001%.

--HG--
extra : rebase_source : c15d85298e0975fd030cd8f8f8e54501f453959b
2016-08-12 17:36:22 +10:00
Nicholas Nethercote e7f10a07fd Bug 1293603 (part 2) - Make Run() declarations consistent. r=erahm.
This patch makes most Run() declarations in subclasses of nsIRunnable have the
same form: |NS_IMETHOD Run() override|.

As a result of these changes, I had to add |override| to a couple of other
functions to satisfy clang's -Winconsistent-missing-override warning.

--HG--
extra : rebase_source : 815d0018b0b13329bb5698c410f500dddcc3ee12
2016-08-08 12:18:10 +10:00
Kyle Huey c73656947b Bug 1265927: Move nsRunnable to mozilla::Runnable, CancelableRunnable to mozilla::CancelableRunnable. r=froydnj 2016-04-25 17:23:21 -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
Nathan Froyd 2d8bae8e40 Bug 1217571 - fix the imagelib cache to work in e10s; r=seth
nsICachingChannel isn't available in the child process; we have to use
nsICacheInfoChannel instead.
2015-11-12 15:09:52 -05:00