Commit Graph

100 Commits

Author SHA1 Message Date
Kris Maglione
d380a39518 Bug 1452307: Remove support for old-style experiment API extensions. r=aswan
MozReview-Commit-ID: 5y48pMRQ5XW
2018-04-06 18:14:59 -07:00
Andrew Swan
71b430f70e Bug 1450388 Part 3: Implement persistent option for EventManager r=kmag
MozReview-Commit-ID: BtccacvzhE8
2018-03-30 16:38:42 -07:00
Andrew Swan
dfdaca71bf Bug 1450388 Part 1 Refactor EventManager r=kmag
As we add more behaviors to EventManager, the signature of the constructor
is going to get really clumsy.  Head that off by converting it to take a
general parameters object.

This introduces a compatibility problem for existing webextension experiments,
put in a backward-compatibility shim for now.

MozReview-Commit-ID: 72QDfiwRm5j
2018-03-14 14:52:44 -07:00
Kris Maglione
4c402a31f9 Bug 1451215: Run codespell on code. r=aswan
MozReview-Commit-ID: HIilZTKcQUY
2018-04-03 22:22:07 -07:00
Kris Maglione
a68a7b5ca9 Bug 1441333: Part 5 - Use proper async caller location in normalizeError. r=zombie
Currently, when we create an error object at the end of an aysnc operation, we
only get a useful caller location if async stacks are enabled.

This patch changes our behavior to use the saved caller location we've already
stored when creating an Error object based on a plain string message.

MozReview-Commit-ID: DDO0lAUHYRO
2018-03-01 16:39:08 -08:00
Kris Maglione
50e5efde7d Bug 1441333: Part 4 - Add caller location to async API errors. r=zombie
When we report errors generated by async API operations, they are currently
not tied to any relevant extension source location. Instead, the locations in
the error reports point to the location in the framework code which reported
the error, which makes things extremely difficult to diagnose.

This change saves the extension caller location at the beginning of async API
operations, and adds it to the error reports genearted by that operation. This
should give extension developers a useful starting point for debugging them.

MozReview-Commit-ID: AkknkKEosFt
2018-02-26 15:25:03 -08:00
Andrew Swan
1ca7c0ba65 Bug 1434076 Correct calls to getAPI() on wrong api manager r=kmag
MozReview-Commit-ID: ADrV9x8gXhc
2018-02-22 12:20:34 -08:00
Florian Quèze
f1a55f73f8 Bug 1440284 - change this.EXPORTED_SYMBOLS back to var EXPORTED_SYMBOLS in JS modules, r=mccr8. 2018-02-23 20:50:01 +01:00
Andrew McCreight
272cee1e65 Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG
2018-02-06 09:36:57 -08:00
Kris Maglione
0bb74efdf1 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
2018-01-29 15:20:18 -08:00
Cosmin Sabou
f09d6d985d 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
fd67f090b2 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
2018-01-29 15:20:18 -08:00
Brindusan Cristian
483ba301cb 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
683a97d172 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
2018-01-29 15:20:18 -08:00
Kris Maglione
1046270983 Backed out 3 changesets (bug 1431533) for Android mochitest bustage. CLOSED TREE
MozReview-Commit-ID: 5ubE9EMQpZ9
2018-01-24 22:04:59 -08:00
Kris Maglione
50ace7f99d Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
MozReview-Commit-ID: 8V1ZT53ReiP
2018-01-24 15:48:47 -08:00
Kris Maglione
a62086a27e Bug 1431533: Part 3 - Define ChromeUtils on chrome-privileged Sandboxes that need it. r=mixedpuppy
This is necessary before we enable the ESLint rule to require using
ChromeUtils for module imports rather than older methods.

