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

918 Коммитов

Автор SHA1 Сообщение Дата
Simon Giesecke 5bfbb2a572 Bug 1673931 - Avoid including Document.h from header files. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D95046

Depends on D95045
2020-11-23 16:07:43 +00:00
Simon Giesecke 6f7b6986d5 Bug 1673424 - Fix includes around StructuredCloneData.h.
Differential Revision: https://phabricator.services.mozilla.com/D94763

Depends on D94762
2020-11-23 16:07:01 +00:00
Simon Giesecke fb7f3afbc4 Bug 1660470 - Avoid including ServiceWorkerIPCUtils.h from header files. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D93555

Depends on D93552
2020-11-23 16:05:38 +00:00
Simon Giesecke 252f99be51 Bug 1660470 - Avoid including ErrorIPCUtils.h from header files. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D93243

Depends on D93242
2020-11-23 16:04:28 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Nika Layzell 43b599baf6 Bug 1603340 - Disable browser_force_refresh.js under verify, r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D95892
2020-11-12 18:01:08 +00:00
Nika Layzell 42028efc71 Bug 1671983 - Part 4: Stop awaiting BrowserTestUtils.loadURI, r=annyG,remote-protocol-reviewers,extension-reviewers,preferences-reviewers,whimboo,zombie
This method only is async in order to allow callers to wait for a process switch
triggered by the call to `loadURI` to be finished before resolving. With
DocumentChannel, we should never trigger a process switch eagerly like this
again, so we don't need any of the async behaviour here anymore.

This part is largely mechanical changes to tests, removing the `await` calls on
`loadURI`, and a follow-up part will remove the actual async logic from
`BrowserTestUtils.loadURI`.

Differential Revision: https://phabricator.services.mozilla.com/D94641
2020-11-12 18:01:03 +00:00
Hiroyuki Ikezoe fc509369c5 Bug 1676062 - Use a dummy URL data in Servo_ParseEasing and drop Document* and URLExtraData* arguments from relevant functions. r=boris
Differential Revision: https://phabricator.services.mozilla.com/D96791
2020-11-12 20:34:01 +00:00
Yaron Tausky ab81b1287a Bug 1674343 - Check for secure context when deciding to intercept r=asuth,nika,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D96179
2020-11-12 13:48:05 +00:00
Cosmin Sabou 216bc1f5b8 Backed out changeset 28b29531f0c0 (bug 1674343) for mochitest serviceworker related failures. CLOSED TREE 2020-11-10 18:11:10 +02:00
Yaron Tausky 1282d8af41 Bug 1674343 - Check for secure context when deciding to intercept r=asuth,nika,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D96179
2020-11-10 13:50:53 +00:00
Yaron Tausky ca293a0d21 Bug 1675790 - Issue a soft update correctly for non-subresource requests r=dom-workers-and-storage-reviewers,asuth
The Handle Fetch algorithm, steps 17 and 18, requires a soft update
when a fetch event is not dispatch for a non-subresource request.
Before this commit we added the requirement that the registration
be stale, which only applies to subresource requests.

Differential Revision: https://phabricator.services.mozilla.com/D96200
2020-11-06 20:21:10 +00:00
Andi-Bogdan Postelnicu d81fefc9bc Bug 1626555 - Add `dom/serviceworkers` to the list of non-unified-build-compatible directories. r=sg
Differential Revision: https://phabricator.services.mozilla.com/D96441
2020-11-10 11:55:00 +00:00
Andrew Halberstadt 331bc892dd Bug 1675319 - [manifestparser] Properly support multiline skip-if statements, r=jmaher,extension-reviewers,zombie
This supports one manifestparser expression per line in the 'skip-if',
'fail-if' and 'run-if' keys. As a side effect the:

    skip-if = foo ||
        bar

syntax is no longer supported. Instead it can be:

    skip-if =
        foo  # bug 123
        bar  # bug 456

