Commit Graph

743 Commits

Author SHA1 Message Date
Simon Giesecke
aaf6cb4e75 Bug 1617628 - Hide nsBaseHashtable Put overloads in nsRefPtrHashtable subclass. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D63899

--HG--
extra : moz-landing-system : lando
2020-02-25 17:03:36 +00:00
Perry Jiang
b26c3a0f8a Bug 1616254 - MatchScope should check same-origin using ScopeToPrincipal helper r=dom-workers-and-storage-reviewers,asuth
Fixes an issue where directly converting a string to principal causes the
string to fail to be parsed due to "^" being interpreted as the start of
origin attributes (and the rest of the string isn't able to be parsed as
origin attributes).

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

--HG--
extra : moz-landing-system : lando
2020-02-25 00:57:05 +00:00
Perry Jiang
a7700ebe02 Bug 1609665 - push notifications should use registrations with an exact scope match r=dom-workers-and-storage-reviewers,asuth
Also adds ScopeToPrincipal function to convert scope nsIURI/strings to principals.

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

--HG--
extra : moz-landing-system : lando
2020-02-22 00:26:03 +00:00
Perry Jiang
8d915f1a78 Bug 1588152 - allow unclean ServiceWorker shutdown on beta/release builds r=asuth
This patch adds a timer to ServiceWorkerShutdownBlocker in beta/release builds.
The timer, arbitrarily set to 10 seconds, begins once the shutdown blocker
"begins" to block shutdown. When the timer expires, shutdown will be forcefully
unblocked (even if there's still ServiceWorkers that have not completed
shutdown). If all ServiceWorkers shutdown before the timer expires, the timer
callback will be canceled.

All ServiceWorkers should (in theory) shutdown before the timer expires, but
apparently this is not always the case (for currently unknown reasons). So,
it is arguably better from a user-perspective to shutdown uncleanly than stall
and crash when exiting. There also should not be anything unsafe happening as
a result.

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

--HG--
extra : moz-landing-system : lando
2020-02-20 23:42:50 +00:00
Yaron Tausky
5c6bfb7d9a Bug 1610692 - Move call that can run content code out of constructor. r=dom-workers-and-storage-reviewers,asuth
ServiceWorkerRegistration::UpdateState can call content code, which
in turn can result in the registrations getting deleted. This
commit moves the call outside the constructor, so the
registration's creator has a chance to get a proper RefPtr to it.

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

--HG--
extra : moz-landing-system : lando
2020-02-20 13:06:18 +00:00
Jed Davis
ee171b6406 Bug 1615155 - Don't generate default Recv__delete__ if there are args. r=nika
The default method implementations cause problems when trying to
override them with different types in a direct call class.

For the `Recv__delete__` case there's a simple solution: omit it if
there are any arguments, because it doesn't make much sense to specify
arguments and then completely ignore them, and the no-arg case isn't a
problem for overriding.

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

--HG--
extra : moz-landing-system : lando
2020-02-18 20:46:21 +00:00
Perry Jiang
bca3fcb5c6 Bug 1603484 - worker script evaluation resulting in abrupt completion shouldn't be a start failure r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D62371

--HG--
extra : moz-landing-system : lando
2020-02-18 18:49:59 +00:00
Tom Tung
2577a8c2b7 Bug 1613900 - P3 - ServiceWorker should treat all failures after deserializing as deserialization failures; r=dom-workers-and-storage-reviewers,perry
Differential Revision: https://phabricator.services.mozilla.com/D62881

--HG--
extra : moz-landing-system : lando
2020-02-14 21:23:28 +00:00
Yaron Tausky
eed877a1a1 Bug 1607276 - Hold strong reference before calling method r=dom-workers-and-storage-reviewers,perry
Differential Revision: https://phabricator.services.mozilla.com/D61470

--HG--
extra : moz-landing-system : lando
2020-02-10 16:02:31 +00:00
Perry Jiang
f426e380b1 Bug 1609665 - use ScopeContainer instead of plain nsTArray for SW scopes r=dom-workers-and-storage-reviewers,sg,asuth
ScopeContainer provides restricted access to the scopes it contains to maintain
the correct ordering.

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