MozReview-Commit-ID: mKqByUS0o2
2018-01-18 14:52:39 -08:00
Kris Maglione
661ea33e42 Bug 1323845: Part 6a - Support WebExtension-style experiment API provider extensions. r=aswan
MozReview-Commit-ID: E1IBFyzEwqU
2018-01-09 17:20:55 -08:00
Kris Maglione
3ad29270e5 Bug 1323845: Part 5a - Allow extensions to bundle experiment API modules. r=aswan
MozReview-Commit-ID: 5suo2MqM51V
2018-01-09 16:28:36 -08:00
Kris Maglione
85e66cb2a3 Bug 1323845: Part 3 - Auto-create intermediate API namespace objects when necessary. r=aswan
MozReview-Commit-ID: HA8WpynPOqp
2018-01-09 16:02:38 -08:00
Kris Maglione
a96e1007ac Bug 1323845: Part 2c - Lazy init API global only when APIs are first loaded. r=aswan
MozReview-Commit-ID: B1bbiM0j5gT
2018-01-09 16:07:45 -08:00
Kris Maglione
2898ad39b0 Bug 1323845: Part 2b - Support separate schema roots for each API manager. r=aswan
MozReview-Commit-ID: 61LhYiIKVTH
2017-12-16 14:51:10 -06:00
Kris Maglione
2d3a2b7f99 Bug 1323845: Part 2a - Support separate API managers for each extension. r=aswan
MozReview-Commit-ID: 5gGsMm1ahd
2017-12-16 15:33:23 -06:00
Kris Maglione
2e65b7ecf0 Bug 1323845: Part 0 - Cleanup some code formatting. r=aswan
MozReview-Commit-ID: 9awFVoN0REF
2017-12-12 17:53:04 -05:00
Andrew Swan
9ae021cd5e Bug 1423425 Make some extensions comments jsdoc-compatible r=kmag
MozReview-Commit-ID: 3mUKR9IuEKA
2017-12-05 18:53:15 -08:00
Cosmin Sabou
e0a5c2495c Backed out 3 changesets (bug 1423425) for frequent browser chrome failures r=backout on a CLOSED TREE
Backed out changeset c3ac950b0b8a (bug 1423425)
Backed out changeset d64fd69a4b88 (bug 1423425)
Backed out changeset 04017639642a (bug 1423425)
2017-12-16 02:45:41 +02:00
Andrew Swan
80b2221edc Bug 1423425 Make some extensions comments jsdoc-compatible r=kmag
MozReview-Commit-ID: 3mUKR9IuEKA
2017-12-05 18:53:15 -08:00
Kris Maglione
c8ea1d4273 Bug 1421459: Update to ESLint 4 "indent" rule. r=aswan
MozReview-Commit-ID: LxLDWlsIlSk
2017-11-28 14:13:59 -08:00
tushararora
fa5e677c46 Bug 1334782 - tabs.query should pattern match the title r=zombie
MozReview-Commit-ID: 5WaKLaOP7Nc
2017-11-16 16:17:45 +05:30
Mark Banner
45b0812566 Bug 1412893 - Change instances of using getService to Services.jsm where possible in toolkit/components - Part 1. r=mossop
MozReview-Commit-ID: BBnacIvRJBR
2017-10-30 16:29:58 +00:00
Kris Maglione
4b334cc818 Bug 1398974: Follow-up: Disconnect StreamFilters when closing extension context. r=me
If we don't do this explicitly, the channel is automatically disconnected when
it's GCed. However, if we start shutdown while a stream is being processed,
the stream may not be GCed before we shut down the parent process's message
loop. In that case, we get a shutdown crash because the StreamFilterParent's
data channel is still open when we shut down its message loop.

Explicitly disconnecting the StreamFilter when the context is closed prevents
this, since app shutdown is automatically blocked on extension shutdown, and
extension shutdown explicitly closes all extant contexts.

MozReview-Commit-ID: 5JPrSUooq1j
2017-09-12 18:55:24 -07:00
Kris Maglione
19017b8170 Bug 1398630: Part 7 - Random cleanup. r=zombie
MozReview-Commit-ID: LibtXDKXrnA
2017-09-10 15:37:08 -07:00
Kris Maglione
94a32e9a33 Bug 1398630: Part 4 - Use getWinUtils everywhere we use DOMWindowUtils. r=zombie
MozReview-Commit-ID: FroMQF9Tiz1
2017-09-10 15:33:54 -07:00
Kris Maglione
1b68bb4924 Bug 1398630: Part 3 - Use document.docShell rather than longer/slower XPC paths. r=zombie
MozReview-Commit-ID: 5oD0Uvv1pvx
2017-09-11 14:53:20 -07:00
Kris Maglione
877f3c7535 Bug 1398630: Part 1 - Remove/cleanup some old ExtensionUtils helpers. r=zombie
MozReview-Commit-ID: FeLUjH7pkiB
2017-09-10 15:39:28 -07:00
Andrew McCreight
cb4467a845 Bug 1186409 - Fix code that tries to get the global by using |this|. r=kmag
MozReview-Commit-ID: C5ixngtvzWU
2017-05-25 14:12:12 -07:00
Kris Maglione
3c6bbd9ea4 Bug 1396856: Part 1 - Remove spread call fallback overhead in event dispatch. r=zombie
MozReview-Commit-ID: 3c5p9OvRqHI
2017-09-05 11:20:43 -07:00
Kris Maglione
27e68ac62f Bug 1393621: Part 1 - Don't load ext-contextualIdentities at startup without permissions. r=zombie
MozReview-Commit-ID: AiIYAXSRrii
2017-08-31 15:09:41 -07:00
Bob Silverberg
16cd8b1c16 Bug 1374552 - Fix i18n.getUILanguage so it does not replace dashes with underscores, r=mixedpuppy
When we implemented this API we converted dashes in the language code to underscores because that is what Chrome did.
Chrome no longer does this, so we need to remove the code that does the replacing.

