Commit graph

62 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
Kris Maglione
a27fd1f4d6 Bug 1476032: Neuter StructuredCloneHolder objects after deserializing. r=aswan
Differential Revision: https://phabricator.services.mozilla.com/D17287

--HG--
extra : rebase_source : 7fdebc79676f9161d392931e3b7f8840faed9a9d
2019-01-22 13:01:22 -08:00
Boris Zbarsky
e4b74becff Bug 1479569 part 2. Use the new messageManager getter on docshell. r=kmag
I generally tried to preserve the behavior of consumers where they treated an
exception from getInterface(Ci.nsIContentFrameMessageManager) as a signal to use
some sort of fallback.

I did change the behavior of consumers that walked up to the root same-type
docshell before getting the message manager to just get it directly from the
docshell they have.  Please review those parts carefully, and let me know if you
want me to ask some subject area experts to review those.
2018-08-02 23:49:09 -04:00
Csoregi Natalia
08c950712e Backed out 3 changesets (bug 1479569) for devtools/client/responsive.html failures. CLOSED TREE
Backed out changeset e123d0aa911c (bug 1479569)
Backed out changeset b828a58404e5 (bug 1479569)
Backed out changeset 97041ef8f311 (bug 1479569)
2018-08-03 10:39:12 +03:00
Boris Zbarsky
0197de77c0 Bug 1479569 part 2. Use the new messageManager getter on docshell. r=kmag
I generally tried to preserve the behavior of consumers where they treated an
exception from getInterface(Ci.nsIContentFrameMessageManager) as a signal to use
some sort of fallback.

I did change the behavior of consumers that walked up to the root same-type
docshell before getting the message manager to just get it directly from the
docshell they have.  Please review those parts carefully, and let me know if you
want me to ask some subject area experts to review those.
2018-08-02 23:49:09 -04:00
Kris Maglione
fcedebb912 Bug 1471102: Move more code out of ExtensionUtils.jsm. r=aswan
MozReview-Commit-ID: Fqlv5BRuuW8

--HG--
extra : rebase_source : 348f037abd9cecfa080183bc365e5f005eac1bd6
extra : amend_source : 05dbfd12f553fc3f2a93374402e34d271e26d767
2018-06-25 19:30:21 -07:00
Kris Maglione
c15bbfb699 Bug 1451058: Follow-up: Fix some errors that show up during tests. r=me
MozReview-Commit-ID: K410z6VdHov

--HG--
extra : rebase_source : d768c2637f1fec2465f9e03b5e2b3e1ad25dadc5
2018-04-06 16:34:15 -07:00
Boris Zbarsky
a4c5e65aa3 Bug 1449631 part 1. Remove JS uses of nsIDOMEventTarget. r=smaug
MozReview-Commit-ID: CCHCZjMgInu
2018-04-05 13:42:40 -04:00
Kris Maglione
3c4a7741ac 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

--HG--
extra : rebase_source : 995ea3c6de26b616a6cef483b271e222bb2aaf6e
2018-03-01 16:39:08 -08:00
Florian Quèze
682b1ec3b2 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
5dec0e0beb 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

--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
2018-02-06 09:36:57 -08: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
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
Mark Banner
4de6bf22b1 Bug 1411368 - Automatically fix no-multi-spaces issues raised when using ESLint 4. r=mossop
MozReview-Commit-ID: H5YVp3rnzGo

--HG--
extra : rebase_source : 5b45b6c0df834131812d094e975047eaad374e06
2017-10-26 11:47:01 +01:00
Kris Maglione
2fc1dbc67c Bug 1404652: Part 2 - Coalesce multiple event dispatches into a single message during an idle slice. r=zombie
Sending MessageManager messages is expensive, but a lot of the overhead is
per-message more than it's tied to the complexity of the message. In
particular:

- Each sendAsyncMessage call incurs separate XPConnect method call overhead.

- Each message requires acquiring a lock, and separate message setup overhead
  for IPC.

- The message data itself must be structured cloned, which requires
  (expensive) allocation of buffers to hold the serialized data. Each buffer
  segment is 4KB, which is generally enough to hold multiple serialized
  messages, so coalescing messages means fewer buffer allocations.

Moving some of this work into idle slices also means less likelihood of
interfering with UI responsiveness.

MozReview-Commit-ID: 5SAMZNLVaY3

--HG--
extra : rebase_source : 752f7a8dff392c127b2cb3207c7509a57c734f32
2017-09-28 20:14:17 -07:00
Kris Maglione
988d03b779 Bug 1398630: Part 7 - Random cleanup. r=zombie
MozReview-Commit-ID: LibtXDKXrnA

--HG--
extra : rebase_source : 34035be1600f0e62e738a2d4df1ece10714f992f
2017-09-10 15:37:08 -07:00
Kris Maglione
5b8215cd47 Bug 1397448: Part 4 - Use a simpler message broker for response messages. r=zombie
MozReview-Commit-ID: 9wVG6SDJO2w

