Commit graph

67 commits

Author SHA1 Message Date
Kris Maglione
e930b89c34 Bug 1514594: Part 3 - Change ChromeUtils.import API.
***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8

This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:

  ChromeUtils.import("resource://gre/modules/Services.jsm");

is approximately the same as the following, in the new model:

  var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs

This was done using the followng script:

https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs

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

--HG--
extra : rebase_source : 359574ee3064c90f33bf36c2ebe3159a24cc8895
extra : histedit_source : b93c8f42808b1599f9122d7842d2c0b3e656a594%2C64a3a4e3359dc889e2ab2b49461bab9e27fc10a7
2019-01-17 10:18:31 -08:00
edward.i.wu
06030d9eb9 Bug 1370077 - Avoid deprecation message when background.persistent is true r=robwu,aswan
Add support for enumerations to boolean types, and use it to only show
a deprecation message when background.persistent is false.

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

--HG--
extra : moz-landing-system : lando
2019-01-10 01:11:44 +00:00
Mark Banner
29ebe3f3a8 Bug 1478308 - Remove unnecessary ChromeUtils.imports in toolkit/ r=mikedeboer
MozReview-Commit-ID: 45Tfs2ZZ06r

--HG--
extra : rebase_source : f76738612cb5f78787e9fae8f8c563d5ff5f33d1
2018-07-25 11:00:35 +01:00
Narcis Beleuzu
d47c829065 Backed out 4 changesets (bug 1478308) for ESlint failure on AttributionCode.jsm. CLOSED TREE
Backed out changeset a809b45ff49b (bug 1478308)
Backed out changeset c68131530742 (bug 1478308)
Backed out changeset 0e4ba7a6dc1a (bug 1478308)
Backed out changeset 32a27f317a77 (bug 1478308)
2018-07-26 11:13:28 +03:00
Mark Banner
d95c1526b8 Bug 1478308 - Remove unnecessary ChromeUtils.imports in toolkit/ r=mikedeboer
MozReview-Commit-ID: 45Tfs2ZZ06r

--HG--
extra : rebase_source : 10f2f734c883a1ac85b5dee21df119a4c6ae2898
2018-07-25 11:00:35 +01:00
Mark Banner
087fb7a351 Bug 1465762 - Enable ESLint rule require-expected-throws-or-rejects for toolkit/**/extensions. r=aswan
MozReview-Commit-ID: 5pS6RHs0naW

--HG--
extra : rebase_source : 23704b62cfccef6b43ce08657116398cbfb9beee
2018-05-31 13:45:44 +01:00
Narcis Beleuzu
08e410f7c9 Backed out changeset 6630148c9bea (bug 1465762) for xpcshell failures on test_ext_schemas_async.js. CLOSED TREE 2018-06-01 12:32:24 +03:00
Mark Banner
ba6c2dc836 Bug 1465762 - Enable ESLint rule require-expected-throws-or-rejects for toolkit/**/extensions. r=aswan
MozReview-Commit-ID: 5pS6RHs0naW

--HG--
extra : rebase_source : 1859cf05dc269ef6873e0836f1f855e8ce1e9fed
2018-05-31 13:45:44 +01:00
Kris Maglione
32fa162ac2 Bug 1452307: Remove some dead code. r=aswan
MozReview-Commit-ID: DpV0WWW8WKF

--HG--
extra : rebase_source : e697d8fd91c40c15df21551514b239de6a9a117f
extra : histedit_source : 45120f4b9208ab3f92b9cbc295b1c6e706412bd1
2018-04-08 12:55:20 -07:00
Kris Maglione
918ed6c474 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
2018-01-29 15:20:18 -08:00
Cosmin Sabou
9a65a40178 Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00
Kris Maglione
6476f95b13 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
2018-01-29 15:20:18 -08:00
Brindusan Cristian
af8879d1eb Backed out 2 changesets (bug 1431533) for ESlint failures on a CLOSED TREE
Backed out changeset 6e56f4c8843e (bug 1431533)
Backed out changeset 12fc4dee861c (bug 1431533)
2018-01-30 02:32:43 +02:00
Kris Maglione
c276bb9375 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : rebase_source : c004a023389f1f6bf3d2f3efe93c13d423b23ccd
2018-01-29 15:20:18 -08:00
Andrew Swan
4ef30c33a8 Bug 1426259: Implement import for webextensions schemas r=kmag
MozReview-Commit-ID: LFYh8SzpCVN