MozReview-Commit-ID: DuOQ218zXby
2017-08-11 09:45:35 -04:00
Wes Kocher
9a9581c0d5 Merge m-c to inbound, a=merge
MozReview-Commit-ID: EgYue63nSkv
2017-08-18 16:29:11 -07:00
Kris Maglione
12cba737fa Bug 1391310: Optimize runSafe/wrapPromise to avoid wrapper/spread arg/rest arg overhead. r=zombie
Lots of little bits of overhead add up to a significant amount of overhead
over the many, many times this function is called.

MozReview-Commit-ID: BYTWxqc8rH9
2017-08-18 11:53:25 -07:00
Kris Maglione
d3d0a0694d Bug 1391158: Optimize checkLoadURL for the common case of extension URLs. r=mixedpuppy
MozReview-Commit-ID: KGFFcHxQSvZ
2017-08-16 23:03:15 -07:00
Julian Descottes
ef916b7121 Bug 1374735 - stop exposing devtools require to extensions ext-* files;r=kmag CLOSED TREE
There is no longer any file in components/extensions/ext-* that use require().
Therefore it should be ok to stop exposing it.

MozReview-Commit-ID: EgZYBludlcy
2017-06-22 21:04:02 +02:00
Ryan VanderMeulen
f40c0d4a06 Backed out 4 changesets (bug 1374735) for test_ext_i18n.js failures on a CLOSED TREE.
Backed out changeset 50a36fb7c7f9 (bug 1374735)
Backed out changeset da075933f7bc (bug 1374735)
Backed out changeset b7435cd66ce3 (bug 1374735)
Backed out changeset 22baf4e67730 (bug 1374735)
2017-08-18 12:34:22 -04:00
Julian Descottes
4f93f65273 Bug 1374735 - stop exposing devtools require to extensions ext-* files;r=kmag
There is no longer any file in components/extensions/ext-* that use require().
Therefore it should be ok to stop exposing it.

MozReview-Commit-ID: EgZYBludlcy
2017-06-22 21:04:02 +02:00
Kris Maglione
b4fd636ed8 Bug 1391099: Avoid using checkLoadURIStrWithPrincipal. r=mixedpuppy
checkLoadURIStrWithPrincipal runs URLs through the URI fixup services and
checks against each of the results. This is both expensive and unnecessary for
our purposes.

MozReview-Commit-ID: 4L2Z4KuMZhQ
2017-08-16 16:29:06 -07:00
Kris Maglione
f8d9014f9b Bug 1390010: Part 3 - Limit the amount of schema data sent to web content processes. r=zombie
Web contetnt processes only need access to a small amount of schema data, but
we currently send them the approximately 600K of full schema data that is
mostly useless to them.

This patch limits the schema data sent to web content processes to what they
actually need, and sends the rest only to extension content processes.

MozReview-Commit-ID: 6G0LThNTOu1
2017-08-13 19:00:24 -07:00
Kris Maglione
fde4821f1e Bug 1389847: Don't add caller location to sandbox name if an explicit name is provided. r=krizsa
MozReview-Commit-ID: KOGrrMurs6X
2017-08-12 16:01:00 -07:00
Kris Maglione
15c01aabb8 Bug 1388211: Fold ExtensionAPI.jsm into ExtensionCommon.jsm. r=mixedpuppy
We always load one when we load the other, so there's no need for the overhead
of a separate JSM.

MozReview-Commit-ID: 8u4OhJJEN3b
2017-08-07 17:58:14 -07:00
Kris Maglione
0fb6b2e73c Bug 1388215: Part 3 - Use JIT-friendly defineLazy*Getters methods when defining many lazy imports. r=florian
MozReview-Commit-ID: APoFwUhDFdj
2017-08-09 13:03:36 -07:00