--HG--
extra : moz-landing-system : lando
2020-02-14 17:27:07 +00:00
Boris Zbarsky
6c66fa85a4 Bug 1615022 part 2. Require an rvalue reference to reject a Promise with an ErrorResult. r=farre,kvark
The rejection process consumes the ErrorResult, so an rvalue reference is the honest thing here.

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

--HG--
extra : moz-landing-system : lando
2020-02-14 15:42:30 +00:00
Eden Chuang
c3c3233900 Bug 1430182 - Disable dom/serviceworkers/test/test_file_upload.html on android platform r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D62725

--HG--
extra : moz-landing-system : lando
2020-02-13 15:54:21 +00:00
Simon Giesecke
b50347f917 Bug 1611415 - Prefer using std::move over forget. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-13 14:38:48 +00:00
Csoregi Natalia
b5e04bbb01 Backed out changeset fb7235b2a1b3 (bug 1603484) for permafailing on shared-worker-import-data-url.any.html. CLOSED TREE 2020-02-13 15:46:32 +02:00
Perry Jiang
fe050e8bb2 Bug 1603484 - worker script evaluation resulting in abrupt completion shouldn't be a start failure r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D62371

--HG--
extra : moz-landing-system : lando
2020-02-12 18:20:02 +00:00
shindli
91aa0518dd Backed out changeset 0c982bc69cb3 (bug 1611415) for causing build bustages in /builds/worker/workspace/build/src/obj-firefox/dist/include/nsCOMPtr CLOSED TREE 2020-02-12 20:13:29 +02:00
Simon Giesecke
f604a47fa5 Bug 1611415 - Applied FixItHints from mozilla-non-std-move. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D60980

--HG--
extra : moz-landing-system : lando
2020-02-12 17:24:41 +00:00
Simon Giesecke
86a8576927 Bug 1613985 - Use default for equivalent-to-default constructors/destructors in dom/serviceworkers. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D62559

--HG--
extra : moz-landing-system : lando
2020-02-12 10:52:29 +00:00
Boris Zbarsky
05327f8a52 Bug 1613978. Allow passing u"...", not just nsAStrings, to templated ThrowType/RangeError. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D62061

--HG--
extra : moz-landing-system : lando
2020-02-10 13:08:48 +00:00
Tom Tung
5666324739 Bug 1612307 - Fix a set of typos on interface mochitests; r=annevk
Differential Revision: https://phabricator.services.mozilla.com/D61579

--HG--
extra : moz-landing-system : lando
2020-02-07 07:37:33 +00:00
Boris Zbarsky
7472066554 Bug 1613571. Align service worker invalid-script-url and invalid-scope-url checks better with the spec. r=dom-workers-and-storage-reviewers,perry
Behavior changes:

1) We now throw a TypeError, not a SecurityError, when the script URI scheme is
not 'http' or 'https', like the spec says to.

2) We now throw when the scope URI scheme is not 'http' or 'https', like the
spec says to.

3) We now throw a proper TypeError, not a DOMException, at the end of
CheckForSlashEscapedCharsInPath.

4) More informative error messages.

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

--HG--
extra : moz-landing-system : lando
2020-02-06 19:56:31 +00:00
Andrea Marchesini
b13b3b72d2 Bug 1611855 - Worklet must be part of the same parent's agentCluster - part 2 - CloneDataPolicy in writing, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D61182

--HG--
extra : moz-landing-system : lando
2020-02-06 13:46:25 +00:00
Narcis Beleuzu
d259fe38d8 Backed out 13 changesets (bug 1611855) for wpt failures on /audioworklet-postmessage-sharedarraybuffer.https.html . CLOSED TREE
Backed out changeset 2b661d588f96 (bug 1611855)
Backed out changeset 16094fc92bc9 (bug 1611855)
Backed out changeset 3f89bbcaff92 (bug 1611855)
Backed out changeset a906501b6d92 (bug 1611855)
Backed out changeset 54738b88425d (bug 1611855)
Backed out changeset d27de910a6c0 (bug 1611855)
Backed out changeset 261902f6336d (bug 1611855)
Backed out changeset 380d83b61e62 (bug 1611855)
Backed out changeset 39aac60ebf5e (bug 1611855)
Backed out changeset 5ea099787376 (bug 1611855)
Backed out changeset d0f58871f838 (bug 1611855)
Backed out changeset e1be102310a9 (bug 1611855)
Backed out changeset 633357835540 (bug 1611855)

