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

3888 Коммитов

Автор SHA1 Сообщение Дата
Liang-Heng Chen 1431c1b046 Bug 1634306 - add new cookieBehavior case `BEHAVIOR_REJECT_TRACKER_AND_PARTITION_FOREIGN`; r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D73609
2020-05-05 14:40:21 +00:00
Lina Cambridge 8caa2f7986 Bug 1634191 - Wire up Golden Gate to the new Rust extension storage interface. r=markh
This commit adds syncing support to the `StorageSyncArea` class, via
the Golden Gate library.

It also changes the `BridgedEngine` trait: `initialize` and `finalize`
haven't been useful in practice, since that's managed by the storage
service, and the `LazyStore` takes care of setting up the storage
connection on first use. But, what we do need is a way to signal a
sync is starting, so that the engine can set up temp tables. That's
handled by the new `sync_started`.

Finally, this commit changes `BridgedEngine::set_uploaded` to take a
`sync15_traits::Guid` instead of a `String`.

Differential Revision: https://phabricator.services.mozilla.com/D73415
2020-05-05 06:59:32 +00:00
Lina Cambridge 4eafc7c1a6 Bug 1634191 - Pass BSO fields along with Sync record payloads to bridged Rust engines. r=markh
This commit splits `CryptoWrapper` into a base `RawCryptoWrapper`
class, which only handles encryption and decryption without
parsing the cleartext's contents, and the existing `CryptoWrapper`
class, which works like before.

Our bridged engine subclasses `RawCryptoWrapper`, and
implements some methods to convert records to and from envelopes.
Envelopes are a concept we introduced in `sync15_traits` to pass
along metadata from the BSO wrapper (like the modified time from the
server, and ID, to ensure they match) in addition to the cleartext.
This lets us reuse `sync15_traits::Payload` to parse record payloads
in Rust, and avoids parsing the cleartext in JS, only to stringify it
again when we pass it to the bridged Rust engine.

Differential Revision: https://phabricator.services.mozilla.com/D73581
2020-05-04 22:25:00 +00:00
Lina Cambridge 7783b7bc0b Bug 1634626 - Add interrupt support for `StorageSyncArea`. r=markh,tcsc
This commit adds a `mozIInterruptible` implementation to
`StorageSyncArea`, and changes `LazyStore` to get an a-s interrupt
handle and interrupt pending operations.

Differential Revision: https://phabricator.services.mozilla.com/D73414
2020-05-04 21:32:52 +00:00
Lina Cambridge a9b590300f Bug 1634626 - Refactor interruption in Golden Gate. r=markh,tcsc
This commit removes the `nsICancelable` return values from all
`mozIBridgedSyncEngine` methods, and replaces them with a
`mozIInterruptible` interface that can be implemented by store
classes that support interrupting.

The `nsICancelable` pattern was intended to make each operation
interruptible, without affecting the others. But we can't guarantee
that with SQLite, because it only has a way to interrupt all
running statements on a connection, not specific ones. Further,
this pattern doesn't match what we currently do in a-s, where we
create an internal "interrupt scope" for each operation, and hand
out an "interrupt handle" for interrupting all in-progress
operations.

Storage classes like `StorageSyncArea` can opt in to interruption
by implementing `mozIInterruptible`. It's a separate interface to
protect against accidental misuse: because it interrupts all
statements on the connection, it might lose writes if the current
operation is a `set`, for example. But it's useful for testing and
debugging, so we still expose it.

This commit also changes Golden Gate ferries to hold weak references to
the `BridgedEngine`, so that they don't block teardown.

