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

64 Коммитов

Автор SHA1 Сообщение Дата
Simon Giesecke be7dc83fa6 Bug 1691913 - Mark nsBaseHashtable (and its subclasses') member functions nodiscard where appropriate. r=xpcom-reviewers,necko-reviewers,dragana,nika
Differential Revision: https://phabricator.services.mozilla.com/D105474
2021-02-26 09:22:53 +00:00
Sylvestre Ledru b4f9be25d4 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,necko-reviewers
Updated with clang-format version 11.0.1 (taskcluster-B6bdwSKDRF-luRQWXBuzpA)

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D105158
2021-02-15 08:49:20 +00:00
Barret Rennie ba22e83fc5 Bug 1689261 - Remove TIME_TO_LOAD_EVENT_{START,END}_{NO_,}PRELOAD_MS probes r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D104786
2021-02-11 18:21:05 +00:00
Simon Giesecke 12c0dee627 Bug 1688833 - Migrate LookupForAdd to WithEntryHandle in uriloader. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D104218
2021-02-09 18:19:41 +00:00
Emilio Cobos Álvarez abe411131e Bug 1637651 - Make RegisterPreload slightly more efficient. r=smaug
I was hitting the assertion and was investigating a bit. This makes the
registration a bit faster, but doesn't change behavior.

Depends on D103567

Differential Revision: https://phabricator.services.mozilla.com/D103568
2021-02-01 14:59:48 +00:00
Emilio Cobos Álvarez fe36177806 Bug 1637651 - Assume non-quirks mode for style Link header preloads. r=smaug
This is an issue I found while going through this code and
writing/debugging a test for the bug at hand. Without this, the test in
the actual fix for this bug will fail to actually reuse the preloaded
stylesheet.

It seems reasonable to assume that the intersection of quirks mode
documents using link preload headers is small (and in that case we'd
parse the sheet twice, but oh well).

Differential Revision: https://phabricator.services.mozilla.com/D103567
2021-02-01 23:23:50 +00:00
Emilio Cobos Álvarez 06078ea6e0 Bug 1598613 - Remove single-caller method in PreloadService. r=edgar
Just drive-by cleanup, no behavior change.

Depends on D103563

Differential Revision: https://phabricator.services.mozilla.com/D103564
2021-01-31 21:16:30 +00:00
Emilio Cobos Álvarez 3339819a8e Bug 1685832 - Remove some includes from PreloadService.h. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101249
2021-01-11 02:35:41 +00:00
Emilio Cobos Álvarez 1dcf18b440 Bug 1685830 - Remove spurious check that prevents preload from working in non-http(s) sites. r=smaug
As it doesn't match other implementations, and it's confusing.

Differential Revision: https://phabricator.services.mozilla.com/D101248
2021-01-11 02:37:15 +00:00
Emilio Cobos Álvarez 72d0992fec Bug 1685816 - Don't fire rel=preload error events for invalid type/media/as attributes. r=smaug
This matches other browsers, https://github.com/w3c/preload/issues/155
is the spec issue. There was a test for invalid as values.

Differential Revision: https://phabricator.services.mozilla.com/D101243
2021-01-10 20:50:02 +00:00
Simon Giesecke dd80614fa0 Bug 1678062 - Remove unnecessary includes. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D97467

Depends on D96561
2020-11-23 16:12:02 +00:00
Simon Giesecke d10d03d076 Bug 1676365 - Move SpinEventLoopUntil to separate header. r=#xpcom-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96556

Depends on D96554
2020-11-23 16:10:41 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Simon Giesecke 8953086494 Bug 1677284 - Move PackingStrategy::Variant implementation to separate header file. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D97075
2020-11-23 15:49:14 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Emilio Cobos Álvarez 061fc9d988 Bug 1658571 - Add MainThreadWeakPtr and use it in PreloaderBase::RedirectSink. r=sg,smaug
Per matrix discussion, this is safer to uplift (instead of relying on
the RedirectSink being released on the main thread).

Differential Revision: https://phabricator.services.mozilla.com/D91270
2020-09-24 16:38:35 +00:00
Emilio Cobos Álvarez a88d74d517 Bug 1658571 - Don't create a reference cycle when catching redirects of a preload. r=smaug
PreloaderBase -> RedirectSink -> PreloaderBase is a strong,
non-cycle-collected reference cycle, which in cases where we don't drop
the channel because we never get an NotifyStop notification, it can
cause leaks.

I'm investigating the root cause of the lack of NotifyStop, but this
should fix the leak and is correct anyhow.

Move the class to the cpp file to ease debugging and changes.

Differential Revision: https://phabricator.services.mozilla.com/D91259
2020-09-24 16:01:50 +00:00
Simon Giesecke de7bab0f06 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Barret Rennie f74cb16fd0 Bug 1657188 - Implement rel=preload load time telemetry r=Dexter,emilio,nika
Differential Revision: https://phabricator.services.mozilla.com/D86074
2020-09-14 21:03:52 +00:00
Razvan Maries 90b7948378 Backed out 2 changesets (bug 1663963, bug 1657188) for perma failures on browser_Telemetry_loadTimePreload.js. CLOSED TREE
Backed out changeset 643f16da7b99 (bug 1657188)
Backed out changeset 0c9661a5c8f9 (bug 1663963)
2020-09-10 03:48:48 +03:00
Barret Rennie 423307263a Bug 1657188 - Implement rel=preload load time telemetry r=Dexter,emilio,nika
Differential Revision: https://phabricator.services.mozilla.com/D86074
2020-09-09 21:44:48 +00:00
Kershaw Chang 4fdec2e031 Bug 1658532 - Add `REL_PRELOAD_MISS_RATIO` telemetry measuring ratio of used vs unused preloads per "as" type, r=smaug,chutten
Differential Revision: https://phabricator.services.mozilla.com/D86736
2020-08-24 11:24:21 +00:00
Emilio Cobos Álvarez 341aec03de Bug 1658551 - Properly sanitize the URI we log to the console. r=heycam
Drive-by, but this is what a bunch of other console messages do.

Depends on D87267

Differential Revision: https://phabricator.services.mozilla.com/D87268
2020-08-20 22:04:36 +00:00
Emilio Cobos Álvarez 44b1932fad Bug 1658551 - Move preload usage timer creation to the common NotifyOpen implementation. r=heycam
Not just the one that takes a channel. This fixes the issue.

Also, as an optimization, avoid creating a timer if we're used already
or we have already one.

Differential Revision: https://phabricator.services.mozilla.com/D87267
2020-08-20 22:01:29 +00:00
Frederik Braun 6c85c74f16 Bug 1655716 - Introduce TYPE_INTERNAL_FETCH_PRELOAD and use in HTMLLinkElement::AsValueToContentPolicy() - r=emilio,mayhemer,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D85980
2020-08-11 12:33:14 +00:00
Simon Giesecke 96f3e7e019 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-04 11:27:07 +00:00
Noemi Erli 381fca9783 Backed out 4 changesets (bug 1654992, bug 1654991) for causing timeous in mask-opacity-1e.html
Backed out changeset 11f0f54c6e0a (bug 1654992)
Backed out changeset a353dd5b3f08 (bug 1654991)
Backed out changeset 6a7964ba549f (bug 1654991)
Backed out changeset cf3bfb91d98c (bug 1654991)
2020-08-03 22:09:36 +03:00
Simon Giesecke 032d2ac9d3 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-03 14:54:18 +00:00
Emilio Cobos Álvarez ff61891772 Bug 1653011 - Simplify and make WeakPtr<Derived> usable and compact. r=froydnj,sg,geckoview-reviewers,jgilbert,kvark,snorp
Having two classes in the inheritance chain inherit from SupportsWeakPtr
now won't compile, but you can use WeakPtr<Derived> when any base class
inherits from SupportsWeakPtr.

Differential Revision: https://phabricator.services.mozilla.com/D83674
2020-07-23 14:51:46 +00:00
Cameron McCormack 938328e6b5 Bug 1650409 - Null check preload URL parsing. r=mayhemer
Differential Revision: https://phabricator.services.mozilla.com/D84035
2020-07-18 13:54:22 +00:00
Simon Giesecke 00997c3c4d Bug 1652007 - Move implementation of UsageTimer to cpp file to avoid dependency on dom/base/Document.h. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D83101
2020-07-15 12:47:41 +00:00
Frederik Braun a7153982e8 Bug 1366973: Rename security flags to not contain DATA anymore r=geckoview-reviewers,ckerschb,snorp
Differential Revision: https://phabricator.services.mozilla.com/D83490
2020-07-15 11:20:45 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Honza Bambas 3f23870623 Bug 1603542 - Log a warning in the web console when a preloaded resource is not used, r=Harald
Differential Revision: https://phabricator.services.mozilla.com/D76527
2020-06-23 17:18:20 +00:00
Emilio Cobos Álvarez abd87a6510 Bug 1646776 - Make sure to fire load rather than error events for preload links that hit the CSS cache. r=mayhemer
When we hit the stylesheet cache for an existing stylesheet in a
different document:

 * There's no existing preload in the PreloadService (because the sheet
   was loaded in another document).

 * We don't create a PreloaderBase (because we don't trigger a load at
   all).

 * And thus we believe the load has just errored, which is wrong...