--HG--
rename : dom/base/test/test_postMessages_workers.html => dom/base/test/test_postMessages.html
2020-02-06 12:31:36 +02:00
Andrea Marchesini
87b1a8a547 Bug 1611855 - Worklet must be part of the same parent's agentCluster - part 2 - CloneDataPolicy in writing, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D61182

--HG--
extra : moz-landing-system : lando
2020-02-05 22:07:34 +00:00
Perry Jiang
440ca432fa Bug 1602393 - remove ServiceWorkerRegistrar string duplication r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D61604

--HG--
extra : moz-landing-system : lando
2020-02-04 18:34:43 +00:00
Boris Zbarsky
b88d5ac5a8 Bug 1612213 part 1. Switch most consumers of ThrowDOMException to the new methods. r=smaug,jgilbert
Differential Revision: https://phabricator.services.mozilla.com/D61267

--HG--
extra : moz-landing-system : lando
2020-02-03 20:19:11 +00:00
Boris Zbarsky
257ad3a634 Bug 1412856 part 6. Add more useful error messages for serviceworker exceptions. r=dom-workers-and-storage-reviewers,perry?
For some of these I had to take a guess due to lack of familiarity with this
code, so careful review of the actual strings would be much appreciated.

There's still a bunch of code in dom/serviceworkers that constructs a
CopyableErrorResult from just an nsresult, but I don't understand that code well
enough to write good error messages.

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

--HG--
extra : moz-landing-system : lando
2020-02-03 20:09:15 +00:00
Boris Zbarsky
18f4a563a6 Bug 1412856 part 3. Test for the right exception code for TypeErrors. r=dom-workers-and-storage-reviewers,perry?
I think the current code made us filter out all the carefully crafted TypeError
messages we might have reported...

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

--HG--
extra : moz-landing-system : lando
2020-01-30 08:09:58 +00:00
Boris Zbarsky
a389959875 Bug 1412856 part 1. Change ClientOpPromise to use a CopyableErrorResult for its rejection type. r=dom-workers-and-storage-reviewers,sg?
Differential Revision: https://phabricator.services.mozilla.com/D61196

--HG--
extra : moz-landing-system : lando
2020-01-30 09:01:26 +00:00
Tom Tung
7537dfd059 Bug 1612307 - Correct the channels for Atmoics and SharedArrayBuffer in interfaces mochitests; r=annevk
Differential Revision: https://phabricator.services.mozilla.com/D61429

--HG--
extra : moz-landing-system : lando
2020-02-03 16:47:37 +00:00
Simon Giesecke
b7632583c7 Bug 1539498 - Make SerializedStructuredCloneBuffer move-only. r=asuth,jld,baku
Replace all implicit copies by moves, or explicit clone operations.

Fixed a bug in /home/simon/work/ipdl/ipc/ipdl/ipdl/lower.py _cxxConstRefType,
which caused the const accessor to miss const on its return type for a moveonly
struct member.

Removed unused using directives for SerializedStructuredCloneBuffer in ipdl files.

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

--HG--
extra : moz-landing-system : lando
2020-02-01 15:16:43 +00:00
Oana Pop Rus
3e5b57f2d3 Backed out 3 changesets (bug 1539498, bug 1545196) for build bustages failures in DOMTypes.h on a CLOSED TREE
Backed out changeset 0f906da3634a (bug 1539498)
Backed out changeset ccc2f1aad57a (bug 1545196)
Backed out changeset 15e8d9547568 (bug 1545196)
2020-02-01 17:06:28 +02:00
Simon Giesecke
3c2df87890 Bug 1539498 - Make SerializedStructuredCloneBuffer move-only. r=asuth,jld,baku
Replace all implicit copies by moves, or explicit clone operations.

Fixed a bug in /home/simon/work/ipdl/ipc/ipdl/ipdl/lower.py _cxxConstRefType,
which caused the const accessor to miss const on its return type for a moveonly
struct member.

Removed unused using directives for SerializedStructuredCloneBuffer in ipdl files.

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