--HG--
extra : rebase_source : a2f005c05fa22860b6055dbd92583e7a347561ea
2017-12-19 14:32:35 -08:00
Florian Quèze
0f55cd45be Bug 1421992 - script-generated patch to replace do_execute_soon, do_print and do_register_cleanup with executeSoon, info and registerCleanupFunction, rs=Gijs. 2017-12-21 11:10:23 +01:00
Florian Quèze
032c961e0a Bug 1421992 - script-generated patch to replace do_check_* functions with their Assert.* equivalents, rs=Gijs. 2017-12-21 11:08:17 +01:00
Kris Maglione
4a4c4fdfd4 Bug 1421459: Update to ESLint 4 "indent" rule. r=aswan
MozReview-Commit-ID: LxLDWlsIlSk

--HG--
extra : rebase_source : 5762bdf08ff6c09c1b29f87366bddb552e4c74b2
extra : amend_source : 922a0c03722bd5a81daace7f0289ec3228191cfb
2017-11-28 14:13:59 -08:00
Andreas Wagner
e342b5760e Bug 1390917 - Accept data:image/png and data:image/jpeg as theme background; r=aswan,mikedeboer
MozReview-Commit-ID: 2roQoBrc7mv

--HG--
extra : rebase_source : 286fce68b0dea32e12f86ca92838d5f04d3efbb7
2017-08-17 21:51:36 +02:00
Carsten "Tomcat" Book
198430bca2 merge mozilla-inbound to mozilla-central a=merge 2017-07-26 11:11:40 +02:00
Kris Maglione
14751a4c28 Bug 1382645: Part 3 - Throw away description strings before blobbifying schema JSON. r=mixedpuppy
MozReview-Commit-ID: 8rWQQhaTRr8

--HG--
extra : rebase_source : 6829856944e451703c4f4152bdb5076ccc2765de
2017-07-25 15:00:01 -07:00
Tomislav Jovanovic
8a5320360e Bug 1363886 - Part 1: Check API function results against schema r=kmag
MozReview-Commit-ID: E2mGR03zUSf

--HG--
extra : rebase_source : c6e5ba33da902bda726de74f48afba71bc1bfe66
2017-07-24 00:03:20 +02:00
Sebastian Hengst
8d509086f2 Backed out changeset 8955980312a6 (bug 1363886) for failing mochitests test_ext_contentscript_permission.html and test_chrome_ext_contentscript_unrecognizedprop_warning.html on Android 4.3 debug. r=backout 2017-07-25 10:42:33 +02:00
Tomislav Jovanovic
11da51bc71 Bug 1363886 - Part 1: Check API function results against schema r=kmag
MozReview-Commit-ID: E2mGR03zUSf

--HG--
extra : rebase_source : c6e5ba33da902bda726de74f48afba71bc1bfe66
2017-07-24 00:03:20 +02:00
Thomas Wisniewski
6e4b30e56a Bug 1376991 - Extend browsingData to restrict removing cookies to a give list of hostnames; r=mixedpuppy
MozReview-Commit-ID: 4Tfneh5s1Q8
***
Fixes for try run failures

MozReview-Commit-ID: 2BAT1GUcvH3

--HG--
extra : rebase_source : a9e3777e3967ee4e95bb27bd575020ed16a559e9
2017-06-30 09:11:18 -04:00
Kris Maglione
4338b93cfd Bug 1373293: Drop invalid permissions when normalizing manifests. r=bsilverberg
MozReview-Commit-ID: EIGhP6rRLzW

--HG--
extra : rebase_source : 28926b3ed4e65351c28ec7176ccdf4af2e5e0471
extra : amend_source : 7f2b1b990f9b75082be4aacb25593352dc5cca94
2017-06-21 12:12:51 -07:00
Luca Greco
c85585ac17 Bug 1293298 - Implement events in SubTypes defined in the WebExtensions API schema files. r=aswan
MozReview-Commit-ID: CAYaenfSih1

--HG--
extra : rebase_source : 2c78836c03e7fc8b16164221a16329577b64033a
2017-06-01 20:02:54 +02:00
Tomislav Jovanovic
a66827ba70 Bug 1333403 - Part 1: Implement $import keyword for schema namespaces r=kmag
MozReview-Commit-ID: 5CYsQa3b05C

--HG--
extra : rebase_source : dc804509a2fa9b526657c09d79403ec2c73db618
2017-06-07 16:44:19 +02:00
Sebastian Hengst
f572cdea68 Backed out changeset 37b0fcb54cba (bug 1333403) for eslint failure: browser/components/extensions/ext-c-menus.js:158:24 | 'SingletonEventManager' is not defined. r=backout 2017-06-10 16:07:23 +02:00
Tomislav Jovanovic
02921511df Bug 1333403 - Part 1: Implement $import keyword for schema namespaces r=kmag
MozReview-Commit-ID: 5CYsQa3b05C