Fix it by properly passing through the "already complete" status from
PreloadStyle.

Note that there's still another issue, which is that we'd still hit this
broken path if two stylesheets with the same URI are loading in
different documents and the CSS loader coalesces them.

For that, I think we'd have to make SheetLoadData the thing that
actually implements PreloaderBase. This is kind of an obscure case, and
SheetLoadData has a pretty complex lifetime already (keeps alive a whole
lot of stuff), so I'd prefer to do this in a separate bug.

Differential Revision: https://phabricator.services.mozilla.com/D80289
2020-06-22 14:18:19 +00:00
Emilio Cobos Álvarez 6bb08bd490 Bug 1646056 - Use const references as keys instead of raw pointers for PreloadHashKey. r=mayhemer
Feels a bit more natural for the callers this way. This should have no
behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D79831
2020-06-18 14:06:34 +00:00
Emilio Cobos Álvarez 939c7c466b Bug 1642591 - Don't make referrer policy a cache miss for sub-resource {pre,}loads. r=mayhemer,tnikkel
For preload we're already effectively not using it, I think, due to
bug 1642325.

For images, this matches the spec, see earlier comments in this bug and
https://bugzilla.mozilla.org/show_bug.cgi?id=1174921#c17.  I think it
makes sense for other sub-resources to align as well.

