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

55 Коммитов

Автор SHA1 Сообщение Дата
Mark Banner 2c4e35b0a6 Bug 1620218 - Automatic code fixes for Prettier 1.18.2 upgrade. r=mossop,webcompat-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D65509

--HG--
extra : moz-landing-system : lando
2020-03-08 21:45:16 +00:00
Rob Wu 28406c3625 Bug 1443544 - Enforce deadline for shutdown blocker of native messaging r=zombie
Native messaging hosts may ignore requests to be killed, which causes
shutdown blockers that await the termination of the process to wait
indefinitely.

After this patch, the shutdown blocker is guaranteed to be released
after about 9 seconds, after we have attempted to kill the process
twice.

This patch also refactors the `_cleanup` method; it may repeatedly be
called (as seen in bug 1481225), but killing once should be sufficient.

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

--HG--
extra : moz-landing-system : lando
2020-01-24 12:14:16 +00:00
Tomislav Jovanovic 48d05a45cb Bug 1602639 - Switch native messaging from MessageManagers to Conduits r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D58356

--HG--
extra : moz-landing-system : lando
2020-01-16 22:41:27 +00:00
Haik Aftandilian e496f85edc Bug 1576733 - Part 1 - Launch native messaging helper applications with the "disclaim" posix_spawn attribute r=kmag
On macOS, launch native messaging helper apps with a new "Transparency, Consent, and Control" (TCC) attribution chain using the undocumented disclaim posix_spawn attribute.

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

--HG--
extra : moz-landing-system : lando
2019-11-06 04:44:54 +00:00
Brindusan Cristian b135033275 Backed out 2 changesets (bug 1576733) for android build bustages on OSFileConstants.cpp. CLOSED TREE
Backed out changeset 12df7898b0ee (bug 1576733)
Backed out changeset 4ab691bf4228 (bug 1576733)
2019-11-05 21:50:12 +02:00
Haik Aftandilian f5d3bff1d3 Bug 1576733 - Part 1 - Launch native messaging helper applications with the "disclaim" posix_spawn attribute r=kmag
On macOS, launch native messaging helper apps with a new "Transparency, Consent, and Control" (TCC) attribution chain using the undocumented disclaim posix_spawn attribute.

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

--HG--
extra : moz-landing-system : lando
2019-11-05 17:50:37 +00:00
monikamaheshwari 9d60e0d578 Bug 1578683 Turn on ESLint rule prefer-boolean-length-check for toolkit and browser r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D45629

--HG--
extra : moz-landing-system : lando
2019-09-14 09:39:26 +00:00
Victor Porof 4a06c925ac Bug 1561435 - Format toolkit/components/, a=automatic-formatting
# ignore-this-changeset

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

--HG--
extra : source : b5be5b4f4b47c256e28a29f665dc754f6407ee7f
2019-07-05 11:14:05 +02:00
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 2dd0409a0f Bug 1481225: Avoid confusing console spam on native app shutdown. r=aswan
Differential Revision: https://phabricator.services.mozilla.com/D3540

--HG--
extra : rebase_source : b5a240381b7a4b302cca90ac2ac999289891f8d2
2018-08-16 11:13:36 -07:00
Rob Wu 6d7e401a87 Bug 1392067 - Disconnect open extension ports when the message manager goes away
- Previously, if a port is disconnected by the other end, then memory
  would be leaked to `ProxyMessenger.ports` in ExtensionParent.jsm.
  To fix this, the port descriptor is now saved separately, keyed by
  port ID instead of message manager.

- Previously, when a message manager was disconnected (e.g. window
  closed/tab crashed), the port is disconnected only if the port was
  created from that page.
  This patch adds bookkeeping to keep track of the message managers at
  both the sender and receiver's side, so that the port is always
  disconnected when the other side goes away.

- The new test browser_ext_port_disconnect_on_crash.js checks whether
  the ports are disconnected as expected. Previously, the subtest
  connect_from_tab_to_bg_and_crash_tab failed because of the previous
  point.

- Although not as deterministic as the crash test, the new
  browser_ext_port_disconnect_on_window_close.js reproduces the original
  test failure and serves as a regression test for the bug.

- Previously, the data structure in ProxyMessenger.ports contained
  the original `sender` and `recipient`. For the purpose of sending
  port disconnection messages, these are not necessary and therefore
  they have been removed.

- Fix incorrect JSDoc (type of portId is number, not string)

MozReview-Commit-ID: BoaKRVAUKuq
2018-04-25 22:31:03 +02: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
Tomislav Jovanovic b2c8e48429 Bug 1386427 - Part 3: Add `storage` and `pkcs11` NativeManifest types r=kmag
MozReview-Commit-ID: 62MoqNLTxic

--HG--
rename : toolkit/components/extensions/schemas/native_host_manifest.json => toolkit/components/extensions/schemas/native_manifest.json
extra : rebase_source : c6cd9f380c39c97b841f7dd2fdf4014286bcec41
2017-09-16 05:30:13 +02:00
Tomislav Jovanovic 74b5af87d6 Bug 1386427 - Part 2: Extract HostManifestManager to NativeManifests.jsm r=kmag
MozReview-Commit-ID: GrVBZbkTfrB

