Commit graph

83 commits

Author SHA1 Message Date
Mark Banner
a7e93ca96e Bug 1782659 - Enable ESlint rule no-unused-vars on the global scope for browser/ xpcshell-tests. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D153433
2022-08-05 08:38:50 +00:00
Tooru Fujisawa
54623364da Bug 1777486 - Part 2: Migrate XPCOMUtils.jsm consumers with automatic migration. r=webdriver-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,kmag,owlish,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151214
2022-07-12 04:21:34 +00:00
Andreea Pavel
7738a75fdd Backed out 11 changesets (Bug 1777486) for failing bc at browser_startup.js on a CLOSED TREE
Backed out changeset b6c4c386f1a6 (Bug 1777486)
Backed out changeset 195cc2de8433 (Bug 1777486)
Backed out changeset 20c746fb1648 (Bug 1777486)
Backed out changeset d5fd8173d62d (Bug 1777486)
Backed out changeset 6d758fab5a3e (Bug 1777486)
Backed out changeset e938b601ba15 (Bug 1777486)
Backed out changeset 0c4ea0b9416b (Bug 1777486)
Backed out changeset 0559c53cc668 (Bug 1777486)
Backed out changeset eea573d3a9f9 (Bug 1777486)
Backed out changeset 9ce3a6496a49 (bug 1777486)
Backed out changeset b0867652fc48 (bug 1777486)
2022-07-11 22:24:40 +03:00
Tooru Fujisawa
8cd6ed7409 Bug 1777486 - Part 2: Migrate XPCOMUtils.jsm consumers with automatic migration. r=webdriver-reviewers,geckoview-reviewers,preferences-reviewers,application-update-reviewers,pip-reviewers,kmag,owlish,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D151214
2022-07-11 15:09:13 +00:00
Tooru Fujisawa
bf93d07148 Bug 1667455 - Part 5: Stop importing Services.jsm from chrome-priv JS code, top-level single-line cases. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,extension-reviewers,application-update-reviewers,pip-reviewers,twisniewski,m_kato,jdescottes,mconley,AlexandruIonescu,mossop
Differential Revision: https://phabricator.services.mozilla.com/D150894
2022-07-11 12:41:50 +00:00
Tooru Fujisawa
f3a8c52c53 Bug 1667455 - Part 4: Stop importing Services.jsm from JSM. r=kmag,webdriver-reviewers,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,application-update-reviewers,pip-reviewers,twisniewski,devtools-reviewers,m_kato,jdescottes,ochameau,mconley,sfoster,AlexandruIonescu
Differential Revision: https://phabricator.services.mozilla.com/D150893
2022-07-11 12:41:50 +00:00
Tooru Fujisawa
aec8c4ae15 Bug 1772100 - Part 2: Use plain object for lazy getter in browser/components/attribution/. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D148012
2022-06-09 16:21:47 +00:00
Tooru Fujisawa
4f96aa80b2 Bug 1772360 - Remove unnecessary call for XPCOMUtils.defineLazyGlobalGetters. r=florian,webdriver-reviewers,webcompat-reviewers,denschub,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D148168
2022-06-06 04:42:10 +00:00
Tooru Fujisawa
823c668f50 Bug 1772351 - Part 1: Stop calling ChromeUtils.defineModuleGetter for AppConstants. r=florian
Differential Revision: https://phabricator.services.mozilla.com/D148164
2022-06-06 04:42:08 +00:00
Tooru Fujisawa
2dcfd09f81 Bug 1772313 - Part 5: Stop calling ChromeUtils.defineModuleGetter for Services. r=kmag,webcompat-reviewers,pip-reviewers,denschub,mhowell
Differential Revision: https://phabricator.services.mozilla.com/D148158
2022-06-06 04:42:06 +00:00
Molnar Sandor
77402a5caa Backed out 15 changesets (bug 1772313, bug 1772351, bug 1772360) for causing xpc failures in telemetry/tests/unit/test_SocketScalars.js CLOSED TREE
Backed out changeset c8b0a2ed239e (bug 1772360)
Backed out changeset 1922adad6abe (bug 1772351)
Backed out changeset 6d3634cce489 (bug 1772351)
Backed out changeset f03968a9d053 (bug 1772351)
Backed out changeset e7a38ef90fe4 (bug 1772351)
Backed out changeset b389e7654771 (bug 1772313)
Backed out changeset 59a33598ff51 (bug 1772313)
Backed out changeset ab60885a8a93 (bug 1772313)
Backed out changeset aad8efac9d05 (bug 1772313)
Backed out changeset 4378e519a8e7 (bug 1772313)
Backed out changeset 302ac54741f8 (bug 1772313)
Backed out changeset 74c59f9fd51c (bug 1772313)
Backed out changeset 575fb877c56c (bug 1772313)
Backed out changeset 2eaa68f10b19 (bug 1772313)
Backed out changeset 4a8b3ba193dc (bug 1772313)
2022-06-06 07:04:25 +03:00
Tooru Fujisawa
c7229a1a17 Bug 1772360 - Remove unnecessary call for XPCOMUtils.defineLazyGlobalGetters. r=florian,webdriver-reviewers,webcompat-reviewers,denschub,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D148168
2022-06-06 02:49:14 +00:00
Tooru Fujisawa
5ff7b51845 Bug 1772351 - Part 1: Stop calling ChromeUtils.defineModuleGetter for AppConstants. r=florian
Differential Revision: https://phabricator.services.mozilla.com/D148164
2022-06-06 02:49:12 +00:00
Tooru Fujisawa
da1905e641 Bug 1772313 - Part 5: Stop calling ChromeUtils.defineModuleGetter for Services. r=kmag,webcompat-reviewers,pip-reviewers,denschub,mhowell
Differential Revision: https://phabricator.services.mozilla.com/D148158
2022-06-06 02:49:10 +00:00
Ben Hearsum
1e2cdbc725 Bug 1616355: attribution postSigningData should be per installation r=nalexander
about:newtab#asrouter actually depends on the ability to be able to write to postSigningData at the moment, so this will break that in any circumstance where the running Firefox cannot write to the installation directory. This code is only used for dev & qa testing though, and I've been told this is OK (and we may change how it works to avoid writing the file at all).