Differential Revision: https://phabricator.services.mozilla.com/D95927
2020-11-05 19:55:08 +00:00
Razvan Maries 10425eddfc Backed out 7 changesets (bug 1658084, bug 1671983) for perma failures on browser_async_remove_tab.js and browser_e10s_chrome_process.js. CLOSED TREE
Backed out changeset 2e6309c1cdbd (bug 1658084)
Backed out changeset 99aafd9304ef (bug 1671983)
Backed out changeset 80280b85280a (bug 1671983)
Backed out changeset 008db2659002 (bug 1671983)
Backed out changeset 32bd45c7fe3a (bug 1671983)
Backed out changeset 56e227e6580c (bug 1671983)
Backed out changeset a404f809f79d (bug 1671983)
2020-11-04 04:23:47 +02:00
Nika Layzell 5f9c85da95 Bug 1671983 - Part 4: Stop awaiting BrowserTestUtils.loadURI, r=annyG,remote-protocol-reviewers,extension-reviewers,preferences-reviewers,whimboo,zombie
This method only is async in order to allow callers to wait for a process switch
triggered by the call to `loadURI` to be finished before resolving. With
DocumentChannel, we should never trigger a process switch eagerly like this
again, so we don't need any of the async behaviour here anymore.

This part is largely mechanical changes to tests, removing the `await` calls on
`loadURI`, and a follow-up part will remove the actual async logic from
`BrowserTestUtils.loadURI`.

Differential Revision: https://phabricator.services.mozilla.com/D94641
2020-11-04 00:55:36 +00:00
Jens Stutte a1d2ede4fe Bug 1674564 - Make ServiceWorkerShutdownBlocker::MaybeInitUnblockShutdownTimer robust against re-entrance r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D95545
2020-11-03 08:19:58 +00:00
Andrew Sutherland 3e7307426b Bug 1588152 - Eliminate redundant profile-change-teardown observer. r=asuth
Under parent intercept, we had both an nsIAsyncShutdownClient and a manual
observer notification used by ServiceWorkerManager for shutdown.  (Under
child intercept, the observer notification used a different phase, but we no
longer support child intercept.)  If the observer notification didn't fire
prior to the shutdown blocker, deadlock would result at shutdown.

This patch addresses the problem by changing us to only use the shutdown blocker
for profile-change-teardown, with it taking on the responsibility of calling
the relevant ServiceWorkerManager shutdown logic.

We do leave a finish shutdown observer notification in place.  It's added
dynamically during shutdown (as long as we can get the observer service)
which I believe should allow the observer to run prior to the QuotaManager
profile-before-change-qm receiving its notification due to the reverse
observer notification.  But that isn't required to avoid deadlocking.

As part of these changes, I also removed the configurable logic around shutdown
that existed to support child intercept.  Note that this is not a comprehensive
cleanup, just a normalization of shutdown to require/assume parent intercept.
The most notable aspect of this change is explicitly bailing out of
ServiceWorkerManager initialization if we are not in the parent process.

Differential Revision: https://phabricator.services.mozilla.com/D94805
2020-10-30 18:44:54 +00:00
Yaron Tausky 979046dde6 Bug 1617822 - Implement FetchEvent.handled r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D93483
2020-10-29 17:18:28 +00:00
Dorel Luca 0dbe717f53 Backed out changeset 585175b84838 (bug 1617822) for WPT failures in service-workers/idlharness.https.any.serviceworker.html. CLOSED TREE 2020-10-29 18:35:20 +02:00
Yaron Tausky 5def06e77f Bug 1617822 - Implement FetchEvent.handled r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D93483
2020-10-29 13:50:44 +00:00
Yaron Tausky 2f66cfee5c Bug 1673738 - Add missing includes to ServiceWorkerOp.cpp r=dom-workers-and-storage-reviewers,sg
Differential Revision: https://phabricator.services.mozilla.com/D94899
2020-10-28 12:21:24 +00:00
Yaron Tausky 3d223d237e Bug 1673748 - Fix incorrect test r=asuth
When responding with a script, the correct Content-Type header must be
set.

Differential Revision: https://phabricator.services.mozilla.com/D94902
2020-10-27 23:32:54 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Perry Jiang 0e70329c0d Bug 1653470 - refcount PServiceWorkerRegistration r=dom-workers-and-storage-reviewers,asuth
Depends on D83884

Differential Revision: https://phabricator.services.mozilla.com/D83885
2020-10-23 11:52:49 +00:00
Perry Jiang 260415ed7c Bug 1653470 - refcount PServiceWorkerContainer r=dom-workers-and-storage-reviewers,asuth
Depends on D83883

Differential Revision: https://phabricator.services.mozilla.com/D83884
2020-10-23 11:51:24 +00:00
Perry Jiang bad3dff4d7 Bug 1653470 - refcount PServiceWorker r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D83883
2020-10-23 11:50:00 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Ryan Hunt 67e0a28855 Bug 1669784 - Merge TypedObject namespace into WebAssembly namespace, gated on GC feature. r=lth
This commit merges the TypedObject namespace into the WebAssembly namespace, and
only exposes the TypedObject definitions when the GC feature is enabled.