--HG--
rename : toolkit/components/extensions/NativeMessaging.jsm => toolkit/components/extensions/NativeManifests.jsm
rename : toolkit/components/extensions/test/xpcshell/test_native_messaging.js => toolkit/components/extensions/test/xpcshell/test_native_manifests.js
extra : rebase_source : c83a79d2af724c5d6d15a6ca09330cc6173a8853
2017-09-15 20:14:56 +02:00
Tomislav Jovanovic 8a81eff787 Bug 1386427 - Part 1: Add XRE*NativeManifests locations to dirsvc r=kmag
MozReview-Commit-ID: DoJIP6QZ5AX

--HG--
extra : rebase_source : 8351f66a4ddbe8a7c5a7fdf0dcc96288d060f53a
2017-09-12 18:58:23 +02:00
Kris Maglione 0ecfcbc93e Bug 1388215: Part 3 - Use JIT-friendly defineLazy*Getters methods when defining many lazy imports. r=florian
MozReview-Commit-ID: APoFwUhDFdj

--HG--
extra : rebase_source : 15761873b91efaf1d338b6361bf7168ab4348e0d
2017-08-09 13:03:36 -07:00
Kris Maglione 600b6a2dff Bug 1356546: Part 2 - Use StructuredCloneHolder as transport for MessageManager messages. r=aswan
MozReview-Commit-ID: 3z1uAAbsgTj

--HG--
extra : rebase_source : 42dd1c12709705b0e6fae996ddc7f8bc56240bb0
2017-06-04 20:46:38 -07:00
Rob Wu 7802980fa2 Bug 1307852 - Pass ID of calling add-on to native messaging app r=aswan
This allows native messaging binaries to identify the add-on that
invoked the native messaging app, in case more than one add-on is
allowed to launch the native messaging app.

MozReview-Commit-ID: GgjwfJDbBkW

--HG--
extra : rebase_source : b60d33e9f3936f26b8792ef5cd1f9fea304f29ae
2017-06-01 19:08:02 +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
Alexandre Poirot c90bccb53a Bug 1356231 - Use toolkit EventEmitter.jsm instead of devtools module. r=mossop
MozReview-Commit-ID: 49JI7NtLwKK

--HG--
extra : rebase_source : 7fb015f56be94c4bbe2d56506653f069c9ad8dd3
2017-04-27 17:58:09 +02:00
Wes Kocher c7d27df096 Merge mozilla-central to autoland a=merge 2016-11-11 14:10:32 -08: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
Andrew Swan 19d6f8a342 Bug 1313980 Avoid listening on browser-specific MM with connectNative() r=kmag
MozReview-Commit-ID: Al57DUrys63

--HG--
extra : rebase_source : c12b8733ccc156fbc39cd7e57d61690a658e8f80
2016-11-10 15:17:51 -08:00
Rob Wu 059e445a69 Bug 1299411 - Error messages for native messaging r=aswan
- Combine the errors for a non-existing app and lacking permissions to
  avoid information leakage.
- Do not treat normal application exit as an error.
- Create errors in the right context.
- Add tests that check the error messages.

MozReview-Commit-ID: HxBpeCSyyGN

--HG--
extra : rebase_source : f9406cec6bddd4ab740f5042dd7cc64d4a63e447
2016-09-24 13:45:02 +02:00
Rob Wu 0f0355e922 Bug 1299411 - Move native messaging to child process r=kmag
Move `runtime.connectNative` and `runtime.sendNativeMessage` to
`addon_child`. Note: This does not change the behavior for launching the
native app, it is still launched from the main process.

Now ExtensionUtils's Port is also used for native messaging ports. Now
the behavior of `runtime.connect` and `runtime.connectNative` are
identical from the extension's perspective.
In particular:
- `disconnect()` does not throw when called again (bug 1287229).
- `onDisconnect` is called with error messages (tests will be added in
  the next commit).

MozReview-Commit-ID: AyU9amiLeoL

--HG--
extra : rebase_source : be44523ca1b6555f5c356f12790c896e781d809f
2016-09-24 13:25:56 +02:00
Rob Wu 13c2b6a47f Bug 1299411 - s/on/once/ in NativeApp's sendMessage r=aswan
This communicates more clearly that we expect only one message/event.

MozReview-Commit-ID: 8jDYBVwqQtz

--HG--
extra : rebase_source : acae1570537b17027901253afc2344ffabd7a9ee
2016-09-24 13:22:31 +02:00
Rob Wu edfaa70caa Bug 1299411 - Remove extension param from NativeApp r=aswan
The extension is always available as `context.extension`, so do not
unnecessarily pass the extension as a separate parameter.

MozReview-Commit-ID: 9OaestUAGVk