Differential Revision: https://phabricator.services.mozilla.com/D73413
2020-05-04 21:32:29 +00:00
Andrea Marchesini 66722b7b39 Bug 1629436 - requests with webExtension loading principal are not 3rd party - tests, r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D73028
2020-05-01 22:59:37 +00:00
Ciure Andrei c7af299990 Backed out 2 changesets (bug 1629436) for causing test_chrome_ext_trackingprotection.html failures CLOSED TREE
Backed out changeset 18d21d5f63dd (bug 1629436)
Backed out changeset d14b4bb75db7 (bug 1629436)
2020-05-01 23:43:02 +03:00
Andrea Marchesini a22e6c201b Bug 1629436 - requests with webExtension loading principal are not 3rd party - tests, r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D73028
2020-05-01 17:29:41 +00:00
Brindusan Cristian a9f9ec7365 Bug 1623427 - disable test_ext_activityLog.html for frequent failures on linux. r=jmaher
Differential Revision: https://phabricator.services.mozilla.com/D73420
2020-05-01 11:00:51 +00:00
Csoregi Natalia 86e79fe5d2 Backed out changeset d91e35044576 (bug 1630066) for failures on test_ext_sendmessage_reply2.html. CLOSED TREE 2020-04-30 23:40:17 +03:00
Shane Caraveo c6bf5854a2 Bug 1606862 support devtools as an optional extension permission r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D71829
2020-04-30 18:39:23 +00:00
Dylan Roeh 8ec9a10b6a Bug 1630066 - Reenable test_ext_sendmessage_reply2.html on GeckoView. r=agi
Differential Revision: https://phabricator.services.mozilla.com/D73324
2020-04-30 18:29:57 +00:00
Simon Giesecke 884e6748f3 Bug 1626570 - Improve handling of copying arrays in toolkit/components/extensions/. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D72326
2020-04-30 09:39:07 +00:00
Mark Hammond c777f6f9ed Bug 1634257 - expose wipe_all to mozIExtensionStorageArea. r=lina
Differential Revision: https://phabricator.services.mozilla.com/D73191
2020-04-30 08:16:26 +00:00
Stefan Hindli 49c6346195 Backed out changeset 13bb4d7dde88 (bug 1634257) for spidermoney bustages CLOSED TREE 2020-04-30 10:56:43 +03:00
Mark Hammond baecd41165 Bug 1634257 - expose wipe_all to mozIExtensionStorageArea. r=lina
Differential Revision: https://phabricator.services.mozilla.com/D73191
2020-04-30 07:08:38 +00:00
Daniel Varga 63b9840733 Backed out changeset 8a0b81f6263e (bug 1606862) for causing devtools failures at devtools/client/framework/test/browser_toolbox_toolbar_reorder_with_extension.js
CLOSED TREE
2020-04-30 06:05:20 +03:00
Shane Caraveo 257084d3fa Bug 1606862 support devtools as an optional extension permission r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D71829
2020-04-30 01:50:34 +00:00
Dorel Luca 964d69b146 Backed out changeset 74dce6390e5e (bug 1606862) for Xpcshell failures in extensions/test/xpcshell/test_ext_startup_perf.js. CLOSED TREE 2020-04-30 04:17:57 +03:00
Shane Caraveo 327dcc3d53 Bug 1606862 support devtools as an optional extension permission r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D71829
2020-04-29 23:28:27 +00:00
Perry Jiang 5846eeaf94 Bug 1595197 - fix StreamFilter redirect handling r=zombie,robwu
We need to disconnect the stream filter on redirect and allow the extension
to create a new filter.  However, we also must always retain the channel
provided to us in onStartRequest, otherwise onStop fails.  The request passed
to onStartRequest is always the right channel.

Differential Revision: https://phabricator.services.mozilla.com/D53187
2020-04-29 19:42:25 +00:00
Shane Caraveo a1af8a6df8 Bug 1628239 fix extension permission migration for permissionless extensions r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D72221
2020-04-29 19:45:42 +00:00
Shane Caraveo ad9affc0fe Bug 1628307 fix running webextension in-process tests r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D70265
2020-04-29 19:13:30 +00:00
Shane Caraveo 35a1cb2c57 Bug 1630413 don't prompt for unlimitedStorage extension permission r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D71812
2020-04-22 20:51:52 +00:00
Lina Cambridge 77b6b013f7 No Bug - Improve rustdocs for `webext_storage_bridge`.
This commit also moves `ext_id` into each `StorageOp` variant, instead
of passing it as an argument to `StorageTask`, to make it easier to
follow what each storage operation does.