A future commit will remove the TypedObject definitions from the namespace, but we
still need the infrastructure from this commit for storing the TypedObject definitions
in private slots in the namespace.

Differential Revision: https://phabricator.services.mozilla.com/D92857
2020-10-12 21:01:39 +00:00
Andrew Sutherland c4e657f4da Bug 1662925 - Make SW fetch events properly queue. r=dom-workers-and-storage-reviewers,janv
Excerpting some documentation I wrote up for an OVERVIEW.md for Service
Workers for this exact use situation below.  The basic situation of this patch
is that we were trying to create the FetchEventOpProxyParent immediately
before the managing PRemoteWorker instance existed, which isn't a thing we can
do.  Because FetchEvent ops are more complicated they require somewhat more
unique handling, but it should have been unified with the PendingOp
infrastructure and was not.  The one notable thing going on actor-wise is that
the request body (if present) requires special RemoteLazyInputStream
serialization and this is something that can only be done once we have the
RemoteWorkerParent.  See https://phabricator.services.mozilla.com/D73173 and
its commit message and my "Restating" blocks for more context.


### Threads and Proxies

#### Main Thread

ServiceWorkerManager's authoritative ServiceWorker state lives on the main
thread in the parent process.  This is due to a combination of legacy factors
and that currently the nsHttpChannel AsyncOpen logic where navigation
interception occurs must be on the main thread.

#### IPDL Background Thread

The IPDL Background Thread is the thread where PBackground parent actors are
created.  Because IPDL actors are explicitly tied to the thread they are created
on and PBackground is the only top-level protocol created for use by DOM
Workers, this thread is the natural home for book-keeping and authoritative
state for APIs that are accessed via PBackground-managed protocols.  For
example, IndexedDB and other QuotaManager-managed storage APIs.

The Remote Worker APIs are all PBackground managed and so all messages sent via
the Remote Worker API need to be sent from the IPDL Background thread.

#### Main Thread to IPDL Background Proxies

There are 2 ways to get data from the main thread to the IPDL Background thread:
either via direct runnable dispatch or via IPDL IPC.  We use IPDL IPC (which
has optimizations for same-process communication).

The following interfaces exist exclusively to proxy requests from the
ServiceWorkerManager on the main thread to the IPDL Background thread.
- `PRemoteWorkerController` is a proxy wrapper around the
  `RemoteWorkerController` API exposed on the IPDL Background thread.
- `PFetchEventOp` is paired with `PFetchEventOpProxy` managed by the above
  `PRemoteWorkerController`.  `PFetchEventOp` gets the data to the IPDL
  Background thread from the main thread, then `PFetchEventOpProxy` gets the
  data down to the content process.

## Non-Fetch ServiceWorker events AKA ExtendableEvents
How non-fetch events are dispatched to the serviceworker (including the IPC).

Because ServiceWorkers are intended to be shutdown and restarted on demand and
most event processing is asynchronous, there needs to be a way to track
outstanding requests and for content logic to indicate when it is done
processing requests.  `ExtendableEvent`s are the mechanism for this.  A method
`waitUntil(promise)` adds promises to be track as long as the event is still
"active".

This straightforward lifecycle means that these events map well to our IPC
async return value mechanism.  This is used by
`PRemoteWorker::ExecServiceWorkerOp`.

## Fetch events and FetchEvent.respondWith()

`FetchEvent`s have a different lifecycle and dataflow than regular
`ExtendableEvents`.  They expose a `respondWith()` method that will eventually
resolve with a fetch `Response` object that potentially needs to be propagated
before the ExtendableEvent is no longer active.  (The response will never be
propagated after `waitUntil()` settles because every call to `respondWith()`
implicitly calls `waitUntil()`.)

From an IPC perspective, this means that `FetchEvent` instances need their own
IPC actor rather than being able to depend on the async return value mechanism
of IPDL.  That's why `PFetchEventOpProxy` exists and is managed by
`PRemoteWorker`.

Differential Revision: https://phabricator.services.mozilla.com/D92021
2020-10-07 16:02:24 +00:00
Kartikaya Gupta aaef0a4678 Bug 1667176 - Miscellaneous unified build fixes. r=mattwoodrow
Upcoming patches shift around which files get unified and expose these build
failures.