--HG--
extra : rebase_source : ac6861cdcdf6bc7165670db53e0ddce778de43e0
2017-09-08 17:14:07 -07:00
Kris Maglione
1565b820e8 Bug 1397448: Part 3 - Reduce the number of promise callbacks created in MessageChannel. r=zombie
MozReview-Commit-ID: 2A4P9eaWnKx

--HG--
extra : rebase_source : 6a310d6c8c38032cdc9df218eb0983aa4feabf9f
2017-09-10 10:05:25 -07:00
Tomislav Jovanovic
5b4daf074a Bug 1389968 - Reject sendMessage() promise when response handle gets GCd r=kmag
MozReview-Commit-ID: C2g3VSWYKuz

--HG--
extra : rebase_source : 60c0b6553956413f8d9b73f88fbae601537c53c4
2017-08-23 00:16:48 +02:00
Kris Maglione
426dea9932 Bug 1391353: Try to avoid keeping message data alive while waiting for responses. r=zombie
MozReview-Commit-ID: 5JAUBWufpsf

--HG--
extra : rebase_source : 379c6fbf6661ca8d05dff55547ac2c60c2e1e23b
2017-08-17 11:41:55 -07:00
Kris Maglione
a279f88d8b Bug 1389855: Remove lazy imports from MessageChannel.jsm. r=zombie
MozReview-Commit-ID: A1d5WdrMB3K

--HG--
extra : rebase_source : 54281821028333a26e4a59b74d10a27aee04eb47
2017-08-12 18:05:06 -07:00
Kris Maglione
81748f7c7f Bug 1389381: Part 1 - Synchronously remove rending responses after aborting them. r=aswan
Pending responses are normally removed by the response's promise handlers. But
since promise handlers are called asynchronously, multiple calls to
abortResponses can wind up handling the same already-aborted responses when
called before we process the microtask queue.

MozReview-Commit-ID: 4jy0O7PaoqP

--HG--
extra : rebase_source : ceba0c832becc1cd2938030d28f698487a52fc05
2017-08-11 14:37:53 -07:00
Kris Maglione
a97f59bd1b Bug 1380290: Use correct message manager when communicating with inline options browsers. r=aswan
MozReview-Commit-ID: HpxXG3S2zgp

--HG--
extra : rebase_source : fea9712e94676ea0d8c71a59788a6df51780ec2a
2017-07-12 17:41:12 -07: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
d6e7aeff05 Bug 1363445: Speed up MessageChannel.addListener. r=aswan
MozReview-Commit-ID: iYavkWIQC

--HG--
extra : rebase_source : 483108e9eb04f8a7b93d9456c4e5882c9be52fa6
2017-05-09 10:22:41 -07:00
Kris Maglione
af56411551 Bug 1317697: Fix handling of more canceled responses. r=mixedpuppy
MozReview-Commit-ID: Axy06zeyPaa

--HG--
extra : rebase_source : d8ca4c3689fb2ea5d84d7737d3b2dfbd8607df02
2017-04-06 20:11:54 -07:00
Florian Queze
37ff4fc7cc Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Sebastian Hengst
a07223d699 Backed out changeset 322fde2d53bf (bug 1356569) so bug 1355161 can be backed out. r=backout 2017-04-14 23:39:22 +02:00
Florian Queze
95d4d20c17 Bug 1356569 - Remove addObserver's last parameter when it is false, r=jaws. 2017-04-14 21:51:38 +02:00
Matthew Wein
d4d1e8306d Part 1: Bug 1295807 - Add a Javascript Module for registering proxy scripts. r=kmag,robwu
MozReview-Commit-ID: HLokEivMpmp

--HG--
extra : rebase_source : 791e50798c23750491b611a2264a774dfe65bdb1
2017-03-06 17:04:46 -05:00
Ryan VanderMeulen
793ded7eb9 Backed out changeset 7a576717126b (bug 1295807) for unresolved review issues. DONTBUILD 2017-03-06 16:47:49 -05:00
Matthew Wein
d6c0de497b Part 1: Bug 1295807 - Add a Javascript Module for registering proxy scripts. r=kmag,robwu
MozReview-Commit-ID: HLokEivMpmp

--HG--
extra : rebase_source : 5e07caa86b9dea5651e2da36f3684d983b6e9824
2017-03-03 23:25:57 +00:00
Sebastian Hengst
bbb26e9514 Backed out changeset 488acde695af (bug 1295807) for formatting failure in extensions-toolkit.manifest and eslint failure. r=backout 2017-03-05 20:18:41 +01:00
Matthew Wein
fc0ab1d41b Part 1: Bug 1295807 - Add a Javascript Module for registering proxy scripts. r=kmag,robwu
MozReview-Commit-ID: HLokEivMpmp