Differential Revision: https://phabricator.services.mozilla.com/D73093
2020-04-29 16:58:05 +00:00
Lina Cambridge add5457732 Bug 1633943 - Support tearing down a Rust `StorageSyncArea`. r=markh
This commit wires up `StorageSyncArea::teardown()` to call the new
`webext_storage::Store::close()` method.

It also changes `teardown` to drop the `LazyStore`, and thus close its
database connection, on the main thread if dispatching to the task
queue fails. Dispatch should only fail at shutdown, and putting the
owned reference back only adds indirection, since the `StorageSyncArea`
will still drop its `LazyStore` later in shutdown.

Finally, it includes an xpcshell test fix for
https://github.com/mozilla/application-services/pull/3050.

Differential Revision: https://phabricator.services.mozilla.com/D72992
2020-04-29 04:35:45 +00:00
Lina Cambridge 91aacc3dd5 Bug 1633750 - Only build the extension storage Rust-C++ glue if `MOZ_NEW_WEBEXT_STORAGE` is enabled. r=markh
Differential Revision: https://phabricator.services.mozilla.com/D72965
2020-04-29 04:41:31 +00:00
Mark Hammond 310923383d Bug 1633670 - Move a sync-specific test from test_ext_storage.js to test_ext_storage_sync.js. r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D67973
2020-04-28 10:37:14 +00:00
Andrea Marchesini 45e518e2ee Bug 1628755 - Fix test_ext_privacy.js xpcshell-test failure in beta, r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D72810
2020-04-28 17:38:51 +00:00
Mike Hommey f319da1846 Bug 1633639 - Fix new warnings about unused doc comments with rustc 1.43. r=lina
Differential Revision: https://phabricator.services.mozilla.com/D72793
2020-04-28 04:11:09 +00:00
Luca Greco 42507b3a15 Bug 1593240 - Prevent re-entrancy issues in ExtensionPolicyService::CheckContentScripts related to EPS.loadContentScript calls r=robwu,mixedpuppy
ExtensionPolicyService::CheckContentScripts does retrieve mContentScripts a WebExtensionPolicy instance
and it may call the ExtensionProcessScript methods PreloadContentScript or LoadContentScript while iterating
over it mContentScript.

Both PreloadContentScript and LoadContentScript are going to run some privileged JS code, and LoadContentScript
will load an extension content script. There is a chance that some of the JS code executed could call
WebExtensionPolicy::UnregisterContentScript (or RegisterContentScript) and mutate the mContentScripts array
that EPS::CheckContentScripts is already iterating over, and when that happens it is possible that once the
execution goes back to the ongoing CheckContentScripts iteration, the iterator is invalidated and
the InvalidArrayIndex_CRASH triggered.

Differential Revision: https://phabricator.services.mozilla.com/D69336
2020-04-06 18:59:16 +00:00
Luca Greco d2fe19febd Bug 1631434 - Add test case to ensure storage.local data not cleared as a side-effect of removing unlimitedStorage permission. r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D72339
2020-04-27 18:35:05 +00:00
Shane Caraveo 211ea5dc73 Bug 1548011 support proxy as an optional extension permission r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D71118
2020-04-26 22:03:16 +00:00
Shane Caraveo cb8a65428f Bug 1444294 implement browser.permissions onAdded/Removed r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D71231
2020-04-27 16:20:12 +00:00
Lina Cambridge 1aa777d5e1 Bug 1626506 - Add a binding for the new extension storage Rust component. r=markh
The `webext_storage_bridge` crate introduced in this commit bridges the
`mozIExtensionStorageArea` XPCOM interface to the `webext_storage` Rust
component from Application Services.

This commit factors out the following parts from bug 1623245, so that
we can land them piecemeal:

* The `mozIExtensionStorageArea` interfaces, which implement all the
  methods needed to support the `storage.sync` API.
* A Rust implementation of the above, in `StorageSyncArea`.
* A `StorageTask` type, for dispatching storage operations to a
  background task queue.
* A `LazyStore`, which wraps the Rust component's `Store` and lazily
  initializes it on the background queue the first time it's used.
* A `StorageSyncService`, which is our singleton. It holds on to a
  configured `StorageSyncArea`, and hands out references to it via
  `getInterface`. Eventually, we'll extend this to support syncing,
  too.

Differential Revision: https://phabricator.services.mozilla.com/D71897
2020-04-27 05:40:54 +00:00
Mihai Alexandru Michis 807ec47bae Backed out 2 changesets (bug 1626506) for causing bustages.
CLOSED TREE

Backed out changeset f3deedfe235d (bug 1626506)
Backed out changeset 00b40d247500 (bug 1626506)
2020-04-27 08:11:19 +03:00
Lina Cambridge e1b6df9fd4 Bug 1626506 - Add a binding for the new extension storage Rust component. r=markh
The `webext_storage_bridge` crate introduced in this commit bridges the
`mozIExtensionStorageArea` XPCOM interface to the `webext_storage` Rust
component from Application Services.

This commit factors out the following parts from bug 1623245, so that
we can land them piecemeal:

* The `mozIExtensionStorageArea` interfaces, which implement all the
  methods needed to support the `storage.sync` API.
* A Rust implementation of the above, in `StorageSyncArea`.
* A `StorageTask` type, for dispatching storage operations to a
  background task queue.
* A `LazyStore`, which wraps the Rust component's `Store` and lazily
  initializes it on the background queue the first time it's used.
* A `StorageSyncService`, which is our singleton. It holds on to a
  configured `StorageSyncArea`, and hands out references to it via
  `getInterface`. Eventually, we'll extend this to support syncing,
  too.

Differential Revision: https://phabricator.services.mozilla.com/D71897
2020-04-27 03:23:46 +00:00
Cosmin Sabou 58b8c2e82b Backed out 5 changesets (bug 1630414, bug 1444294, bug 1630417, bug 1630418, bug 1548011) for failures on test_ext_all_apis.html. CLOSED TREE
Backed out changeset 1dde649fe4e0 (bug 1548011)
Backed out changeset 87d571004699 (bug 1630418)
Backed out changeset 0a2dafa70692 (bug 1630414)
Backed out changeset a127af3c4cd1 (bug 1630417)
Backed out changeset b35022051d3d (bug 1444294)
2020-04-27 00:52:27 +03:00
Shane Caraveo 15d2acc180 Bug 1548011 support proxy as an optional extension permission r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D71118
2020-04-26 18:37:32 +00:00
Shane Caraveo c46b9b5698 Bug 1444294 implement browser.permissions onAdded/Removed r=robwu
Differential Revision: https://phabricator.services.mozilla.com/D71231
2020-04-26 20:11:10 +00:00
Rob Wu b6d9307bbc Bug 1631933 - Drop support for data:-URLs in webRequest r=mixedpuppy
Differential Revision: https://phabricator.services.mozilla.com/D71991
2020-04-24 19:50:38 +00:00
Rob Wu 3a06d4dda0 Bug 1631771 - Add guard to clearPrimedListeners in ext-backgroundPage.js r=rpl
Differential Revision: https://phabricator.services.mozilla.com/D71990
2020-04-23 10:13:13 +00:00
Agi Sferro 2291f694fb Bug 1535365 - Disable extension process. r=snorp,rbarker
We don't currently restart the extension process and this causes extensions to
randomly stop working when Android kills the extension process.

We can re-enable it once Bug 1355239 is fixed.