Differential Revision: https://phabricator.services.mozilla.com/D91332
2020-09-25 08:57:23 +00:00
Nika Layzell 028b755895 Bug 1664542 - Part 2: Test client.openWindow/COOP+COEP, r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D90624
2020-09-24 16:34:28 +00:00
Simon Giesecke de7bab0f06 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Christoph Kerschbaumer c9b352a0f3 Bug 1666751: Use simple and never failing LoadInfo() getter because all channels should have a loadinfo r=freddyb,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D91119
2020-09-23 12:49:40 +00:00
Luca Greco a67ba2fcd8 Bug 1663125 - Fix registered service workers missing after restart and cover it with a marionette test. r=asuth,whimboo,marionette-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D90189
2020-09-15 14:54:12 +00:00
Tooru Fujisawa 5f55a03e39 Bug 1663500 - Revert bug 1661643 change and resurrect browser.link.open_newwindow=1. r=Gijs,preferences-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D89447
2020-09-08 12:09:43 +00:00
Nathan Froyd cfb8fb313f Bug 1662251 - stop assigning from NS_Convert* values, mostly; r=sg
This patch was generated by running:

```
perl -p -i \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF8toUTF16\((.*)\);/\1CopyUTF8toUTF16(\3, \2);/;' \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF16toUTF8\((.*)\);/\1CopyUTF16toUTF8(\3, \2);/;' \
     $FILE
```

against every .cpp and .h in mozilla-central, and then fixing up the
inevitable errors that happen as a result of matching C++ expressions with
regexes.  The errors fell into three categories:

1. Calling the convert functions with `std::string::c_str()`; these were
   changed to simply pass the string instead, relying on implicit conversion
   to `mozilla::Span`.
2. Calling the convert functions with raw pointers, which is not permitted
   with the copy functions; these were changed to invoke `MakeStringSpan` first.
3. Other miscellaneous errors resulting from over-eager regexes and/or the
   replacement not being type-aware.  These changes were reverted.

Differential Revision: https://phabricator.services.mozilla.com/D88903
2020-09-02 09:54:37 +00:00
Luca Greco a33a4f8a18 Bug 1662526 - Exec method of the ServiceWorkerOp subclasses should return true when a dispatch did not fail. r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D89021
2020-09-01 18:58:26 +00:00
Tooru Fujisawa 9cff0fe8c0 Bug 1661643 - Remove browser.link.open_newwindow=1. r=preferences-reviewers,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D88572
2020-08-28 13:44:46 +00:00
Dimi Lee 55e7a2d5d0 Bug 1654064 - P2. Add a testcase for applying window.open heuristic on a first-party iframe. r=baku
Differential Revision: https://phabricator.services.mozilla.com/D85827
2020-08-06 12:53:00 +00:00
Sonia Singla 7e4a582215 Bug 1528649 - Remove the context parameter from nsInputStreamPump::AsyncRead. r=valentin,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D85154
2020-08-05 11:21:51 +00:00
Anny Gakhokidze 2d1151529c Bug 1654922 - Part 1: Remove DocumentChannel pref usage from tests and document navigation code, r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D85483
2020-08-01 16:36:12 +00:00
Sebastian Streich bf58055b03 Bug 1633710 - Move uri.spec calls to nsIPrincipal r=necko-reviewers,geckoview-reviewers,preferences-reviewers,ckerschb,ntim,snorp,valentin
Differential Revision: https://phabricator.services.mozilla.com/D82911
2020-08-04 11:10:41 +00:00
Simon Giesecke 96f3e7e019 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-04 11:27:07 +00:00
Noemi Erli 381fca9783 Backed out 4 changesets (bug 1654992, bug 1654991) for causing timeous in mask-opacity-1e.html
Backed out changeset 11f0f54c6e0a (bug 1654992)
Backed out changeset a353dd5b3f08 (bug 1654991)
Backed out changeset 6a7964ba549f (bug 1654991)
Backed out changeset cf3bfb91d98c (bug 1654991)
2020-08-03 22:09:36 +03:00
Simon Giesecke 032d2ac9d3 Bug 1654992 - Use std::move instead of SwapElements where possible. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D84807
2020-08-03 14:54:18 +00:00
Perry Jiang da8e648cb4 Bug 1655103 - remove unused ServiceWorkerManager methods r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D84846
2020-07-29 08:40:06 +00:00