--HG--
extra : rebase_source : 8a70876e63826861ca8df2d32c9d7915111c9e10
2017-06-07 16:44:19 +02:00
Florian Quèze
5e3539e504 Bug 1353542 - massive script-generated patch converting Task.async and Task.spawn calls, and generators clearly identifiable as tasks, rs=Mossop. 2017-05-12 14:42:39 +02:00
Kris Maglione
6851746d1a Bug 1338409: Part 1 - Lazily parse the schema data for each namespace as it is needed. r=aswan
MozReview-Commit-ID: 73q9ba9sLtb

--HG--
extra : rebase_source : 9900392db716c6d955fee873bd0f2ac2fa728dff
2017-02-10 21:06:55 -08:00
Carsten "Tomcat" Book
cc5d30c616 Merge mozilla-central to mozilla-inbound
--HG--
extra : rebase_source : 658b3ffdfa71afff2d44129f50e50e2fbecbd06e
2016-11-11 16:43:07 +01:00
Kris Maglione
5669335dd9 Bug 1316396: Part 1 - Reorganize parent, child, common, and test code into more appropriate modules. r=aswan
MozReview-Commit-ID: 5WMt69GoN3K

--HG--
rename : toolkit/components/extensions/ExtensionUtils.jsm => toolkit/components/extensions/ExtensionCommon.jsm
rename : toolkit/components/extensions/Extension.jsm => toolkit/components/extensions/ExtensionParent.jsm
rename : toolkit/components/extensions/Extension.jsm => toolkit/components/extensions/ExtensionTestCommon.jsm
extra : rebase_source : 43ddde9dccf5b89777cf07bacf71816076e7b57f
2016-11-10 12:35:22 -08:00
Jared Wein
4b027e3645 Bug 1315781 - Enable no-shadow rule for eslint for xpcshell mochitests. r=mossop
MozReview-Commit-ID: 1mhCWplknyN

--HG--
extra : rebase_source : ab47e6e1bc2ba94fa26179ec18053fa798d9b778
2016-11-07 22:34:25 -05:00
Iris Hsiao
0cc78823fe Backed out changeset f6f28be8d8f2 (bug 1315781) for XPCShell test timed out
--HG--
extra : rebase_source : 0122a5372b6ac2174d4c37e7cc0169bf9c437178
2016-11-10 14:53:46 +08:00
Jared Wein
8ebd29ee02 Bug 1315781 - Enable no-shadow rule for eslint for xpcshell mochitests. r=mossop
MozReview-Commit-ID: DnpVQRrG9Ec

--HG--
extra : rebase_source : 3641e46c32b0e6700ee86fc71dcd35924ce1ed3a
2016-11-07 22:34:25 -05:00
Bob Silverberg
4e2ac40f90 Bug 1262250 - Add a defaultValue property to the web extension schema, r=aswan
MozReview-Commit-ID: 175Nxr39NKw

--HG--
extra : rebase_source : 0e912eb54e8179a22ee97c731885cd8d2715db1b
2016-10-03 14:55:17 -04:00
Rob Wu
e080d5603d Bug 1287010 - Refactor shouldInject / pathObj r=billm
Split the `shouldInject` method into separate methods:
- `shouldInject` to determine whether the API (or namespace)
  should be injected.
- `getImplementation` to return the actual implementation.

Introduced `SchemaAPIInterface` for documentation purposes, and
two concrete implementations `LocalAPIImplementation` and
`ProxyAPIImplementation` which provide the functionality to run a local
and remote implementation of the API for which the schema API is
generated, respectively. These classes store the necessary details for
the invocation, so the methods that were formerly in the `Context` in
Schemas.jsm no longer get the `pathObj`, `path` or `name` parameters.

And merge the `path` and `name` in the implementation of remote APIs
because there is no need for having them separate, as the callers and
callees often did redundant pre/post-processing on `data.path` because
of the way it was implemented.

MozReview-Commit-ID: isbG9i9pNP

--HG--
extra : rebase_source : 22cdc3ab3d14c6381f9f540739d6750281ae8c71
2016-08-24 01:03:49 -07:00
Rob Wu
1067b066d5 Bug 1287010 - Add pathObj parameter to Schemas r=billm
Local wrappers currently look up the API object over and over again
whenever a schema API is invoked. This can be optimized by re-using
the lookup result from a `shouldInject` invocation, which is passed
as the `pathObj` parameter to the wrapper methods.