Differential Revision: https://phabricator.services.mozilla.com/D79812
2020-06-18 14:06:20 +00:00
Noemi Erli 22b81ffefa Backed out 2 changesets (bug 1603542) for causing assertion failures in Loader.cpp CLOSED TREE
Backed out changeset cc70c96b63e0 (bug 1603542)
Backed out changeset c3dcacdd97c4 (bug 1603542)
2020-06-17 18:37:45 +03:00
Honza Bambas 4570854a4c Bug 1603542 - Log a warning in the web console when a preloaded resource is not used, r=Harald
Differential Revision: https://phabricator.services.mozilla.com/D76527
2020-06-17 14:06:50 +00:00
Emilio Cobos Álvarez 5ce8c5c731 Bug 1646032 - Avoid a silly string copy in PreloadService. r=mayhemer
There's no real need to go through a DOMString here.

Differential Revision: https://phabricator.services.mozilla.com/D79815
2020-06-16 14:07:18 +00:00
Emilio Cobos Álvarez 6ce135fbfc Bug 1646019 - Make PreloadHashKey don't check referrer for equality for style. r=mayhemer
We probably should remove the referrer policy check altogether in
bug 1642591, but the preload code still uses the whole referrer as the
key for css, which the css loader stopped doing in bug 1599160.

So this should be an uncontroversial simplification.

Differential Revision: https://phabricator.services.mozilla.com/D79810
2020-06-16 11:41:18 +00:00
Honza Bambas 089a846bd0 Bug 1642303 - Keep channel of FetchPreloader even after the load has finished to let preload consumers use that channel early after opening, r=baku
Differential Revision: https://phabricator.services.mozilla.com/D78729
2020-06-10 14:21:56 +00:00
Honza Bambas 8965ac6edc Bug 1642325 - Exclude referrer policy from the preload hash key, r=ckerschb
Depends on D77664

Differential Revision: https://phabricator.services.mozilla.com/D77665
2020-06-08 17:00:37 +00:00
Emilio Cobos Álvarez 2f5607b8d0 Bug 1642221 - Rename SheetLoadData::mLoaderPrincipal to mTriggeringPrincipal. r=jwatt
I'm about to introduce the concept of "Loader principal" (as in "the
principal of the CSS loader"), and SheetLoadData already has an
mLoaderPrincipal.

However SheetLoadData's principal is just the triggering principal (the
principal that initiated the load). So name it that with consistency
with SheetInfo::mTriggeringPrincipal etc.

Differential Revision: https://phabricator.services.mozilla.com/D77613
2020-05-31 17:11:57 +00:00
Honza Bambas 0057c96229 Bug 1637039 - Make synchronous open errors of a fetch preloading channel be notified to link preload tags, r=kershaw
Differential Revision: https://phabricator.services.mozilla.com/D76367
2020-05-25 18:40:07 +00:00
Honza Bambas b10e870a54 Bug 1637039 - Adjust `PreloaderBase::NotifyStart` to read channel tainting also for non-opened preloads, r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D76362
2020-05-25 18:38:36 +00:00