Differential Revision: https://phabricator.services.mozilla.com/D144167
2022-05-03 20:04:28 +00:00
Ben Hearsum
e84c6b96a0 Bug 1766479: don't run Windows only attribution tests on Mac r=aryx
Differential Revision: https://phabricator.services.mozilla.com/D144729
2022-04-26 19:20:13 +00:00
Ben Hearsum
443289cf0f Bug 1756209: send Windows Store Campaign ID as attribution code r=nalexander
Nearly all the complexity here is abstracted away in the previous patch, so this is quite straightforward other than the one oddity noted in the comments.

Differential Revision: https://phabricator.services.mozilla.com/D143112
2022-04-26 15:55:34 +00:00
Kagami Sascha Rosylight
1409f37ca3 Bug 1703953 - Part 2: Apply mozilla/use-isInstance rules for .jsm files r=webdriver-reviewers,pip-reviewers,mhowell,Gijs,whimboo
This replaces all `instanceof` uses for DOM interfaces, since the operator in priviliged context works same as .isInstance().

Differential Revision: https://phabricator.services.mozilla.com/D141785
2022-04-06 11:57:57 +00:00
Gijs Kruitbosch
8e67201171 Bug 1753696 - Automatic rewrite: replace add_task(setup with add_setup in browser mochitest, r=Standard8,webcompat-reviewers,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D141437
2022-03-30 16:16:42 +00:00
Norisz Fay
acdd6851cd Backed out 2 changesets (bug 1753696) for causing multiple dt and bc failures CLOSED TREE
Backed out changeset 67fd9edfbcea (bug 1753696)
Backed out changeset a9d957ea887b (bug 1753696)
2022-03-30 12:17:55 +03:00
Gijs Kruitbosch
27039e2946 Bug 1753696 - Automatic rewrite: replace add_task(setup with add_setup in browser mochitest, r=Standard8,webcompat-reviewers,twisniewski
Differential Revision: https://phabricator.services.mozilla.com/D141437
2022-03-30 08:18:51 +00:00
criss
4eec7e25a3 Backed out 3 changesets (bug 1703953) for causing multiple failures. CLOSED TREE
Backed out changeset 871a1fac289e (bug 1703953)
Backed out changeset 8151244bda18 (bug 1703953)
Backed out changeset eaf6d4c353be (bug 1703953)
2022-03-29 17:01:58 +03:00
Kagami Sascha Rosylight
c8f12f94dc Bug 1703953 - Part 2: Apply mozilla/use-isInstance rules for .jsm files r=webdriver-reviewers,pip-reviewers,mhowell,Gijs,whimboo
This replaces all `instanceof` uses for DOM interfaces, since the operator in priviliged context works same as .isInstance().

Differential Revision: https://phabricator.services.mozilla.com/D141785
2022-03-29 13:11:00 +00:00
Mark Banner
8bb4667fae Bug 1758474 - Implement an ESLint rule to disallow passing {} as the target parameter for ChromeUtils.import. r=Gijs,mossop,perftest-reviewers,preferences-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D140517
2022-03-11 16:41:29 +00:00
smolnar
e89faa903f Backed out changeset 5018856d8fee (bug 1758474) for causing node eslint failure. CLOSED TREE 2022-03-10 11:58:45 +02:00
Mark Banner
fe937b78bd Bug 1758474 - Implement an ESLint rule to disallow passing {} as the target parameter for ChromeUtils.import. r=Gijs,mossop,perftest-reviewers,preferences-reviewers,sparky
Differential Revision: https://phabricator.services.mozilla.com/D140517
2022-03-10 09:25:28 +00:00
Barret Rennie
c7594bbe50 Bug 1745356 - Remove osfile.jsm from browser/components/attribution r=nalexander
Differential Revision: https://phabricator.services.mozilla.com/D133840
2021-12-25 20:59:24 +00:00
Barret Rennie
2605c53228 Bug 1745356 - Remove osfile.jsm from Mac Attribution r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D133838
2021-12-25 20:59:24 +00:00
Evgenia Kotovich
b7899c1c92 Bug 1733535 - Replace OS.File with IOUtils in the attribution code. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D128715
2021-10-25 08:38:52 +00:00
Norisz Fay
b641c43be1 Backed out changeset d63aab4e0688 (bug 1733535) for causing mochitest failures on browser_AttributionCode_telemetry.js CLOSED TREE 2021-10-22 16:32:43 +03:00
Evgenia Kotovich
03e4d49965 Bug 1733535 - Replace OS.File with IOUtils in the attribution code. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D128715
2021-10-22 11:57:44 +00:00
Mark Banner
11bfa90d06 Bug 1602940 - Automated replacements to use Services.uuid. r=Gijs,necko-reviewers,preferences-reviewers,kershaw
Depends on D124391

Differential Revision: https://phabricator.services.mozilla.com/D124392
2021-09-06 09:53:52 +00:00
Kirk Steuber
6bf6521c69 Bug 1677497 - Add support for the attribution parameter: dltoken r=nalexander,Mardak
Differential Revision: https://phabricator.services.mozilla.com/D100969
2021-01-20 01:08:43 +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
Nick Alexander
de497caa38 Bug 1525076 - Part 4: Cache attribution code on macOS. r=mixedpuppy
Querying the macOS system quarantine database is relatively slow, so
we'd like to do it only once.  This is relevant because the Telemetry
subsystem causes the attribution data to be fetched relatively early
during startup.  By caching, we accept additional disk activity but
don't have to invoke an external process, query a database, etc.

We must make BROWSER_ATTRIBUTION_ERRORS histogram apply to macOS as
well as Windows.  We add error codes to capture macOS-specific
detalis.  And we push this out to a later cycle, since there's no
reason to revisit this immediately.

Differential Revision: https://phabricator.services.mozilla.com/D92695
2020-10-11 18:20:11 +00:00
Nick Alexander
05efc87784 Bug 1525076 - Part 3: Add method to serialize attribution data. r=mixedpuppy
On Windows, we parse the attribution data as if it was the
`URL.search` parameter.  On macOS, we parse a URL slightly
differently: we parse it like `URL.searchParams` and we deduplicate
parameters.

For caching on macOS we need to serialize the parsed data.  We could
use either approach but we elect to write the code serialized as it
would be on Windows, since that is the one that is getting actively
tested in the wild.

Differential Revision: https://phabricator.services.mozilla.com/D92694
2020-10-11 18:19:22 +00:00
Nick Alexander
9df69a9722 Bug 1525076 - Part 2: Add AttributionCode.writeAttributionFile. r=mixedpuppy
The next step is to have the cached attribution file location vary
depending on the platform, and to have the tests run on additional
platforms.

Differential Revision: https://phabricator.services.mozilla.com/D84264
2020-10-11 18:19:04 +00:00
Nick Alexander
4c713eeeaf Bug 1525076 - Part 1: Fix macOS native getReferrerUrl by invoking system sqlite binary (from JS). r=mixedpuppy
The issue this is addresses is that
[`CFURLCopyResourcePropertyForKey`](https://searchfox.org/mozilla-central/rev/ea7f70dac1c5fd18400f6d2a92679777d4b21492/xpcom/io/CocoaFileUtils.mm#212)
does not return quarantine data when launched as a GUI App.  What
happens is that launching via the GUI requires the user to override
GateKeeper by going to Security & Privacy > Open Anyway.  Doing that
updates the GateKeeper flags, and then the macOS API denies access:
once the GK flags reach some state, quarantine information is not
returned.  This is not documented (as far as I can see) but moons ago,
[somebody else on the internet witnessed the same
thing](https://cocoa-dev.apple.narkive.com/kkYeAC8o/is-it-possible-to-read-your-own-quarantine-info-after-launch).

To work around, we run the system SQLite binary, to fish the relevant
information out of the per-user quarantine database.  (SQLite is
installed by default on all relevant macOS versions.)

The most significant security concern I see is whether we can trust
this binary (in /usr/bin/sqlite3). Some discussion within the
Install/Update team suggested that an attacker who could corrupt or
modify that binary already had write access to the disk, which is an
attack vector equal to a totally compromised Firefox. If we determine
that we can't use the system SQLite binary, then we could use
Firefox's compiled copy of SQLite, but we might see versioning
issues. The system SQLite binary feels more robust.

This is implemented as a JS component for convenience, mostly: there
is no API for capturing output from `nsIProcess`.  It would be
possible to maintain the existing XPCOM contract by renaming the
existing contract and adding a contract with a JS implementation that
passes through to the renamed implementation, but it doesn't seem
worth the effort.

In the next commits, we will generalize the existing caching mechanism
form Windows to also apply to macOS. This is mostly a performance
optimization, so that we sniff a single well-known location rather
than launching a process at each startup, although there is a
correctness argument here as well, since the quarantine database is
dynamic and the attribution URL could expire.

Differential Revision: https://phabricator.services.mozilla.com/D92693
2020-10-11 18:18:36 +00:00
Nick Alexander
ec7bc15264 Bug 1525076 - Part 0: Test more scenarios on macOS; handle URI component encoding. r=mixedpuppy
The existing code handles Windows and macOS quite differently.  On
macOS, the tests were not as comprehensive; this patch brings them
level and makes the form of the attribution data uniform on Windows
and macOS.  In particular, attribution data fields will now be URI
coded, just as they are on Windows.

This will allow us to re-use the parsing machinery we have on Windows
when we cache attribution codes on macOS.

Differential Revision: https://phabricator.services.mozilla.com/D92692
2020-10-11 18:18:11 +00:00
Nick Alexander
debc4642c5 Bug 1525076 - Pre: Avoid a crash in CFRelease. r=mixedpuppy
A malformed URL returns null.  The subsequent call to
`CocoaFileUtils::AddQuarantineMetadataToFile` does handle null
correctly, so this just avoids a crash.

Differential Revision: https://phabricator.services.mozilla.com/D92691
2020-10-11 18:18:08 +00:00
Razvan Maries
d5e4596a8f Backed out 6 changesets (bug 1525076) for perma failures on browser_startup_mainthreadio.js. CLOSED TREE
Backed out changeset a425e504ae7e (bug 1525076)
Backed out changeset 5163df5430c1 (bug 1525076)
Backed out changeset 4313cfb9dfcb (bug 1525076)
Backed out changeset 9178ebc95da2 (bug 1525076)
Backed out changeset 7bde7f6ccbd8 (bug 1525076)
Backed out changeset 6c2c2e07b95f (bug 1525076)
2020-10-09 22:51:36 +03:00
Nick Alexander
0c64a008ae Bug 1525076 - Part 4: Cache attribution code on macOS. r=mixedpuppy
Querying the macOS system quarantine database is relatively slow, so
we'd like to do it only once.  This is relevant because the Telemetry
subsystem causes the attribution data to be fetched relatively early
during startup.  By caching, we accept additional disk activity but
don't have to invoke an external process, query a database, etc.

We must make BROWSER_ATTRIBUTION_ERRORS histogram apply to macOS as
well as Windows.  We add error codes to capture macOS-specific
detalis.  And we push this out to a later cycle, since there's no
reason to revisit this immediately.

Differential Revision: https://phabricator.services.mozilla.com/D92695
2020-10-09 17:28:51 +00:00
Nick Alexander
70222a9a39 Bug 1525076 - Part 3: Add method to serialize attribution data. r=mixedpuppy
On Windows, we parse the attribution data as if it was the
`URL.search` parameter.  On macOS, we parse a URL slightly
differently: we parse it like `URL.searchParams` and we deduplicate
parameters.

For caching on macOS we need to serialize the parsed data.  We could
use either approach but we elect to write the code serialized as it
would be on Windows, since that is the one that is getting actively
tested in the wild.

Differential Revision: https://phabricator.services.mozilla.com/D92694
2020-10-09 17:28:48 +00:00
Nick Alexander
b436e5cb98 Bug 1525076 - Part 2: Add AttributionCode.writeAttributionFile. r=mixedpuppy
The next step is to have the cached attribution file location vary
depending on the platform, and to have the tests run on additional
platforms.

Differential Revision: https://phabricator.services.mozilla.com/D84264
2020-10-09 17:28:46 +00:00
Nick Alexander
95284b4d0f Bug 1525076 - Part 1: Fix macOS native getReferrerUrl by invoking system sqlite binary (from JS). r=mixedpuppy
The issue this is addresses is that
[`CFURLCopyResourcePropertyForKey`](https://searchfox.org/mozilla-central/rev/ea7f70dac1c5fd18400f6d2a92679777d4b21492/xpcom/io/CocoaFileUtils.mm#212)
does not return quarantine data when launched as a GUI App.  What
happens is that launching via the GUI requires the user to override
GateKeeper by going to Security & Privacy > Open Anyway.  Doing that
updates the GateKeeper flags, and then the macOS API denies access:
once the GK flags reach some state, quarantine information is not
returned.  This is not documented (as far as I can see) but moons ago,
[somebody else on the internet witnessed the same
thing](https://cocoa-dev.apple.narkive.com/kkYeAC8o/is-it-possible-to-read-your-own-quarantine-info-after-launch).

To work around, we run the system SQLite binary, to fish the relevant
information out of the per-user quarantine database.  (SQLite is
installed by default on all relevant macOS versions.)

The most significant security concern I see is whether we can trust
this binary (in /usr/bin/sqlite3). Some discussion within the
Install/Update team suggested that an attacker who could corrupt or
modify that binary already had write access to the disk, which is an
attack vector equal to a totally compromised Firefox. If we determine
that we can't use the system SQLite binary, then we could use
Firefox's compiled copy of SQLite, but we might see versioning
issues. The system SQLite binary feels more robust.

This is implemented as a JS component for convenience, mostly: there
is no API for capturing output from `nsIProcess`.  It would be
possible to maintain the existing XPCOM contract by renaming the
existing contract and adding a contract with a JS implementation that
passes through to the renamed implementation, but it doesn't seem
worth the effort.

In the next commits, we will generalize the existing caching mechanism
form Windows to also apply to macOS. This is mostly a performance
optimization, so that we sniff a single well-known location rather
than launching a process at each startup, although there is a
correctness argument here as well, since the quarantine database is
dynamic and the attribution URL could expire.

Differential Revision: https://phabricator.services.mozilla.com/D92693
2020-10-09 17:27:13 +00:00
Nick Alexander
ba4da7e71e Bug 1525076 - Part 0: Test more scenarios on macOS; handle URI component encoding. r=mixedpuppy
The existing code handles Windows and macOS quite differently.  On
macOS, the tests were not as comprehensive; this patch brings them
level and makes the form of the attribution data uniform on Windows
and macOS.  In particular, attribution data fields will now be URI
coded, just as they are on Windows.

This will allow us to re-use the parsing machinery we have on Windows
when we cache attribution codes on macOS.

Differential Revision: https://phabricator.services.mozilla.com/D92692
2020-10-09 17:26:38 +00:00