--HG--
extra : rebase_source : b1f408d3750152477195655c5a777e1ff4682a09
2016-09-24 13:18:48 +02:00
Rob Wu cce894192b Bug 1299411 - separate serialization from sending r=aswan
Serialization of the message should happen in the same process as the
extension context, whereas sending the message should be in the same
process as the owner of the native messaging host.
With webext-oop, the former is an addon process and the latter the
main process. Therefore it is necessary to separate the two roles.

MozReview-Commit-ID: 8BJZmn2QjLJ

--HG--
extra : rebase_source : d0665885c304b45c2f44e82f29c1a8260fe454c5
2016-09-24 13:03:20 +02:00
Kris Maglione 11b59ae527 Bug 1298810: Pass Port object to listeners on native messaging ports. r=rpl
MozReview-Commit-ID: 1saUOB1jyE1

--HG--
extra : rebase_source : 8831300c38bcca9283c25049c463d2b6cf41380d
extra : histedit_source : 3171045999ce6619f5e77af328c90ab3f8fbf994
2016-08-29 13:12:16 -07:00
Kris Maglione 8fd3690336 Bug 1290598: Migrate native messaging tests to xpcshell. r=aswan
MozReview-Commit-ID: 4Uz73l8qGVE

--HG--
extra : rebase_source : f24e9cc3bd9b235a429d5bbe8e6cad509495f24f
extra : source : 486639a0f3ca05afaf0250b514c3641805f1f497
2016-08-02 17:39:51 -07:00
Carsten "Tomcat" Book 4e7abad957 Backed out changeset 486639a0f3ca (bug 1290598) 2016-08-03 15:12:31 +02:00
Kris Maglione 5bca7590fc Bug 1290598: Migrate native messaging tests to xpcshell. r=aswan
MozReview-Commit-ID: 4Uz73l8qGVE

--HG--
extra : rebase_source : 648a0975f8245e42fb1c4afadb841d9990f84714
2016-08-02 17:39:51 -07:00
Kris Maglione 2cb56b7b11 Bug 1288912: Add tests for native messaging round trip time. r=aswan
MozReview-Commit-ID: 6gOpZhvAZUE

--HG--
extra : rebase_source : 14cb6641ae00087c173da3d39c278802ac779a7b
2016-07-28 20:54:40 -07:00
Andrew Swan 5238b6aa15 Bug 1282680 Always use 64-bit registry for native messaging r=kmag
MozReview-Commit-ID: 99JSqHP17v8

--HG--
extra : rebase_source : e40f16680f578ca803522a5194d3be415d37256f
2016-07-18 13:34:19 -07:00
Andrew Swan d1a5ac7b3f Bug 1283010 Fix windows registry paths for native messaging r=kmag
MozReview-Commit-ID: GdaDycckptp

--HG--
extra : rebase_source : 2d752e8e6106e393c10127da11f605744d5fc5f3
2016-06-29 21:47:06 -07:00
Andrew Swan 5b775d5271 Bug 1272522 Handle stderr of native app r=kmag
MozReview-Commit-ID: 5qGw83uTYTu

--HG--
extra : rebase_source : 8cefe9f2661782b45000ff704db2ea7aaa46ac68
2016-07-06 14:57:56 -07:00
Phil Ringnalda 17eab3dd64 Backed out changeset 6a8acb16142d (bug 1283010) for Windows failures in test_native_messaging.js 2016-07-06 19:18:31 -07:00
Andrew Swan e5645e5c78 Bug 1283010 Fix windows registry paths for native messaging r=kmag
MozReview-Commit-ID: GdaDycckptp

--HG--
extra : rebase_source : f5d6b445108feeb233a10122f53eac7e4fb1521d
2016-06-29 21:47:06 -07:00
Andrew Swan dbbcc4f12d Bug 1281995 Support relative paths in host manifest on windows r=kmag
MozReview-Commit-ID: DaqYdPGQC3A

--HG--
extra : rebase_source : 4afc5dc11b145283c92aa58e0670dfd38c881489
2016-06-27 14:52:57 -07:00
Carsten "Tomcat" Book 60fc89ed14 Backed out changeset d4379d1513fd (bug 1272522) for failures in test_ext_alarms.html 2016-07-04 06:25:51 +02:00
Andrew Swan 55e7a44550 Bug 1272522 Handle stderr of native app r=kmag
MozReview-Commit-ID: 5qGw83uTYTu

--HG--
extra : rebase_source : 748b4d02defbdb412cb81709e2ded27347b1d797
2016-06-17 07:27:07 -07:00
Andrew Swan 1eac929388 Bug 1270360 Implement runtime.sendNativeMessage() r=kmag
MozReview-Commit-ID: 93FaGaYto5w

--HG--
extra : rebase_source : 520ff9d6bb6c8d9262c87103090236fcf1923b49
2016-06-08 14:52:35 -07:00
Andrew Swan cedc1d8eaf Bug 1274708 Use Context.jsonStringify() in connectNative r=kmag
MozReview-Commit-ID: J7q49nLg4F3

--HG--
extra : rebase_source : 9bdddffa43811fdff10fa75ea77bc0641012c9a3
2016-06-16 10:10:54 -07:00