--HG--
extra : moz-landing-system : lando
2020-02-01 14:31:56 +00:00
Perry Jiang
a4d550dbb6 Bug 1603374 - account for Cancel calling WorkerRun r=dom-workers-and-storage-reviewers,asuth
MainThreadWorkerControlRunnable::Cancel (indirectly) calls WorkerRun, which is
neither intuitive nor documented, but UpdateStateOpRunnable needs to account for
that to avoid a release assertion failure in ServiceWorkerOpArgs::AssertSanity.

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

--HG--
extra : moz-landing-system : lando
2020-01-30 10:32:38 +00:00
Perry Jiang
a0f4d9f5ad Bug 1611046 - add ServiceWorker shutdown progress tracking r=dom-workers-and-storage-reviewers,asuth
ServiceWorkerShutdownState encapsulates the shutdown progress for a particular
ServiceWorker. The shutdown process involves a "shutdown message" passing
multiple threads in both parent/content processes; we report a progress update
when it's known that a shutdown message has reached a particular thread. The
idea is that in the event of a shutdown timeout, ServiceWorkerShutdownBlocker
will be able to provide diagnostics for where shutdown processes are stalled.

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

--HG--
extra : moz-landing-system : lando
2020-01-29 10:08:35 +00:00
Narcis Beleuzu
18ef916675 Backed out changeset a59d382a7950 (bug 1611046) for bustages on nsCodeCoverage.cpp 2020-01-27 13:38:30 +02:00
Perry Jiang
380587aa2f Bug 1611046 - add ServiceWorker shutdown progress tracking r=dom-workers-and-storage-reviewers,asuth
ServiceWorkerShutdownState encapsulates the shutdown progress for a particular
ServiceWorker. The shutdown process involves a "shutdown message" passing
multiple threads in both parent/content processes; we report a progress update
when it's known that a shutdown message has reached a particular thread. The
idea is that in the event of a shutdown timeout, ServiceWorkerShutdownBlocker
will be able to provide diagnostics for where shutdown processes are stalled.

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

--HG--
extra : moz-landing-system : lando
2020-01-24 22:59:48 +00:00
Perry Jiang
c2250891d2 Bug 1264175 - remove FetchEvent.isReload r=dom-workers-and-storage-reviewers,valentin,sg,bzbarsky
isReload is no longer a property defined by the FetchEvent specification.

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

--HG--
extra : moz-landing-system : lando
2020-01-25 00:05:12 +00:00
shindli
78f9c85759 Backed out changeset 86d1da74131f (bug 1264175) for causing mochitest failures in dom/serviceworkers/test/test_fetch_event.html CLOSED TREE 2020-01-24 06:18:04 +02:00
Perry Jiang
64699e71f7 Bug 1264175 - remove FetchEvent.isReload r=dom-workers-and-storage-reviewers,valentin,sg,bzbarsky
isReload is no longer a property defined by the FetchEvent specification.

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

--HG--
extra : moz-landing-system : lando
2020-01-24 02:38:01 +00:00
Emilio Cobos Álvarez
256c124f94 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
This was done by:

This was done by applying:

```
diff --git a/python/mozbuild/mozbuild/code-analysis/mach_commands.py b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
index 789affde7bbf..fe33c4c7d4d1 100644
--- a/python/mozbuild/mozbuild/code-analysis/mach_commands.py
+++ b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
@@ -2007,7 +2007,7 @@ class StaticAnalysis(MachCommandBase):
         from subprocess import Popen, PIPE, check_output, CalledProcessError

         diff_process = Popen(self._get_clang_format_diff_command(commit), stdout=PIPE)
-        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format]
+        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format, '-sort-includes']

         if not output_file:
             args.append("-i")
```

Then running `./mach clang-format -c <commit-hash>`

Then undoing that patch.

Then running check_spidermonkey_style.py --fixup

Then running `./mach clang-format`

I had to fix four things:

 * I needed to move <utility> back down in GuardObjects.h because I was hitting
   obscure problems with our system include wrappers like this:

0:03.94 /usr/include/stdlib.h:550:14: error: exception specification in declaration does not match previous declaration
0:03.94 extern void *realloc (void *__ptr, size_t __size)
0:03.94              ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/malloc_decls.h:53:1: note: previous declaration is here
0:03.94 MALLOC_DECL(realloc, void*, void*, size_t)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozilla/mozalloc.h:22:32: note: expanded from macro 'MALLOC_DECL'
0:03.94     MOZ_MEMORY_API return_type name##_impl(__VA_ARGS__);
0:03.94                                ^
0:03.94 <scratch space>:178:1: note: expanded from here
0:03.94 realloc_impl
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozmemory_wrap.h:142:41: note: expanded from macro 'realloc_impl'
0:03.94 #define realloc_impl mozmem_malloc_impl(realloc)

   Which I really didn't feel like digging into.

 * I had to restore the order of TrustOverrideUtils.h and related files in nss
   because the .inc files depend on TrustOverrideUtils.h being included earlier.

 * I had to add a missing include to RollingNumber.h

 * Also had to partially restore include order in JsepSessionImpl.cpp to avoid
   some -WError issues due to some static inline functions being defined in a
   header but not used in the rest of the compilation unit.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:19:48 +00:00
Emilio Cobos Álvarez
aa3a695712 Bug 1609996 - Remove mozilla/Move.h. r=froydnj
rg -l 'mozilla/Move.h' | xargs sed -i 's/#include "mozilla\/Move.h"/#include <utility>/g'

Further manual fixups and cleanups to the include order incoming.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:18:20 +00:00
Perry Jiang
a678a5930a Bug 1609665 - promote diagnostic assert to release assert r=asuth
Attempting to narrow down the crash of a null ServiceWorkerRegistrationInfo.

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

--HG--
extra : moz-landing-system : lando
2020-01-17 23:36:30 +00:00
Perry Jiang
9b1cfbf283 Bug 1409979 - ExtendableEvent.waitUntil should account for dispatch flag r=asuth
This patch allows ExtendableEvent.waitUntil to be successfully called while
an ExtendableEvent is being dispatched. Initially, calls would fail if the
internal "pending promises count" reached zero during a microtask checkpoint
in between two event handler invocation tasks. This patch add the additional
condition that the dispatch flag must be unset for subsequent calls to fail.

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

--HG--
extra : moz-landing-system : lando
2020-01-15 15:49:26 +00:00
Yaron Tausky
da54258573 Bug 1430182 - Remove racy code from test_file_upload.html r=dom-workers-and-storage-reviewers,sg
This test contains a few race conditions that could cause it to
hang and time out. This commit removes them, hopefully solving the
intermittent failures.

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

--HG--
extra : moz-landing-system : lando
2020-01-15 09:23:52 +00:00
Eric Rahm
78ee6675cf Bug 1606187 - Part 2b: Update users of nsClassHashtable to handle UniquePtr differences r=KrisWright,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D59042

--HG--
extra : moz-landing-system : lando
2020-01-13 19:18:56 +00:00
Perry Jiang
9aff8c3b36 Bug 1606157 - ServiceWorkerJob notify callbacks its being discarded r=asuth
Differential Revision: https://phabricator.services.mozilla.com/D59007

--HG--
extra : moz-landing-system : lando
2020-01-11 04:21:41 +00:00
Perry Jiang
2ac1c6112f Bug 1588838 - decrease "idle extended timeout" to 30 seconds r=dom-workers-and-storage-reviewers,asuth
This gives each ServiceWorker a total of 1 minute to finish doing "something"
(unless the timeout is reset by something else the ServiceWorker needs to do).
1 minute is chosen to be roughly consistent with Chrome/Safari (as opposed to
a total of 5 minutes 30 seconds).

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

--HG--
extra : moz-landing-system : lando
2020-01-09 00:30:27 +00:00
Valentin Gosu
c7d9b630cb Bug 1552176 - Add nsIRequest.set/getTRRMode r=dragana
* Makes it possible to selectively enable TRR for pbmode/container/window/etc

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

--HG--
extra : moz-landing-system : lando
2020-01-07 20:20:38 +00:00
Perry Jiang
044d7a6a91 Bug 1604943 - ServiceWorkerRegistration.update should capture newest worker script URL at call-time r=dom-workers-and-storage-reviewers,asuth
- Cleaned up some comments.
- Changed some const nsACString& parameter types to nsCString to accept r-value
  and l-value nsCStrings.

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

--HG--
extra : moz-landing-system : lando
2020-01-08 03:21:27 +00:00