Differential Revision: https://phabricator.services.mozilla.com/D71790
2020-04-24 19:07:24 +00:00
Daisuke Akatsuka 1c0e943acf Bug 1604211: Introduce target-switching mechanism for devtools inspectedWindow. r=rpl,ochameau,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D66736
2020-04-24 04:35:51 +00:00
Jean-Yves Avenard 9301368189 Bug 1607984 - P11. Don't assume the page will be loaded synchronously. r=zombie
We must wait for the iframe created by extension1 to be fully loaded before we can attempt to send a message to it.
So we send a message when it is ready, and suspend the execution until this message is received.

Differential Revision: https://phabricator.services.mozilla.com/D70008
2020-04-24 01:58:23 +00:00
Arthur Iakab 5b06305b9f Backed out 4 changesets (bug 1602832) for causing multiple xpcshell failures.
CLOSED TREE

Backed out changeset a5cc1585581f (bug 1602832)
Backed out changeset 3de4624b41dc (bug 1602832)
Backed out changeset da106d35137e (bug 1602832)
Backed out changeset f9388129262a (bug 1602832)
2020-04-23 16:25:26 +03:00
Kershaw Chang d0dabdf4c3 Bug 1602832 - P3: Skip failed tests r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D67448
2020-04-23 12:15:16 +00:00
Csoregi Natalia 448f2f3c76 Backed out 16 changesets (bug 1607984) for leaks on browser_ext_webRequest.js. CLOSED TREE
Backed out changeset 6c6ffa908c06 (bug 1607984)
Backed out changeset e973911e67e6 (bug 1607984)
Backed out changeset 28af6418ac16 (bug 1607984)
Backed out changeset 9a15a605f91a (bug 1607984)
Backed out changeset 52566b3564ba (bug 1607984)
Backed out changeset 142148a95181 (bug 1607984)
Backed out changeset 108e2cb6b2a9 (bug 1607984)
Backed out changeset 77fda525ee12 (bug 1607984)
Backed out changeset 980067f3ac1d (bug 1607984)
Backed out changeset 12b82a39c910 (bug 1607984)
Backed out changeset 7657023a763b (bug 1607984)
Backed out changeset 1ab8758802a6 (bug 1607984)
Backed out changeset 35f22d0817e1 (bug 1607984)
Backed out changeset b8c6277207d8 (bug 1607984)
Backed out changeset 244d3cb006be (bug 1607984)
Backed out changeset 9fc1a237829c (bug 1607984)
2020-04-23 11:49:51 +03:00
Jean-Yves Avenard 27ee50e0c8 Bug 1607984 - P11. Don't assume the page will be loaded synchronously. r=zombie
We must wait for the iframe created by extension1 to be fully loaded before we can attempt to send a message to it.
So we send a message when it is ready, and suspend the execution until this message is received.

Differential Revision: https://phabricator.services.mozilla.com/D70008
2020-04-23 00:58:09 +00:00
Andreea Pavel cac786a35c Backed out 16 changesets (bug 1607984) for multiple test failures e.g test timeouts on a CLOSED TREE
Backed out changeset 4509808243f5 (bug 1607984)
Backed out changeset 0cb21bedf65f (bug 1607984)
Backed out changeset 4e5d89f68293 (bug 1607984)
Backed out changeset 0c0169ed4f04 (bug 1607984)
Backed out changeset ce527a6ffba4 (bug 1607984)
Backed out changeset 63175f596762 (bug 1607984)
Backed out changeset 107be8f3737d (bug 1607984)
Backed out changeset d7600d4d3528 (bug 1607984)
Backed out changeset e11b1b0ecfbf (bug 1607984)
Backed out changeset bed3f6bee79e (bug 1607984)
Backed out changeset abe692da4556 (bug 1607984)
Backed out changeset e02b12515d60 (bug 1607984)
Backed out changeset 7a2ef225a41e (bug 1607984)
Backed out changeset c173bde5106b (bug 1607984)
Backed out changeset dc8b37e10dc7 (bug 1607984)
Backed out changeset 09a651daf344 (bug 1607984)
2020-04-23 03:47:24 +03:00