This commit adds the necessary changes and tests to allow this to
happen, but does not modify the wrapper in Extension.jsm yet.

Also, this construction allows the `ChildAPIManager` to use a local
implementation if available and fall back to a remote implementation
otherwise.

MozReview-Commit-ID: C9gm7A9Zppb

--HG--
extra : rebase_source : e2ab1e40de72fdea23acc9a68f3cf7d77e3da66f
2016-08-19 00:35:07 -07:00
Rob Wu
4b607a2721 Bug 1297202 - Support cross-namespace submodule references in schemas r=aswan
MozReview-Commit-ID: 5JfOI3i3xbW

--HG--
extra : rebase_source : 48aad5003198fe9ec101b5b96c0b5fccd26c08d9
2016-08-22 15:11:47 -07:00
Luca Greco
87980ec799 Bug 1290901 - [webext] Add xpcshell test cases on nested namespaces and null/empty api objects. r=aswan
MozReview-Commit-ID: HKh3gXTk09H

--HG--
extra : rebase_source : 4c2fa93c8fb43682ed4674bc7fe27ef2b1464efb
2016-08-02 04:00:46 +02:00
Kris Maglione
a1dac7caad Bug 1279392: [webext] Move API permission definitions to the schemas. r=aswan
MozReview-Commit-ID: 8m7wJrAbFwS

--HG--
extra : source : a00cf073f5c00380d4e42b13bc0cd3146b708845
extra : amend_source : d74ef90e88acbe62e33af3b5b9cf870d5c0a9d3e
2016-06-09 17:44:47 -07:00
Sebastian Hengst
f8035f62a8 Backed out changeset a00cf073f5c0 (bug 1279392) for failing mochitest test_ext_contentscript_create_iframe.html at least on Linux x64 opt. r=backout 2016-06-14 13:37:52 +02:00
Kris Maglione
b465305345 Bug 1279392: [webext] Move API permission definitions to the schemas. r=aswan
MozReview-Commit-ID: 8m7wJrAbFwS

--HG--
extra : rebase_source : cba877c0ef400917b0b7e5913895e64ebefb34b9
extra : amend_source : 6e943015e3e00854c431cbd653994a6734e66ce4
2016-06-09 17:44:47 -07:00
Kris Maglione
6439777db0 Bug 1271785: [webext] Better error messages for "choices" schema types. r=aswan
The generated messages are still a bit rough in some instances, but they're at
least much better than what we have now.

MozReview-Commit-ID: gTS0RvDnwk

--HG--
rename : toolkit/components/extensions/test/xpcshell/.eslintrc => browser/components/extensions/test/xpcshell/.eslintrc
rename : toolkit/components/extensions/test/xpcshell/head.js => browser/components/extensions/test/xpcshell/head.js
rename : toolkit/components/extensions/test/xpcshell/test_ext_manifest_content_security_policy.js => browser/components/extensions/test/xpcshell/test_ext_manifest_commands.js
rename : toolkit/components/extensions/test/xpcshell/xpcshell.ini => browser/components/extensions/test/xpcshell/xpcshell.ini
extra : rebase_source : 058603a2ab0efa90d3626b82be6d5e2cf1436fc3
extra : amend_source : 3a7924ef237cb392dd2f4c1f696b8858daad43ab
2016-06-04 23:31:35 -07:00
Kris Maglione
c7733098d7 Bug 1254194: [webext] Add 'onError' schema option to make manifest errors non-fatal. r=aswan
MozReview-Commit-ID: ByGsO4WFcOU

--HG--
extra : rebase_source : 913b5617dcf7f66b51b28f8d8dd12722c29e5fa8
2016-04-14 16:39:09 -07:00
Bill McCloskey
261372f2cb Bug 1197346 - Allow browser.storage to be used from content scripts (r=kmag) 2016-04-23 20:04:30 -07:00
Bill McCloskey
9dc52ee77a Bug 1197346 - Add callFunctionNoReturn (r=kmag) 2016-04-23 20:04:29 -07:00
Andrew Swan
76e599335e Bug 1251766 - Add new Date type to webextensions schemas. r=kmag
MozReview-Commit-ID: EEX5FziiINo

--HG--
extra : rebase_source : 68da63aeacb6a711c7a35827f36f7d97c00e48d0
2016-03-04 13:08:19 -08:00