--HG--
extra : rebase_source : 5e07caa86b9dea5651e2da36f3684d983b6e9824
2017-03-03 23:25:57 +00:00
Wes Kocher
2225ff98bb Backed out 2 changesets (bug 1295807) for build bustage a=backout
Backed out changeset 1b162d4857b5 (bug 1295807)
Backed out changeset 1a9f4c3c782d (bug 1295807)

MozReview-Commit-ID: A7E4wtTcBNM
2017-03-02 18:19:10 -08:00
Matthew Wein
af0e29d44a Part 1: Bug 1295807 - Add a Javascript Module for registering proxy scripts. r=kmag,robwu
MozReview-Commit-ID: HLokEivMpmp

--HG--
extra : rebase_source : 0d03479790086aba990bb5363884bc3ee1479e69
2017-03-01 15:35:34 +00:00
Kris Maglione
8de024d1d5 Bug 1339144 - Use windowless browser for remote background pages. r=aswan
MozReview-Commit-ID: LfmPbkTsgwu

--HG--
extra : rebase_source : 1cec29f836884b7f5ac400f0a0af904bad6488a8
extra : intermediate-source : c122b0183c7c94342c7bac953987ca1ed9c94625
extra : source : 2ba94924e6d7959f5d8850e6ab14008d4a1c6288
2017-02-16 17:26:15 -08:00
Iris Hsiao
94c8bb425f Backed out changeset c122b0183c7c (bug 1339144) for xpcshell failures
--HG--
extra : rebase_source : c207c08be92de010922c4e9d1559673f313558e9
2017-02-17 10:40:20 +08:00
Kris Maglione
43e4c2bb06 Bug 1339144 - Use windowless browser for remote background pages. r=aswan
MozReview-Commit-ID: LfmPbkTsgwu

--HG--
extra : source : 2ba94924e6d7959f5d8850e6ab14008d4a1c6288
extra : histedit_source : 2035406acd128331977baf481e5ad6c85252d067%2C97c30a16513b28e0f932161804f421145dc3e363
2017-02-16 17:26:15 -08:00
Kris Maglione
f3909f09a0 Bug 1260548: Part 8 - Cut down on unnecessary console warnings during test runs. r=aswan
This isn't strictly related to the rest of the changes, but was helpful in the
course of debugging them.

MozReview-Commit-ID: 2nvccYYVXfR

--HG--
extra : rebase_source : 9bdca6a4d1de46792375a95691bf62a3ba985464
2017-01-29 00:58:25 -08:00
Kris Maglione
0952c5192f Add getUniqueId helper function to ExtensionUtils. (no bug) r=me
MozReview-Commit-ID: BXi3Yse5jFt

--HG--
extra : source : 6790d8962ad997c31d17c15e78d3a39692ec390a
extra : histedit_source : 669a91624ead45572eb15ef197ff6d18eec234f3
2016-11-10 21:44:05 -08:00
Sebastian Hengst
13f60ef97d Backed out changeset 6790d8962ad9 to make ESlint happy. r=backout 2016-11-12 17:07:10 +01:00
Kris Maglione
b3f72b77fb Add getUniqueId helper function to ExtensionUtils. (no bug) r=me
MozReview-Commit-ID: BXi3Yse5jFt

--HG--
extra : rebase_source : 9de32f05ee6c166fd5be63edb170faba4cf85af8
2016-11-10 21:44:05 -08:00
Kris Maglione
1a0bcdb88b Bug 1316396: Part 5 - Move MessageManagerProxy to ExtensionUtils, and add support for proxied listeners. r=aswan
MozReview-Commit-ID: KhinS46k0yW

--HG--
extra : rebase_source : f7a165c5653f729b6cb987d9545d1af6c76ebbfc
2016-11-10 10:50:36 -08:00
Kris Maglione
9ec833d34e Bug 1308421: Handle MessageChannel responses correctly after docshells have been swapped. r=aswan
MozReview-Commit-ID: HDTrBfdclXd

--HG--
extra : rebase_source : ec09a6772df798982fc2d52153186fd901a3984c
extra : amend_source : da03f0645ee6561497936f7c42d46f941ad2dd77
extra : histedit_source : 0937500d487c46a738c0a2783b04054ec238a940
2016-10-11 21:08:33 +01:00
Rob Wu
1983c2ea5d Bug 1302020 - Add filter to Messenger + fix code documentation r=billm
- Make all keys in `filter` mandatory.
- Add `optionalFilter` to Messenger to take over the role of the former
  `filter` parameter.
- Add documentation to Messenger to explain what it really does.
- Fix type comments. Many message message managers were declared as a
  sender, while they are at most a receiver (e.g. `Services.pppm`).

MozReview-Commit-ID: ILDnP2qDIK9

--HG--
extra : rebase_source : e953fe3d5e9120dc47662b6fae071e6560d2c4b7
2016-09-11 22:38:40 -07:00